Add type and handling for listreceivedbyaddress.
This commit is contained in:
parent
66afd1dbc9
commit
1723db03c5
2 changed files with 18 additions and 1 deletions
|
@ -313,7 +313,16 @@ type SignRawTransactionResult struct {
|
||||||
// ListReceivedByAccountResult models the data from the listreceivedbyaccount
|
// ListReceivedByAccountResult models the data from the listreceivedbyaccount
|
||||||
// command.
|
// command.
|
||||||
type ListReceivedByAccountResult struct {
|
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"`
|
Amount float64 `json:"amount"`
|
||||||
Confirmations uint64 `json:"confirmations"`
|
Confirmations uint64 `json:"confirmations"`
|
||||||
}
|
}
|
||||||
|
@ -568,6 +577,12 @@ func ReadResultCmd(cmd string, message []byte) (Reply, error) {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
result.Result = res
|
result.Result = res
|
||||||
}
|
}
|
||||||
|
case "listreceivedbyaddress":
|
||||||
|
var res []ListReceivedByAddressResult
|
||||||
|
err = json.Unmarshal(objmap["result"], &res)
|
||||||
|
if err == nil {
|
||||||
|
result.Result = res
|
||||||
|
}
|
||||||
case "listsinceblock":
|
case "listsinceblock":
|
||||||
var res *ListSinceBlockResult
|
var res *ListSinceBlockResult
|
||||||
err = json.Unmarshal(objmap["result"], &res)
|
err = json.Unmarshal(objmap["result"], &res)
|
||||||
|
|
|
@ -49,6 +49,8 @@ var resulttests = []struct {
|
||||||
{"getaddressesbyaccount", []byte(`{"error":null,"id":1,"result":["test"]}`), false, true},
|
{"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":[{"a":"b"}]}`), false, false},
|
||||||
{"getmininginfo", []byte(`{"error":null,"id":1,"result":{"generate":true}}`), false, true},
|
{"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":[{"a":"b"}]}`), false, false},
|
||||||
{"listsinceblock", []byte(`{"error":null,"id":1,"result":{"lastblock":"something"}}`), false, true},
|
{"listsinceblock", []byte(`{"error":null,"id":1,"result":{"lastblock":"something"}}`), false, true},
|
||||||
{"validateaddress", []byte(`{"error":null,"id":1,"result":{"isvalid":false}}`), false, true},
|
{"validateaddress", []byte(`{"error":null,"id":1,"result":{"isvalid":false}}`), false, true},
|
||||||
|
|
Loading…
Reference in a new issue