good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
3fcef54f
Commit
3fcef54f
authored
Mar 26, 2015
by
Taylor Gerring
Browse files
Options
Downloads
Patches
Plain Diff
tidy
parent
6bd1f6cc
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
rpc/args.go
+12
-1
12 additions, 1 deletion
rpc/args.go
rpc/args_test.go
+3
-8
3 additions, 8 deletions
rpc/args_test.go
with
15 additions
and
9 deletions
rpc/args.go
+
12
−
1
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
...
...
This diff is collapsed.
Click to expand it.
rpc/args_test.go
+
3
−
8
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
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment