diff --git a/cmds.go b/cmds.go index 7204231da..8303d1ecd 100644 --- a/cmds.go +++ b/cmds.go @@ -1636,7 +1636,7 @@ func (cmd *GetAddressBalanceCmd) UnmarshalJSON(b []byte) error { return err } - newCmd, err := parseListAllTransactionsCmd(&r) + newCmd, err := parseGetAddressBalanceCmd(&r) if err != nil { return err } diff --git a/cmds_test.go b/cmds_test.go index 3325d4c16..5e0d3f0a4 100644 --- a/cmds_test.go +++ b/cmds_test.go @@ -346,7 +346,10 @@ func TestCmds(t *testing.T) { // Read marshaled command back into c. Should still // match result. - c.UnmarshalJSON(mc) + if err := c.UnmarshalJSON(mc); err != nil { + t.Errorf("%s: error while unmarshalling: %v", test.name, + err) + } if !reflect.DeepEqual(test.result, c) { t.Errorf("%s: unmarshal not as expected. "+ "got %v wanted %v", test.name, spew.Sdump(c),