From 97439fa822af74dd58fefa25fe41b6469af01e8a Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Mon, 24 Mar 2014 13:04:55 -0500 Subject: [PATCH] Implement rescanprogress notification. --- notifications.go | 90 ++++++++++++++++++++ notifications_test.go | 14 +++- test_coverage.txt | 191 ++++++++++++++++++++++-------------------- 3 files changed, 202 insertions(+), 93 deletions(-) diff --git a/notifications.go b/notifications.go index e399b30b2..99ddf5081 100644 --- a/notifications.go +++ b/notifications.go @@ -53,6 +53,10 @@ const ( // notification. RedeemingTxNtfnMethod = "redeemingtx" + // RescanProgressNtfnMethod is the method of the btcd rescanprogress + // notification. + RescanProgressNtfnMethod = "rescanprogress" + // WalletLockStateNtfnMethod is the method of the btcwallet // walletlockstate notification. WalletLockStateNtfnMethod = "walletlockstate" @@ -70,6 +74,9 @@ func init() { parseBtcdConnectedNtfn, `TODO(jrick) fillmein`) btcjson.RegisterCustomCmd(RecvTxNtfnMethod, parseRecvTxNtfn, `TODO(jrick) fillmein`) + btcjson.RegisterCustomCmd(RescanProgressNtfnMethod, + parseRescanProgressNtfn, `TODO(jrick) fillmein`) + btcjson.RegisterCustomCmd(RedeemingTxNtfnMethod, parseRedeemingTxNtfn, `TODO(jrick) fillmein`) btcjson.RegisterCustomCmd(TxNtfnMethod, parseTxNtfn, @@ -741,6 +748,89 @@ func (n *RedeemingTxNtfn) UnmarshalJSON(b []byte) error { return nil } +// RescanProgressNtfn is type handling custom marshaling and +// unmarshaling of rescanprogress JSON websocket notifications. +type RescanProgressNtfn struct { + LastProcessed int32 +} + +// Enforce that RescanProgressNtfn satisifies the btcjson.Cmd interface. +var _ btcjson.Cmd = &RescanProgressNtfn{} + +// NewRescanProgressNtfn creates a new RescanProgressNtfn. +func NewRescanProgressNtfn(last int32) *RescanProgressNtfn { + return &RescanProgressNtfn{last} +} + +// parseRescanProgressNtfn parses a RawCmd into a concrete type satisifying +// the btcjson.Cmd interface. This is used when registering the notification +// with the btcjson parser. +func parseRescanProgressNtfn(r *btcjson.RawCmd) (btcjson.Cmd, error) { + if r.Id != nil { + return nil, ErrNotANtfn + } + + if len(r.Params) != 1 { + return nil, btcjson.ErrWrongNumberOfParams + } + + last, ok := r.Params[0].(float64) + if !ok { + return nil, errors.New("first parameter must be a number") + } + + return NewRescanProgressNtfn(int32(last)), nil +} + +// Id satisifies the btcjson.Cmd interface by returning nil for a +// notification ID. +func (n *RescanProgressNtfn) Id() interface{} { + return nil +} + +// SetId is implemented to satisify the btcjson.Cmd interface. The +// notification ID is not modified. +func (n *RescanProgressNtfn) SetId(id interface{}) {} + +// Method satisifies the btcjson.Cmd interface by returning the method +// of the notification. +func (n *RescanProgressNtfn) Method() string { + return RescanProgressNtfnMethod +} + +// MarshalJSON returns the JSON encoding of n. Part of the btcjson.Cmd +// interface. +func (n *RescanProgressNtfn) MarshalJSON() ([]byte, error) { + ntfn := btcjson.Message{ + Jsonrpc: "1.0", + Method: n.Method(), + Params: []interface{}{n.LastProcessed}, + } + return json.Marshal(ntfn) +} + +// UnmarshalJSON unmarshals the JSON encoding of n into n. Part of +// the btcjson.Cmd interface. +func (n *RescanProgressNtfn) UnmarshalJSON(b []byte) error { + // Unmarshal into a RawCmd. + var r btcjson.RawCmd + if err := json.Unmarshal(b, &r); err != nil { + return err + } + + newNtfn, err := parseRescanProgressNtfn(&r) + if err != nil { + return err + } + + concreteNtfn, ok := newNtfn.(*RescanProgressNtfn) + if !ok { + return btcjson.ErrInternal + } + *n = *concreteNtfn + return nil +} + // TxNtfn is a type handling custom marshaling and // unmarshaling of newtx JSON websocket notifications. type TxNtfn struct { diff --git a/notifications_test.go b/notifications_test.go index b099bd0a8..6236091c4 100644 --- a/notifications_test.go +++ b/notifications_test.go @@ -123,6 +123,15 @@ var ntfntests = []struct { }, }, }, + { + name: "rescanprogress", + f: func() btcjson.Cmd { + return btcws.NewRescanProgressNtfn(12345) + }, + result: &btcws.RescanProgressNtfn{ + LastProcessed: 12345, + }, + }, { name: "newtx", f: func() btcjson.Cmd { @@ -226,7 +235,10 @@ func TestNtfns(t *testing.T) { // Read marshaled notification back into n. Should still // match result. - n.UnmarshalJSON(mn) + if err := n.UnmarshalJSON(mn); err != nil { + t.Errorf("%s: unmarshal failed: %v", test.name, err) + continue + } if !reflect.DeepEqual(test.result, n) { t.Errorf("%s: unmarshal not as expected. "+ "got %v wanted %v", test.name, spew.Sdump(n), diff --git a/test_coverage.txt b/test_coverage.txt index a92549308..060d9df08 100644 --- a/test_coverage.txt +++ b/test_coverage.txt @@ -1,62 +1,57 @@ github.com/conformal/btcws/cmds.go init 100.00% (16/16) -github.com/conformal/btcws/notifications.go init 100.00% (10/10) +github.com/conformal/btcws/notifications.go init 100.00% (11/11) github.com/conformal/btcws/cmds.go RescanCmd.MarshalJSON 100.00% (7/7) github.com/conformal/btcws/notifications.go RedeemingTxNtfn.MarshalJSON 100.00% (6/6) github.com/conformal/btcws/notifications.go RecvTxNtfn.MarshalJSON 100.00% (6/6) -github.com/conformal/btcws/cmds.go ListAddressTransactionsCmd.MarshalJSON 100.00% (4/4) -github.com/conformal/btcws/cmds.go ListAllTransactionsCmd.MarshalJSON 100.00% (4/4) -github.com/conformal/btcws/cmds.go WalletIsLockedCmd.MarshalJSON 100.00% (4/4) github.com/conformal/btcws/cmds.go GetUnconfirmedBalanceCmd.MarshalJSON 100.00% (4/4) +github.com/conformal/btcws/cmds.go WalletIsLockedCmd.MarshalJSON 100.00% (4/4) +github.com/conformal/btcws/cmds.go ListAddressTransactionsCmd.MarshalJSON 100.00% (4/4) github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.MarshalJSON 100.00% (4/4) -github.com/conformal/btcws/notifications.go BlockConnectedNtfn.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/cmds.go ListAllTransactionsCmd.MarshalJSON 100.00% (4/4) +github.com/conformal/btcws/notifications.go TxNtfn.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/cmds.go NotifySpentCmd.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/notifications.go AllVerboseTxNtfn.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.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/notifications.go BlockConnectedNtfn.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/notifications.go RescanProgressNtfn.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.MarshalJSON 100.00% (2/2) +github.com/conformal/btcws/cmds.go NotifySpentCmd.MarshalJSON 100.00% (2/2) github.com/conformal/btcws/notifications.go BtcdConnectedNtfn.MarshalJSON 100.00% (2/2) github.com/conformal/btcws/notifications.go AllTxNtfn.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/cmds.go GetCurrentNetCmd.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/notifications.go TxNtfn.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/notifications.go AllVerboseTxNtfn.MarshalJSON 100.00% (2/2) -github.com/conformal/btcws/cmds.go GetBestBlockCmd.MarshalJSON 100.00% (2/2) github.com/conformal/btcws/cmds.go NotifyAllNewTXsCmd.MarshalJSON 100.00% (2/2) github.com/conformal/btcws/notifications.go NewRedeemingTxNtfn 100.00% (1/1) github.com/conformal/btcws/notifications.go RecvTxNtfn.Method 100.00% (1/1) -github.com/conformal/btcws/notifications.go RecvTxNtfn.Id 100.00% (1/1) github.com/conformal/btcws/notifications.go NewRecvTxNtfn 100.00% (1/1) github.com/conformal/btcws/notifications.go BtcdConnectedNtfn.Method 100.00% (1/1) -github.com/conformal/btcws/notifications.go NewBtcdConnectedNtfn 100.00% (1/1) -github.com/conformal/btcws/cmds.go GetBestBlockCmd.Method 100.00% (1/1) -github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.Method 100.00% (1/1) github.com/conformal/btcws/cmds.go RescanCmd.Id 100.00% (1/1) -github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.Id 100.00% (1/1) +github.com/conformal/btcws/notifications.go BtcdConnectedNtfn.Id 100.00% (1/1) github.com/conformal/btcws/cmds.go RescanCmd.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go NewBtcdConnectedNtfn 100.00% (1/1) +github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.Id 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/notifications.go BlockConnectedNtfn.Id 100.00% (1/1) -github.com/conformal/btcws/notifications.go NewBlockConnectedNtfn 100.00% (1/1) -github.com/conformal/btcws/notifications.go AccountBalanceNtfn.Method 100.00% (1/1) -github.com/conformal/btcws/notifications.go AccountBalanceNtfn.Id 100.00% (1/1) github.com/conformal/btcws/cmds.go NewNotifyNewTXsCmd 100.00% (1/1) -github.com/conformal/btcws/notifications.go NewAccountBalanceNtfn 100.00% (1/1) github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.Id 100.00% (1/1) +github.com/conformal/btcws/notifications.go NewBlockConnectedNtfn 100.00% (1/1) github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.Method 100.00% (1/1) github.com/conformal/btcws/cmds.go NotifyAllNewTXsCmd.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/cmds.go NotifyAllNewTXsCmd.Method 100.00% (1/1) -github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.Id 100.00% (1/1) +github.com/conformal/btcws/notifications.go NewAccountBalanceNtfn 100.00% (1/1) github.com/conformal/btcws/cmds.go NewNotifySpentCmd 100.00% (1/1) +github.com/conformal/btcws/notifications.go AccountBalanceNtfn.Method 100.00% (1/1) github.com/conformal/btcws/cmds.go NotifySpentCmd.Id 100.00% (1/1) -github.com/conformal/btcws/cmds.go ListAllTransactionsCmd.Method 100.00% (1/1) -github.com/conformal/btcws/cmds.go NotifySpentCmd.Method 100.00% (1/1) github.com/conformal/btcws/cmds.go ListAllTransactionsCmd.Id 100.00% (1/1) -github.com/conformal/btcws/cmds.go NewCreateEncryptedWalletCmd 100.00% (1/1) -github.com/conformal/btcws/cmds.go WalletIsLockedCmd.Id 100.00% (1/1) -github.com/conformal/btcws/notifications.go BtcdConnectedNtfn.Id 100.00% (1/1) -github.com/conformal/btcws/cmds.go WalletIsLockedCmd.Method 100.00% (1/1) +github.com/conformal/btcws/cmds.go NotifySpentCmd.Method 100.00% (1/1) +github.com/conformal/btcws/cmds.go GetUnconfirmedBalanceCmd.Id 100.00% (1/1) +github.com/conformal/btcws/notifications.go AllVerboseTxNtfn.Method 100.00% (1/1) github.com/conformal/btcws/notifications.go AllVerboseTxNtfn.Id 100.00% (1/1) github.com/conformal/btcws/notifications.go NewAllVerboseTxNtfn 100.00% (1/1) github.com/conformal/btcws/notifications.go AllTxNtfn.Method 100.00% (1/1) @@ -71,54 +66,64 @@ github.com/conformal/btcws/notifications.go NewWalletLockStateNtfn 100.00% github.com/conformal/btcws/notifications.go TxNtfn.Method 100.00% (1/1) github.com/conformal/btcws/notifications.go TxNtfn.Id 100.00% (1/1) github.com/conformal/btcws/notifications.go NewTxNtfn 100.00% (1/1) -github.com/conformal/btcws/notifications.go generateAllVerboseTxNtfn 100.00% (1/1) -github.com/conformal/btcws/cmds.go GetUnconfirmedBalanceCmd.Id 100.00% (1/1) github.com/conformal/btcws/cmds.go GetUnconfirmedBalanceCmd.Method 100.00% (1/1) -github.com/conformal/btcws/notifications.go RedeemingTxNtfn.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go RescanProgressNtfn.Method 100.00% (1/1) github.com/conformal/btcws/cmds.go NewGetBestBlockCmd 100.00% (1/1) -github.com/conformal/btcws/notifications.go RedeemingTxNtfn.Id 100.00% (1/1) +github.com/conformal/btcws/notifications.go RescanProgressNtfn.Id 100.00% (1/1) github.com/conformal/btcws/cmds.go GetBestBlockCmd.Id 100.00% (1/1) -github.com/conformal/btcws/cmds.go ListAddressTransactionsCmd.Method 100.00% (1/1) -github.com/conformal/btcws/notifications.go AllVerboseTxNtfn.Method 100.00% (1/1) -github.com/conformal/btcws/cmds.go ListAddressTransactionsCmd.Id 100.00% (1/1) +github.com/conformal/btcws/notifications.go NewRescanProgressNtfn 100.00% (1/1) +github.com/conformal/btcws/cmds.go GetBestBlockCmd.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go RedeemingTxNtfn.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go RedeemingTxNtfn.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.Method 100.00% (1/1) github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.Id 100.00% (1/1) github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.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.Method 100.00% (1/1) +github.com/conformal/btcws/cmds.go ListAddressTransactionsCmd.Id 100.00% (1/1) +github.com/conformal/btcws/notifications.go RecvTxNtfn.Id 100.00% (1/1) +github.com/conformal/btcws/cmds.go ListAddressTransactionsCmd.Method 100.00% (1/1) +github.com/conformal/btcws/notifications.go generateAllVerboseTxNtfn 100.00% (1/1) +github.com/conformal/btcws/cmds.go NewCreateEncryptedWalletCmd 100.00% (1/1) github.com/conformal/btcws/cmds.go parseListAllTransactionsCmd 87.50% (7/8) github.com/conformal/btcws/cmds.go NewNotifyAllNewTXsCmd 85.71% (6/7) github.com/conformal/btcws/cmds.go parseNotifyAllNewTXsCmd 85.71% (6/7) -github.com/conformal/btcws/cmds.go NewListAddressTransactionsCmd 83.33% (5/6) github.com/conformal/btcws/cmds.go NewGetUnconfirmedBalanceCmd 83.33% (5/6) -github.com/conformal/btcws/cmds.go NewRescanCmd 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 NewListAllTransactionsCmd 83.33% (5/6) +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 parseListAddressTransactionsCmd 76.47% (13/17) github.com/conformal/btcws/cmds.go parseNotifyNewTXsCmd 75.00% (9/12) github.com/conformal/btcws/cmds.go parseGetUnconfirmedBalanceCmd 75.00% (6/8) github.com/conformal/btcws/cmds.go parseWalletIsLockedCmd 75.00% (6/8) github.com/conformal/btcws/cmds.go parseRescanCmd 74.36% (29/39) -github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/notifications.go RedeemingTxNtfn.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/notifications.go BtcdConnectedNtfn.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go NotifyAllNewTXsCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go NotifySpentCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/notifications.go TxNtfn.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/notifications.go BlockConnectedNtfn.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go ListAllTransactionsCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/notifications.go RecvTxNtfn.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go GetBestBlockCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go GetUnconfirmedBalanceCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/notifications.go WalletLockStateNtfn.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/notifications.go AccountBalanceNtfn.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go ListAddressTransactionsCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go parseGetAddressBalanceCmd 72.73% (8/11) -github.com/conformal/btcws/cmds.go RescanCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go GetCurrentNetCmd.UnmarshalJSON 72.73% (8/11) -github.com/conformal/btcws/cmds.go WalletIsLockedCmd.UnmarshalJSON 72.73% (8/11) github.com/conformal/btcws/notifications.go AllTxNtfn.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/cmds.go parseGetAddressBalanceCmd 72.73% (8/11) +github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go WalletLockStateNtfn.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go GetCurrentNetCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go RecvTxNtfn.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go ListAddressTransactionsCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go BtcdConnectedNtfn.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go BlockConnectedNtfn.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go RescanCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go NotifySpentCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go TxNtfn.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go NotifyAllNewTXsCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go RescanProgressNtfn.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go GetUnconfirmedBalanceCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go RedeemingTxNtfn.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go GetBestBlockCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.UnmarshalJSON 72.73% (8/11) +github.com/conformal/btcws/notifications.go AccountBalanceNtfn.UnmarshalJSON 72.73% (8/11) github.com/conformal/btcws/notifications.go parseRedeemingTxNtfn 69.23% (18/26) github.com/conformal/btcws/notifications.go parseRecvTxNtfn 69.23% (18/26) github.com/conformal/btcws/cmds.go parseNotifySpentCmd 66.67% (10/15) @@ -127,61 +132,63 @@ github.com/conformal/btcws/cmds.go parseCreateEncryptedWalletCmd 66.67% (4/ 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/notifications.go parseAccountBalanceNtfn 64.29% (9/14) +github.com/conformal/btcws/notifications.go parseAllTxNtfn 63.64% (7/11) +github.com/conformal/btcws/notifications.go parseWalletLockStateNtfn 63.64% (7/11) +github.com/conformal/btcws/notifications.go parseTxNtfn 63.64% (7/11) github.com/conformal/btcws/notifications.go parseBlockDisconnectedNtfn 63.64% (7/11) github.com/conformal/btcws/notifications.go parseBlockConnectedNtfn 63.64% (7/11) -github.com/conformal/btcws/notifications.go parseAllTxNtfn 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 parseBtcdConnectedNtfn 62.50% (5/8) +github.com/conformal/btcws/notifications.go parseRescanProgressNtfn 62.50% (5/8) github.com/conformal/btcws/cmds.go NewExportWatchingWalletCmd 0.00% (0/15) -github.com/conformal/btcws/cmds.go RecoverAddressesCmd.UnmarshalJSON 0.00% (0/11) github.com/conformal/btcws/cmds.go NotifyBlocksCmd.UnmarshalJSON 0.00% (0/11) -github.com/conformal/btcws/cmds.go ExportWatchingWalletCmd.UnmarshalJSON 0.00% (0/11) +github.com/conformal/btcws/cmds.go RecoverAddressesCmd.UnmarshalJSON 0.00% (0/11) github.com/conformal/btcws/cmds.go AuthenticateCmd.UnmarshalJSON 0.00% (0/11) -github.com/conformal/btcws/cmds.go parseAuthenticateCmd 0.00% (0/9) +github.com/conformal/btcws/cmds.go ExportWatchingWalletCmd.UnmarshalJSON 0.00% (0/11) github.com/conformal/btcws/cmds.go parseRecoverAddressesCmd 0.00% (0/9) +github.com/conformal/btcws/cmds.go parseAuthenticateCmd 0.00% (0/9) github.com/conformal/btcws/cmds.go ExportWatchingWalletCmd.MarshalJSON 0.00% (0/6) github.com/conformal/btcws/cmds.go parseNotifyBlocksCmd 0.00% (0/3) -github.com/conformal/btcws/cmds.go NotifyBlocksCmd.MarshalJSON 0.00% (0/2) github.com/conformal/btcws/cmds.go RecoverAddressesCmd.MarshalJSON 0.00% (0/2) +github.com/conformal/btcws/cmds.go NotifyBlocksCmd.MarshalJSON 0.00% (0/2) github.com/conformal/btcws/cmds.go AuthenticateCmd.MarshalJSON 0.00% (0/2) -github.com/conformal/btcws/cmds.go GetBestBlockCmd.SetId 0.00% (0/1) -github.com/conformal/btcws/cmds.go ListAddressTransactionsCmd.SetId 0.00% (0/1) -github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.SetId 0.00% (0/1) -github.com/conformal/btcws/cmds.go NewAuthenticateCmd 0.00% (0/1) -github.com/conformal/btcws/cmds.go ListAllTransactionsCmd.SetId 0.00% (0/1) -github.com/conformal/btcws/cmds.go NotifySpentCmd.SetId 0.00% (0/1) -github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.SetId 0.00% (0/1) -github.com/conformal/btcws/cmds.go NotifyAllNewTXsCmd.SetId 0.00% (0/1) -github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.SetId 0.00% (0/1) +github.com/conformal/btcws/cmds.go GetUnconfirmedBalanceCmd.SetId 0.00% (0/1) +github.com/conformal/btcws/cmds.go NewNotifyBlocksCmd 0.00% (0/1) +github.com/conformal/btcws/cmds.go NotifyBlocksCmd.Id 0.00% (0/1) +github.com/conformal/btcws/cmds.go RescanCmd.SetId 0.00% (0/1) github.com/conformal/btcws/cmds.go NotifyBlocksCmd.Method 0.00% (0/1) github.com/conformal/btcws/cmds.go NotifyBlocksCmd.SetId 0.00% (0/1) -github.com/conformal/btcws/cmds.go NotifyBlocksCmd.Id 0.00% (0/1) -github.com/conformal/btcws/cmds.go NewNotifyBlocksCmd 0.00% (0/1) -github.com/conformal/btcws/cmds.go RescanCmd.SetId 0.00% (0/1) -github.com/conformal/btcws/cmds.go RecoverAddressesCmd.Method 0.00% (0/1) github.com/conformal/btcws/cmds.go RecoverAddressesCmd.SetId 0.00% (0/1) github.com/conformal/btcws/cmds.go RecoverAddressesCmd.Id 0.00% (0/1) +github.com/conformal/btcws/cmds.go NotifyNewTXsCmd.SetId 0.00% (0/1) github.com/conformal/btcws/cmds.go NewRecoverAddressesCmd 0.00% (0/1) -github.com/conformal/btcws/cmds.go GetUnconfirmedBalanceCmd.SetId 0.00% (0/1) -github.com/conformal/btcws/cmds.go ExportWatchingWalletCmd.Method 0.00% (0/1) -github.com/conformal/btcws/cmds.go ExportWatchingWalletCmd.SetId 0.00% (0/1) +github.com/conformal/btcws/cmds.go ListAddressTransactionsCmd.SetId 0.00% (0/1) +github.com/conformal/btcws/cmds.go GetBestBlockCmd.SetId 0.00% (0/1) +github.com/conformal/btcws/cmds.go RecoverAddressesCmd.Method 0.00% (0/1) +github.com/conformal/btcws/cmds.go NotifyAllNewTXsCmd.SetId 0.00% (0/1) github.com/conformal/btcws/cmds.go ExportWatchingWalletCmd.Id 0.00% (0/1) github.com/conformal/btcws/cmds.go parseExportWatchingWalletCmd 0.00% (0/1) +github.com/conformal/btcws/cmds.go GetAddressBalanceCmd.SetId 0.00% (0/1) github.com/conformal/btcws/cmds.go GetCurrentNetCmd.SetId 0.00% (0/1) +github.com/conformal/btcws/cmds.go WalletIsLockedCmd.SetId 0.00% (0/1) +github.com/conformal/btcws/cmds.go ListAllTransactionsCmd.SetId 0.00% (0/1) github.com/conformal/btcws/cmds.go AuthenticateCmd.Method 0.00% (0/1) github.com/conformal/btcws/cmds.go AuthenticateCmd.SetId 0.00% (0/1) github.com/conformal/btcws/cmds.go AuthenticateCmd.Id 0.00% (0/1) -github.com/conformal/btcws/cmds.go WalletIsLockedCmd.SetId 0.00% (0/1) +github.com/conformal/btcws/cmds.go NewAuthenticateCmd 0.00% (0/1) +github.com/conformal/btcws/cmds.go CreateEncryptedWalletCmd.SetId 0.00% (0/1) +github.com/conformal/btcws/cmds.go ExportWatchingWalletCmd.Method 0.00% (0/1) +github.com/conformal/btcws/cmds.go ExportWatchingWalletCmd.SetId 0.00% (0/1) +github.com/conformal/btcws/cmds.go NotifySpentCmd.SetId 0.00% (0/1) +github.com/conformal/btcws/notifications.go TxNtfn.SetId 0.00% (0/0) github.com/conformal/btcws/notifications.go BtcdConnectedNtfn.SetId 0.00% (0/0) +github.com/conformal/btcws/notifications.go RedeemingTxNtfn.SetId 0.00% (0/0) +github.com/conformal/btcws/notifications.go AllVerboseTxNtfn.SetId 0.00% (0/0) +github.com/conformal/btcws/notifications.go AllTxNtfn.SetId 0.00% (0/0) +github.com/conformal/btcws/notifications.go RescanProgressNtfn.SetId 0.00% (0/0) github.com/conformal/btcws/notifications.go RecvTxNtfn.SetId 0.00% (0/0) -github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.SetId 0.00% (0/0) +github.com/conformal/btcws/notifications.go WalletLockStateNtfn.SetId 0.00% (0/0) github.com/conformal/btcws/notifications.go AccountBalanceNtfn.SetId 0.00% (0/0) github.com/conformal/btcws/notifications.go BlockConnectedNtfn.SetId 0.00% (0/0) -github.com/conformal/btcws/notifications.go WalletLockStateNtfn.SetId 0.00% (0/0) -github.com/conformal/btcws/notifications.go AllVerboseTxNtfn.SetId 0.00% (0/0) -github.com/conformal/btcws/notifications.go TxNtfn.SetId 0.00% (0/0) -github.com/conformal/btcws/notifications.go RedeemingTxNtfn.SetId 0.00% (0/0) -github.com/conformal/btcws/notifications.go AllTxNtfn.SetId 0.00% (0/0) -github.com/conformal/btcws ---------------------------------------- 66.91% (552/825) +github.com/conformal/btcws/notifications.go BlockDisconnectedNtfn.SetId 0.00% (0/0) +github.com/conformal/btcws ---------------------------------------- 67.18% (571/850)