diff --git a/jsonresults.go b/jsonresults.go index 08b9df4a..93f2ffc8 100644 --- a/jsonresults.go +++ b/jsonresults.go @@ -313,7 +313,16 @@ type SignRawTransactionResult struct { // ListReceivedByAccountResult models the data from the listreceivedbyaccount // command. type ListReceivedByAccountResult struct { - Account string `json: "account"` + Account string `json:"account"` + Amount float64 `json:"amount"` + Confirmations uint64 `json:"confirmations"` +} + +// ListReceivedByAddressResult models the data from the listreceivedbyaddress +// command. +type ListReceivedByAddressResult struct { + Account string `json:"account"` + Address string `json:"address"` Amount float64 `json:"amount"` Confirmations uint64 `json:"confirmations"` } @@ -568,6 +577,12 @@ func ReadResultCmd(cmd string, message []byte) (Reply, error) { if err == nil { result.Result = res } + case "listreceivedbyaddress": + var res []ListReceivedByAddressResult + err = json.Unmarshal(objmap["result"], &res) + if err == nil { + result.Result = res + } case "listsinceblock": var res *ListSinceBlockResult err = json.Unmarshal(objmap["result"], &res) diff --git a/jsonresults_test.go b/jsonresults_test.go index db790fd4..469dca67 100644 --- a/jsonresults_test.go +++ b/jsonresults_test.go @@ -49,6 +49,8 @@ var resulttests = []struct { {"getaddressesbyaccount", []byte(`{"error":null,"id":1,"result":["test"]}`), false, true}, {"getmininginfo", []byte(`{"error":null,"id":1,"result":[{"a":"b"}]}`), false, false}, {"getmininginfo", []byte(`{"error":null,"id":1,"result":{"generate":true}}`), false, true}, + {"listreceivedbyaddress", []byte(`{"error":null,"id":1,"result":[{"a"}]}`), false, false}, + {"listreceivedbyaddress", []byte(`{"error":null,"id":1,"result":[{"a":"b"}]}`), false, true}, {"listsinceblock", []byte(`{"error":null,"id":1,"result":[{"a":"b"}]}`), false, false}, {"listsinceblock", []byte(`{"error":null,"id":1,"result":{"lastblock":"something"}}`), false, true}, {"validateaddress", []byte(`{"error":null,"id":1,"result":{"isvalid":false}}`), false, true},