good morning!!!!

Skip to content
Snippets Groups Projects
Commit 3fcef54f authored by Taylor Gerring's avatar Taylor Gerring
Browse files

tidy

parent 6bd1f6cc
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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)
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment