Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
0339a138
Commit
0339a138
authored
Mar 16, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RPC empty args tests
parent
719effa7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
args_test.go
rpc/args_test.go
+47
-0
No files found.
rpc/args_test.go
View file @
0339a138
...
...
@@ -74,6 +74,16 @@ func TestGetBlockByHashArgs(t *testing.T) {
}
}
func
TestGetBlockByHashEmpty
(
t
*
testing
.
T
)
{
input
:=
`[]`
args
:=
new
(
GetBlockByHashArgs
)
err
:=
json
.
Unmarshal
([]
byte
(
input
),
&
args
)
if
err
==
nil
{
t
.
Error
(
"Expected error but didn't get one"
)
}
}
func
TestGetBlockByNumberArgs
(
t
*
testing
.
T
)
{
input
:=
`["0x1b4", false]`
expected
:=
new
(
GetBlockByNumberArgs
)
...
...
@@ -94,6 +104,16 @@ func TestGetBlockByNumberArgs(t *testing.T) {
}
}
func
TestGetBlockByNumberEmpty
(
t
*
testing
.
T
)
{
input
:=
`[]`
args
:=
new
(
GetBlockByNumberArgs
)
err
:=
json
.
Unmarshal
([]
byte
(
input
),
&
args
)
if
err
==
nil
{
t
.
Error
(
"Expected error but didn't get one"
)
}
}
func
TestNewTxArgs
(
t
*
testing
.
T
)
{
input
:=
`[{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
"to": "0xd46e8dd67c5d32be8058bb8eb970870f072445675",
...
...
@@ -309,6 +329,33 @@ func TestFilterOptionsWords(t *testing.T) {
}
}
func
TestFilterOptionsNums
(
t
*
testing
.
T
)
{
input
:=
`[{
"fromBlock": 2,
"toBlock": 3
}]`
args
:=
new
(
FilterOptions
)
err
:=
json
.
Unmarshal
([]
byte
(
input
),
&
args
)
switch
err
.
(
type
)
{
case
*
DecodeParamError
:
break
default
:
t
.
Errorf
(
"Should have *DecodeParamError but instead have %T"
,
err
)
}
}
func
TestFilterOptionsEmptyArgs
(
t
*
testing
.
T
)
{
input
:=
`[]`
args
:=
new
(
FilterOptions
)
err
:=
json
.
Unmarshal
([]
byte
(
input
),
&
args
)
if
err
==
nil
{
t
.
Error
(
"Expected error but didn't get one"
)
}
}
func
TestDbArgs
(
t
*
testing
.
T
)
{
input
:=
`["0x74657374","0x6b6579","0x6d79537472696e67"]`
expected
:=
new
(
DbArgs
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment