This commit modifies the AllVerboseTxNtfn command to use a parser along
with the standard btcjson.RegisterCustomCmd instead of the now removed
RegisterCustomCmdGenerator function. This is possible due to the recent
changes that defers the unmarshalling of the parameters of a RawCmd to the
parser.
The unmarshaller for the GetAddressBalanceCmd was calling the wrong parse
function. It wasn't caught by the tests because the error on
UnmarshalJSON was being ignored, so this commit also updates the tests to check the
error.
This commit modifies all of the commands and notifications to work
properly with the latest btcjson.RawCmd Params field changes.
This new approach is superior to the old method of using a []interface{}
because it means that each parameter is now unmarshalled into the expected
concrete type directly instead of whatever it happens to be in the JSON.
Since it is now preferred to use full blown structs for individual
parameters, the RescanCmd type has been changed to use a new OutPoint
that can be used directly for marshalling and unmarshalling instead of a
*btcwire.OutPoint.
Also, all of the MarshalJSON functions now make use of the new
btcjson.NewRawCmd function rather than repeating the same common field
over and over and all of the MarshalJSON, UnmarshalJSON, and parseX
functions have been made more consistent.
ok @jrick
This change removes the processedtx notification, replacing it with
recvtx, and the spenttx notification, replacing it with redeemingtx.
Both new transactions return the full serialized transaction (encoded
in hexadecimal) rather than details about the transaction.
The old txmined notification has also been completely removed as it is
unreliable due to transaction malleability and no code should be
depending on it.
Sending NotifyAllNewTXsCmd will register websocket client to receive
notifications on all new transactions.
Once registered the client will receive either AllTxNtfn or
AllVerboseTxNtfn based on the required verbose field in the
NotifyAllNewTXsCmd.
The createencryptedwallet extension RPC request should not be used to
create wallets for additional accounts. Instead, all btcwallet
accounts should use the same passphrase as the default account's
wallet. This change removes the account name and description
parameters from createencryptedwallet, as it will only be used to
create the default account.
This changes notifications to JSON-RPC Requests, rather than
Responses, that also satisify the btcjson.Cmd interface and are
registered with btcjson's parser. This prevents issues where JSON-RPC
Response IDs clash due to a client using the same ID as what an old
notification used.
As this changes the API, and thus, requires notification handlers to
be modified, the remaining missing notifications used by btcwallet
have been implemented. Applications parsing these notifications, such
as btcgui, can now use a common handler function signature for all
notifications.
Test coverage for all notifications has been added (excluding testing
for badly-marshaled notifications with wrong numbers of parameters, or
wrong types).
Fixes#2.