Should on empty params #466

This commit is contained in:
Taylor Gerring
2015-03-12 08:42:31 -05:00
parent 21fca93852
commit 4418e4ea6a
2 changed files with 46 additions and 1 deletions

View File

@ -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)