diff --git a/jsonresults.go b/jsonresults.go index 7d1d6d4a..2bc6a45e 100644 --- a/jsonresults.go +++ b/jsonresults.go @@ -279,6 +279,14 @@ type SignRawTransactionResult struct { Complete bool `json:"complete"` } +// ListReceivedByAccountResult models the data from the listreceivedbyaccount +// command. +type ListReceivedByAccountResult struct { + Account string `json: "account"` + Amount float64 `json:"amount"` + Confirmations uint64 `json:"confirmations"` +} + // ListSinceBlockResult models the data from the listsinceblock command. type ListSinceBlockResult struct { Transactions []ListTransactionsResult `json:"transactions"` @@ -507,6 +515,12 @@ func ReadResultCmd(cmd string, message []byte) (Reply, error) { if err == nil { result.Result = res } + case "listreceivedbyaccount": + var res []ListReceivedByAccountResult + 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/test_coverage.txt b/test_coverage.txt index 8395c2a3..1f15ea0c 100644 --- a/test_coverage.txt +++ b/test_coverage.txt @@ -436,12 +436,12 @@ github.com/conformal/btcjson/jsoncmd.go VerifyMessageCmd.UnmarshalJSON 68.42 github.com/conformal/btcjson/jsoncmd.go SignRawTransactionCmd.MarshalJSON 66.67% (8/12) github.com/conformal/btcjson/jsoncmd.go NewLockUnspentCmd 66.67% (4/6) github.com/conformal/btcjson/jsoncmd.go NewAddNodeCmd 66.67% (2/3) -github.com/conformal/btcjson/jsoncmd.go GetBlockCmd.MarshalJSON 63.64% (7/11) github.com/conformal/btcjson/jsonfxns.go jsonRpcSend 62.50% (10/16) github.com/conformal/btcjson/jsonapi.go rpcCommand 61.54% (8/13) +github.com/conformal/btcjson/jsoncmd.go GetBlockCmd.MarshalJSON 60.00% (6/10) github.com/conformal/btcjson/jsoncmd.go GetTxOutCmd.UnmarshalJSON 59.09% (13/22) -github.com/conformal/btcjson/jsonresults.go ReadResultCmd 58.62% (85/145) github.com/conformal/btcjson/jsoncmd.go LockUnspentCmd.UnmarshalJSON 57.89% (11/19) +github.com/conformal/btcjson/jsonresults.go ReadResultCmd 57.05% (85/149) github.com/conformal/btcjson/jsonapi.go rpcRawCommand 53.33% (8/15) github.com/conformal/btcjson/jsoncmd.go GetBlockCmd.UnmarshalJSON 50.00% (12/24) github.com/conformal/btcjson/cmdhelp.go GetHelpString 50.00% (3/6) @@ -462,5 +462,5 @@ github.com/conformal/btcjson/jsoncmd.go unparsableCmd.Method 0.00% (0/1) github.com/conformal/btcjson/jsonapi.go TlsRpcRawCommand 0.00% (0/1) github.com/conformal/btcjson/jsonapi.go RpcRawCommand 0.00% (0/1) github.com/conformal/btcjson/jsonresults.go Vin.IsCoinBase 0.00% (0/1) -github.com/conformal/btcjson --------------------------------------- 78.48% (2349/2993) +github.com/conformal/btcjson --------------------------------------- 78.37% (2348/2996)