From e402e1dc2e72df2a433b984caeaba771085b2b66 Mon Sep 17 00:00:00 2001 From: Taylor Gerring Date: Thu, 2 Apr 2015 13:17:55 +0200 Subject: New args types with stricter checking --- rpc/args_test.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'rpc/args_test.go') diff --git a/rpc/args_test.go b/rpc/args_test.go index 3635882c0..f00899b79 100644 --- a/rpc/args_test.go +++ b/rpc/args_test.go @@ -225,7 +225,7 @@ func TestGetBlockByHashArgsHashInt(t *testing.T) { input := `[8]` args := new(GetBlockByHashArgs) - str := ExpectInvalidTypeError(json.Unmarshal([]byte(input), &args)) + str := ExpectInsufficientParamsError(json.Unmarshal([]byte(input), &args)) if len(str) > 0 { t.Error(str) } @@ -281,6 +281,16 @@ func TestGetBlockByNumberEmpty(t *testing.T) { } } +func TestGetBlockByNumberShort(t *testing.T) { + input := `["0xbbb"]` + + args := new(GetBlockByNumberArgs) + str := ExpectInsufficientParamsError(json.Unmarshal([]byte(input), &args)) + if len(str) > 0 { + t.Error(str) + } +} + func TestGetBlockByNumberBool(t *testing.T) { input := `[true, true]` -- cgit v1.2.3