diff --git a/pkg/rpc/server.go b/pkg/rpc/server.go index f0c26790f..df89546b3 100644 --- a/pkg/rpc/server.go +++ b/pkg/rpc/server.go @@ -141,7 +141,7 @@ Methods: break Methods } hash = s.chain.GetHeaderHash(num) - case defaultT: + default: resultsErr = errInvalidParams break Methods } diff --git a/pkg/rpc/server_test.go b/pkg/rpc/server_test.go index 1916617a5..c1860dd72 100644 --- a/pkg/rpc/server_test.go +++ b/pkg/rpc/server_test.go @@ -126,6 +126,11 @@ var rpcTestCases = map[string][]rpcTestCase{ params: `[]`, fail: true, }, + { + name: "bad params", + params: `[[]]`, + fail: true, + }, { name: "invalid height", params: `[-1]`,