From 86575afa9183734181a07fbfef8bf082ad355ad0 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Fri, 20 Dec 2013 15:00:31 -0500 Subject: [PATCH] Add listaddresstransactions extension. --- cmds.go | 118 +++++++++++++++++++++++++ cmds_test.go | 37 ++++++++ test_coverage.txt | 216 ++++++++++++++++++++++++---------------------- 3 files changed, 266 insertions(+), 105 deletions(-) diff --git a/cmds.go b/cmds.go index 7cfe0b66..59efa075 100644 --- a/cmds.go +++ b/cmds.go @@ -18,6 +18,7 @@ func init() { btcjson.RegisterCustomCmd("getbalances", parseGetBalancesCmd) btcjson.RegisterCustomCmd("getbestblock", parseGetBestBlockCmd) btcjson.RegisterCustomCmd("getcurrentnet", parseGetCurrentNetCmd) + btcjson.RegisterCustomCmd("listaddresstransactions", parseListAddressTransactionsCmd) btcjson.RegisterCustomCmd("listalltransactions", parseListAllTransactionsCmd) btcjson.RegisterCustomCmd("notifynewtxs", parseNotifyNewTXsCmd) btcjson.RegisterCustomCmd("notifyspent", parseNotifySpentCmd) @@ -745,6 +746,123 @@ func (cmd *WalletIsLockedCmd) UnmarshalJSON(b []byte) error { return nil } +type ListAddressTransactionsCmd struct { + id interface{} + Account string + Addresses []string +} + +// Enforce that ListAddressTransactionsCmd satisifies the btcjson.Cmd +// interface. +var _ btcjson.Cmd = &ListAddressTransactionsCmd{} + +// NewListAddressTransactionsCmd creates a new ListAddressTransactionsCmd. +func NewListAddressTransactionsCmd(id interface{}, addresses []string, + optArgs ...string) (*ListAddressTransactionsCmd, error) { + + if len(optArgs) > 1 { + return nil, btcjson.ErrTooManyOptArgs + } + + // Optional arguments set to their default values. + account := "" + + if len(optArgs) == 1 { + account = optArgs[0] + } + + return &ListAddressTransactionsCmd{ + id: id, + Account: account, + Addresses: addresses, + }, nil +} + +// parseListAddressTransactionsCmd parses a ListAddressTransactionsCmd into +// a concrete type satisifying the btcjson.Cmd interface. This is used +// when registering the custom command with the btcjson parser. +func parseListAddressTransactionsCmd(r *btcjson.RawCmd) (btcjson.Cmd, error) { + if len(r.Params) == 0 || len(r.Params) > 2 { + return nil, btcjson.ErrInvalidParams + } + + iaddrs, ok := r.Params[0].([]interface{}) + if !ok { + return nil, errors.New("first parameter must be a JSON array") + } + addresses := make([]string, len(iaddrs)) + for i := range iaddrs { + addr, ok := iaddrs[i].(string) + if !ok { + return nil, errors.New("first parameter must be an " + + "array of strings") + } + addresses[i] = addr + } + + if len(r.Params) == 1 { + // No optional parameters. + return NewListAddressTransactionsCmd(r.Id, addresses) + } + + account, ok := r.Params[1].(string) + if !ok { + return nil, errors.New("second parameter must be a string") + } + return NewListAddressTransactionsCmd(r.Id, addresses, account) +} + +// Id satisifies the Cmd interface by returning the ID of the command. +func (cmd *ListAddressTransactionsCmd) Id() interface{} { + return cmd.id +} + +// Method satisfies the Cmd interface by returning the RPC method. +func (cmd *ListAddressTransactionsCmd) Method() string { + return "listaddresstransactions" +} + +// MarshalJSON returns the JSON encoding of cmd. Part of the Cmd interface. +func (cmd *ListAddressTransactionsCmd) MarshalJSON() ([]byte, error) { + // Fill a RawCmd and marshal. + raw := btcjson.RawCmd{ + Jsonrpc: "1.0", + Method: cmd.Method(), + Id: cmd.id, + Params: []interface{}{ + cmd.Addresses, + }, + } + + if cmd.Account != "" { + raw.Params = append(raw.Params, cmd.Account) + } + + return json.Marshal(raw) +} + +// UnmarshalJSON unmarshals the JSON encoding of cmd into cmd. Part of +// the Cmd interface. +func (cmd *ListAddressTransactionsCmd) UnmarshalJSON(b []byte) error { + // Unmarshal into a RawCmd. + var r btcjson.RawCmd + if err := json.Unmarshal(b, &r); err != nil { + return err + } + + newCmd, err := parseListAddressTransactionsCmd(&r) + if err != nil { + return err + } + + concreteCmd, ok := newCmd.(*ListAddressTransactionsCmd) + if !ok { + return btcjson.ErrInternal + } + *cmd = *concreteCmd + return nil +} + // ListAllTransactionsCmd is a type handling custom marshaling and // unmarshaling of listalltransactions JSON websocket extension commands. type ListAllTransactionsCmd struct { diff --git a/cmds_test.go b/cmds_test.go index 46b21e04..6c50c4d3 100644 --- a/cmds_test.go +++ b/cmds_test.go @@ -89,6 +89,43 @@ var cmdtests = []struct { id: float64(1), }, }, + { + name: "listaddresstransactions no optargs", + f: func() (btcjson.Cmd, error) { + addrs := []string{ + "17XhEvq9Nahdj7Xe1nv6oRe1tEmaHUuynH", + } + return NewListAddressTransactionsCmd( + float64(1), + addrs) + }, + result: &ListAddressTransactionsCmd{ + id: float64(1), + Account: "", + Addresses: []string{ + "17XhEvq9Nahdj7Xe1nv6oRe1tEmaHUuynH", + }, + }, + }, + { + name: "listaddresstransactions one optarg", + f: func() (btcjson.Cmd, error) { + addrs := []string{ + "17XhEvq9Nahdj7Xe1nv6oRe1tEmaHUuynH", + } + return NewListAddressTransactionsCmd( + float64(1), + addrs, + "abcde") + }, + result: &ListAddressTransactionsCmd{ + id: float64(1), + Account: "abcde", + Addresses: []string{ + "17XhEvq9Nahdj7Xe1nv6oRe1tEmaHUuynH", + }, + }, + }, { name: "listalltransactions no optargs", f: func() (btcjson.Cmd, error) { diff --git a/test_coverage.txt b/test_coverage.txt index 852136f0..0548b2d9 100644 --- a/test_coverage.txt +++ b/test_coverage.txt @@ -1,107 +1,113 @@ -github.com/conformal/btcws/cmds.go init 100.00% (10/10) -github.com/conformal/btcws/notifications.go init 100.00% (7/7) -github.com/conformal/btcws/cmds.go WalletIsLockedCmd.MarshalJSON 100.00% (4/4) -github.com/conformal/btcws/cmds.go RescanCmd.MarshalJSON 100.00% (4/4) -github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.MarshalJSON 100.00% (4/4) -github.com/conformal/btcws/cmds.go ListAllTransactionsCmd.MarshalJSON 100.00% (4/4) -github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/cmds.go NotifySpentCmd.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/notifications.go WalletLockStateNtfn.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/notifications.go TxMinedNtfn.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/cmds.go GetBalancesCmd.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/notifications.go BlockConnectedNtfn.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/cmds.go GetCurrentNetCmd.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/notifications.go AccountBalanceNtfn.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/notifications.go TxNtfn.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/cmds.go GetBestBlockCmd.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/notifications.go BtcdConnectedNtfn.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.Method 100.00% (1/1) -github.com/conformal/btcws/cmds.go NewGetCurrentNetCmd 100.00% (1/1) -github.com/conformal/btcws/cmds.go GetCurrentNetCmd.Id 100.00% (1/1) -github.com/conformal/btcws/cmds.go GetCurrentNetCmd.Method 100.00% (1/1) -github.com/conformal/btcws/cmds.go NewGetBestBlockCmd 100.00% (1/1) -github.com/conformal/btcws/cmds.go GetBestBlockCmd.Id 100.00% (1/1) -github.com/conformal/btcws/cmds.go GetBestBlockCmd.Method 100.00% (1/1) -github.com/conformal/btcws/cmds.go RescanCmd.Id 100.00% (1/1) -github.com/conformal/btcws/cmds.go RescanCmd.Method 100.00% (1/1) -github.com/conformal/btcws/cmds.go NewNotifyNewTXsCmd 100.00% (1/1) -github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.Id 100.00% (1/1) -github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.Method 100.00% (1/1) -github.com/conformal/btcws/cmds.go NewNotifySpentCmd 100.00% (1/1) -github.com/conformal/btcws/cmds.go NotifySpentCmd.Id 100.00% (1/1) -github.com/conformal/btcws/cmds.go NotifySpentCmd.Method 100.00% (1/1) -github.com/conformal/btcws/cmds.go NewCreateEncryptedWalletCmd 100.00% (1/1) -github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.Id 100.00% (1/1) -github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.Method 100.00% (1/1) -github.com/conformal/btcws/cmds.go NewGetBalancesCmd 100.00% (1/1) -github.com/conformal/btcws/cmds.go GetBalancesCmd.Id 100.00% (1/1) -github.com/conformal/btcws/cmds.go GetBalancesCmd.Method 100.00% (1/1) -github.com/conformal/btcws/cmds.go WalletIsLockedCmd.Id 100.00% (1/1) -github.com/conformal/btcws/cmds.go WalletIsLockedCmd.Method 100.00% (1/1) -github.com/conformal/btcws/cmds.go ListAllTransactionsCmd.Id 100.00% (1/1) -github.com/conformal/btcws/cmds.go ListAllTransactionsCmd.Method 100.00% (1/1) -github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.Id 100.00% (1/1) -github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.Method 100.00% (1/1) -github.com/conformal/btcws/notifications.go NewAccountBalanceNtfn 100.00% (1/1) -github.com/conformal/btcws/notifications.go AccountBalanceNtfn.Id 100.00% (1/1) -github.com/conformal/btcws/notifications.go AccountBalanceNtfn.Method 100.00% (1/1) -github.com/conformal/btcws/notifications.go NewBlockConnectedNtfn 100.00% (1/1) -github.com/conformal/btcws/notifications.go BlockConnectedNtfn.Id 100.00% (1/1) -github.com/conformal/btcws/notifications.go BlockConnectedNtfn.Method 100.00% (1/1) -github.com/conformal/btcws/notifications.go NewBlockDisconnectedNtfn 100.00% (1/1) -github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.Id 100.00% (1/1) -github.com/conformal/btcws/notifications.go NewBtcdConnectedNtfn 100.00% (1/1) -github.com/conformal/btcws/notifications.go BtcdConnectedNtfn.Id 100.00% (1/1) -github.com/conformal/btcws/notifications.go BtcdConnectedNtfn.Method 100.00% (1/1) -github.com/conformal/btcws/notifications.go NewTxMinedNtfn 100.00% (1/1) -github.com/conformal/btcws/notifications.go TxMinedNtfn.Id 100.00% (1/1) -github.com/conformal/btcws/notifications.go TxMinedNtfn.Method 100.00% (1/1) -github.com/conformal/btcws/notifications.go NewTxNtfn 100.00% (1/1) -github.com/conformal/btcws/notifications.go TxNtfn.Id 100.00% (1/1) -github.com/conformal/btcws/notifications.go TxNtfn.Method 100.00% (1/1) -github.com/conformal/btcws/notifications.go NewWalletLockStateNtfn 100.00% (1/1) -github.com/conformal/btcws/notifications.go WalletLockStateNtfn.Id 100.00% (1/1) -github.com/conformal/btcws/notifications.go WalletLockStateNtfn.Method 100.00% (1/1) -github.com/conformal/btcws/cmds.go parseListAllTransactionsCmd 87.50% (7/8) -github.com/conformal/btcws/cmds.go NewWalletIsLockedCmd 83.33% (5/6) -github.com/conformal/btcws/cmds.go NewRescanCmd 83.33% (5/6) -github.com/conformal/btcws/cmds.go NewGetAddressBalanceCmd 83.33% (5/6) -github.com/conformal/btcws/cmds.go NewListAllTransactionsCmd 83.33% (5/6) -github.com/conformal/btcws/cmds.go parseRescanCmd 77.78% (14/18) -github.com/conformal/btcws/cmds.go parseNotifyNewTXsCmd 75.00% (9/12) -github.com/conformal/btcws/cmds.go parseWalletIsLockedCmd 75.00% (6/8) -github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/notifications.go TxMinedNtfn.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/notifications.go WalletLockStateNtfn.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go GetBalancesCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go WalletIsLockedCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go ListAllTransactionsCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/notifications.go AccountBalanceNtfn.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go GetBestBlockCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go GetCurrentNetCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/notifications.go TxNtfn.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go RescanCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/notifications.go BlockConnectedNtfn.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go NotifySpentCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go parseGetAddressBalanceCmd 72.73% (8/11) -github.com/conformal/btcws/notifications.go parseTxMinedNtfn 70.00% (14/20) -github.com/conformal/btcws/cmds.go parseCreateEncryptedWalletCmd 69.23% (9/13) -github.com/conformal/btcws/cmds.go parseNotifySpentCmd 66.67% (10/15) -github.com/conformal/btcws/cmds.go parseGetCurrentNetCmd 66.67% (2/3) -github.com/conformal/btcws/cmds.go parseGetBestBlockCmd 66.67% (2/3) -github.com/conformal/btcws/cmds.go parseGetBalancesCmd 66.67% (2/3) -github.com/conformal/btcws/notifications.go parseAccountBalanceNtfn 64.29% (9/14) -github.com/conformal/btcws/notifications.go parseBlockDisconnectedNtfn 63.64% (7/11) -github.com/conformal/btcws/notifications.go parseTxNtfn 63.64% (7/11) -github.com/conformal/btcws/notifications.go parseWalletLockStateNtfn 63.64% (7/11) -github.com/conformal/btcws/notifications.go parseBlockConnectedNtfn 63.64% (7/11) -github.com/conformal/btcws/notifications.go parseBtcdConnectedNtfn 62.50% (5/8) -github.com/conformal/btcws/notifications.go BtcdConnectedNtfn.UnmarshalJSON 45.45% (5/11) -github.com/conformal/btcws -------------------------------------- 77.26% (384/497) +github.com/conformal/btcws/cmds.go init 100.00% (11/11) +github.com/conformal/btcws/notifications.go init 100.00% (7/7) +github.com/conformal/btcws/cmds.go ListAddressTransactionsCmd.MarshalJSON 100.00% (4/4) +github.com/conformal/btcws/cmds.go WalletIsLockedCmd.MarshalJSON 100.00% (4/4) +github.com/conformal/btcws/cmds.go RescanCmd.MarshalJSON 100.00% (4/4) +github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.MarshalJSON 100.00% (4/4) +github.com/conformal/btcws/cmds.go ListAllTransactionsCmd.MarshalJSON 100.00% (4/4) +github.com/conformal/btcws/cmds.go NotifySpentCmd.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/notifications.go TxNtfn.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/notifications.go AccountBalanceNtfn.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/cmds.go GetBestBlockCmd.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/notifications.go BlockConnectedNtfn.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/cmds.go GetBalancesCmd.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/cmds.go GetCurrentNetCmd.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/notifications.go WalletLockStateNtfn.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/notifications.go TxMinedNtfn.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/notifications.go BtcdConnectedNtfn.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/notifications.go TxMinedNtfn.Method 100.00% (1/1) +github.com/conformal/btcws/cmds.go NewCreateEncryptedWalletCmd 100.00% (1/1) +github.com/conformal/btcws/notifications.go TxMinedNtfn.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.Method 100.00% (1/1) +github.com/conformal/btcws/cmds.go NotifySpentCmd.Id 100.00% (1/1) +github.com/conformal/btcws/notifications.go NewTxMinedNtfn 100.00% (1/1) +github.com/conformal/btcws/cmds.go NewGetBalancesCmd 100.00% (1/1) +github.com/conformal/btcws/cmds.go GetBalancesCmd.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go GetBalancesCmd.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go NewAccountBalanceNtfn 100.00% (1/1) +github.com/conformal/btcws/cmds.go NewGetCurrentNetCmd 100.00% (1/1) +github.com/conformal/btcws/notifications.go BtcdConnectedNtfn.Method 100.00% (1/1) +github.com/conformal/btcws/cmds.go WalletIsLockedCmd.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go WalletIsLockedCmd.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go BtcdConnectedNtfn.Id 100.00% (1/1) +github.com/conformal/btcws/notifications.go NewBtcdConnectedNtfn 100.00% (1/1) +github.com/conformal/btcws/cmds.go ListAddressTransactionsCmd.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go ListAddressTransactionsCmd.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go BlockConnectedNtfn.Id 100.00% (1/1) +github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.Method 100.00% (1/1) +github.com/conformal/btcws/cmds.go ListAllTransactionsCmd.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go ListAllTransactionsCmd.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go GetCurrentNetCmd.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go AccountBalanceNtfn.Id 100.00% (1/1) +github.com/conformal/btcws/notifications.go AccountBalanceNtfn.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go NewBlockConnectedNtfn 100.00% (1/1) +github.com/conformal/btcws/cmds.go GetCurrentNetCmd.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go WalletLockStateNtfn.Method 100.00% (1/1) +github.com/conformal/btcws/cmds.go NewGetBestBlockCmd 100.00% (1/1) +github.com/conformal/btcws/notifications.go WalletLockStateNtfn.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go GetBestBlockCmd.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go GetBestBlockCmd.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go NewWalletLockStateNtfn 100.00% (1/1) +github.com/conformal/btcws/cmds.go RescanCmd.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go RescanCmd.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go TxNtfn.Method 100.00% (1/1) +github.com/conformal/btcws/cmds.go NewNotifyNewTXsCmd 100.00% (1/1) +github.com/conformal/btcws/notifications.go TxNtfn.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go NewTxNtfn 100.00% (1/1) +github.com/conformal/btcws/cmds.go NewNotifySpentCmd 100.00% (1/1) +github.com/conformal/btcws/cmds.go NotifySpentCmd.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go NewBlockDisconnectedNtfn 100.00% (1/1) +github.com/conformal/btcws/notifications.go BlockConnectedNtfn.Method 100.00% (1/1) +github.com/conformal/btcws/cmds.go parseListAllTransactionsCmd 87.50% (7/8) +github.com/conformal/btcws/cmds.go NewListAllTransactionsCmd 83.33% (5/6) +github.com/conformal/btcws/cmds.go NewWalletIsLockedCmd 83.33% (5/6) +github.com/conformal/btcws/cmds.go NewListAddressTransactionsCmd 83.33% (5/6) +github.com/conformal/btcws/cmds.go NewGetAddressBalanceCmd 83.33% (5/6) +github.com/conformal/btcws/cmds.go NewRescanCmd 83.33% (5/6) +github.com/conformal/btcws/cmds.go parseRescanCmd 77.78% (14/18) +github.com/conformal/btcws/cmds.go parseListAddressTransactionsCmd 76.47% (13/17) +github.com/conformal/btcws/cmds.go parseNotifyNewTXsCmd 75.00% (9/12) +github.com/conformal/btcws/cmds.go parseWalletIsLockedCmd 75.00% (6/8) +github.com/conformal/btcws/cmds.go parseGetAddressBalanceCmd 72.73% (8/11) +github.com/conformal/btcws/cmds.go ListAllTransactionsCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go WalletLockStateNtfn.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go ListAddressTransactionsCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go WalletIsLockedCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go AccountBalanceNtfn.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go GetBalancesCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go BlockConnectedNtfn.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go NotifySpentCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go TxMinedNtfn.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go RescanCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go TxNtfn.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go GetBestBlockCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go GetCurrentNetCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go parseTxMinedNtfn 70.00% (14/20) +github.com/conformal/btcws/cmds.go parseCreateEncryptedWalletCmd 69.23% (9/13) +github.com/conformal/btcws/cmds.go parseNotifySpentCmd 66.67% (10/15) +github.com/conformal/btcws/cmds.go parseGetBalancesCmd 66.67% (2/3) +github.com/conformal/btcws/cmds.go parseGetBestBlockCmd 66.67% (2/3) +github.com/conformal/btcws/cmds.go parseGetCurrentNetCmd 66.67% (2/3) +github.com/conformal/btcws/notifications.go parseAccountBalanceNtfn 64.29% (9/14) +github.com/conformal/btcws/notifications.go parseBlockDisconnectedNtfn 63.64% (7/11) +github.com/conformal/btcws/notifications.go parseTxNtfn 63.64% (7/11) +github.com/conformal/btcws/notifications.go parseWalletLockStateNtfn 63.64% (7/11) +github.com/conformal/btcws/notifications.go parseBlockConnectedNtfn 63.64% (7/11) +github.com/conformal/btcws/notifications.go parseBtcdConnectedNtfn 62.50% (5/8) +github.com/conformal/btcws/notifications.go BtcdConnectedNtfn.UnmarshalJSON 45.45% (5/11) +github.com/conformal/btcws ---------------------------------------- 77.51% (417/538)