aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/args_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/args_test.go')
-rw-r--r--rpc/args_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/rpc/args_test.go b/rpc/args_test.go
index 47d79cc32..d6e4bee62 100644
--- a/rpc/args_test.go
+++ b/rpc/args_test.go
@@ -286,6 +286,29 @@ func TestFilterOptions(t *testing.T) {
// }
}
+func TestFilterOptionsWords(t *testing.T) {
+ input := `[{
+ "fromBlock": "latest",
+ "toBlock": "pending"
+ }]`
+ expected := new(FilterOptions)
+ expected.Earliest = 0
+ expected.Latest = -1
+
+ args := new(FilterOptions)
+ if err := json.Unmarshal([]byte(input), &args); err != nil {
+ t.Error(err)
+ }
+
+ if expected.Earliest != args.Earliest {
+ t.Errorf("Earliest shoud be %#v but is %#v", expected.Earliest, args.Earliest)
+ }
+
+ if expected.Latest != args.Latest {
+ t.Errorf("Latest shoud be %#v but is %#v", expected.Latest, args.Latest)
+ }
+}
+
func TestDbArgs(t *testing.T) {
input := `["0x74657374","0x6b6579","0x6d79537472696e67"]`
expected := new(DbArgs)