Change the return type of upgradewallet to be an object for future extensibility.
Also return any error string returned from the UpgradeWallet() function.
Change the return type of upgradewallet to be an object for future extensibility.
Also return any error string returned from the UpgradeWallet() function.
ACK 2ead31fb1b17c9b183a4b81f0ae4f48e5cf67d64
Thanks for picking this up to avoid a delay in the 0.21 release!
ACK, tested the upgradewallet help and output manually both for successful and failure cases. Two thoughts: (a) it might be user-friendly to provide a message that the upgrade was successful rather than an empty JSON object with a newline in the middle, e.g. {"result": "the wallet was upgraded successfully to version 16990"}, and (b) could add a functional test case for the result in case of an error.
$ bitcoin-cli -regtest upgradewallet
{
}
$ bitcoin-cli -regtest upgradewallet
{
"error": "Cannot downgrade wallet"
}
$ bitcoin-cli -regtest help upgradewallet
upgradewallet ( version )
Upgrade the wallet. Upgrades to the latest version if no version number is specified
New keys may be generated and a new wallet backup will need to be made.
Arguments:
1. version (numeric, optional, default=169900) The version number to upgrade to. Default is the latest wallet version
Result:
{ (json object)
"error" : "str" (string, optional) Error message (if there is one)
}
Examples:
> bitcoin-cli upgradewallet 169900
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "upgradewallet", "params": [169900]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
a) seems like a feature, so should be a separate pull b) seems like a test. Can go in anytime (in this pull or any other pull, no strong opinion)
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
No conflicts as of last run.
Tested ACK 2ead31fb1b17c9b183a4b81f0ae4f48e5cf67d64
Milestone
0.21.0