aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/args_test.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-12 21:42:31 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-12 21:42:31 +0800
commit4418e4ea6a9b8d648bcb7e7241b887cbab6936bc (patch)
tree5ba3c7d8e936ae1f035b554774cb20e605039f51 /rpc/args_test.go
parent21fca9385220850d88433f406378f1bd683b25ad (diff)
downloadgo-tangerine-4418e4ea6a9b8d648bcb7e7241b887cbab6936bc.tar
go-tangerine-4418e4ea6a9b8d648bcb7e7241b887cbab6936bc.tar.gz
go-tangerine-4418e4ea6a9b8d648bcb7e7241b887cbab6936bc.tar.bz2
go-tangerine-4418e4ea6a9b8d648bcb7e7241b887cbab6936bc.tar.lz
go-tangerine-4418e4ea6a9b8d648bcb7e7241b887cbab6936bc.tar.xz
go-tangerine-4418e4ea6a9b8d648bcb7e7241b887cbab6936bc.tar.zst
go-tangerine-4418e4ea6a9b8d648bcb7e7241b887cbab6936bc.zip
Should on empty params #466
Diffstat (limited to 'rpc/args_test.go')
-rw-r--r--rpc/args_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/rpc/args_test.go b/rpc/args_test.go
index 6650d8d61..6b6d3c3c0 100644
--- a/rpc/args_test.go
+++ b/rpc/args_test.go
@@ -43,6 +43,17 @@ func TestGetBalanceArgs(t *testing.T) {
}
}
+func TestGetBalanceEmptyArgs(t *testing.T) {
+ input := `[]`
+
+ args := new(GetBalanceArgs)
+ err := json.Unmarshal([]byte(input), &args)
+ if err == nil {
+ t.Error("Expected error but didn't get one")
+ }
+
+}
+
func TestGetBlockByHashArgs(t *testing.T) {
input := `["0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", true]`
expected := new(GetBlockByHashArgs)
@@ -418,6 +429,16 @@ func TestFilterStringArgs(t *testing.T) {
}
}
+func TestFilterStringEmptyArgs(t *testing.T) {
+ input := `[]`
+
+ args := new(FilterStringArgs)
+ err := json.Unmarshal([]byte(input), &args)
+ if err == nil {
+ t.Error("Expected error but didn't get one")
+ }
+}
+
func TestWhisperIdentityArgs(t *testing.T) {
input := `["0xc931d93e97ab07fe42d923478ba2465f283"]`
expected := new(WhisperIdentityArgs)