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
3fcef54f
Commit
3fcef54f
authored
Mar 26, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tidy
parent
6bd1f6cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
args.go
rpc/args.go
+12
-1
args_test.go
rpc/args_test.go
+3
-8
No files found.
rpc/args.go
View file @
3fcef54f
...
...
@@ -29,7 +29,7 @@ func blockHeight(raw interface{}, number *int64) error {
// Parse as string/hexstring
str
,
ok
:=
raw
.
(
string
)
if
!
ok
{
return
NewInvalidTypeError
(
"
blockNumber
"
,
"not a number or string"
)
return
NewInvalidTypeError
(
""
,
"not a number or string"
)
}
switch
str
{
...
...
@@ -82,6 +82,17 @@ func numString(raw interface{}, number *int64) error {
// }
// }
// func hashString(raw interface{}, hash *string) error {
// argstr, ok := raw.(string)
// if !ok {
// return NewInvalidTypeError("", "not a string")
// }
// v := common.IsHex(argstr)
// hash = &argstr
// return nil
// }
type
GetBlockByHashArgs
struct
{
BlockHash
string
IncludeTxs
bool
...
...
rpc/args_test.go
View file @
3fcef54f
...
...
@@ -155,14 +155,9 @@ func TestGetBalanceArgsInvalid(t *testing.T) {
input
:=
`6`
args
:=
new
(
GetBalanceArgs
)
err
:=
json
.
Unmarshal
([]
byte
(
input
),
&
args
)
switch
err
.
(
type
)
{
case
nil
:
t
.
Error
(
"Expected error but didn't get one"
)
case
*
DecodeParamError
:
break
default
:
t
.
Errorf
(
"Expected *rpc.DecodeParamError but got %T with message %s"
,
err
,
err
.
Error
())
str
:=
ExpectDecodeParamError
(
json
.
Unmarshal
([]
byte
(
input
),
&
args
))
if
len
(
str
)
>
0
{
t
.
Error
(
str
)
}
}
...
...
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