aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/args_test.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-04-02 19:17:55 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-04-02 19:17:55 +0800
commite402e1dc2e72df2a433b984caeaba771085b2b66 (patch)
treea9083825ab58d3ff37a1a8137b10d68865d6d565 /rpc/args_test.go
parent14c14fd61f72bfa8c1494fa799a4f2e2eb14f4c1 (diff)
downloadgo-tangerine-e402e1dc2e72df2a433b984caeaba771085b2b66.tar
go-tangerine-e402e1dc2e72df2a433b984caeaba771085b2b66.tar.gz
go-tangerine-e402e1dc2e72df2a433b984caeaba771085b2b66.tar.bz2
go-tangerine-e402e1dc2e72df2a433b984caeaba771085b2b66.tar.lz
go-tangerine-e402e1dc2e72df2a433b984caeaba771085b2b66.tar.xz
go-tangerine-e402e1dc2e72df2a433b984caeaba771085b2b66.tar.zst
go-tangerine-e402e1dc2e72df2a433b984caeaba771085b2b66.zip
New args types with stricter checking
Diffstat (limited to 'rpc/args_test.go')
-rw-r--r--rpc/args_test.go12
1 files changed, 11 insertions, 1 deletions
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]`