-
Notifications
You must be signed in to change notification settings - Fork 719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RPC][Wallet] Deprecate internal account system #1731
[RPC][Wallet] Deprecate internal account system #1731
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good PR. Concept and code ACK, with few nits/questions inlined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work 🚜 , solving the comments above, light ACK for me.
rebase needed. |
b2673dc
to
d6d05b5
Compare
rebased and addressed comments |
d6d05b5
to
5b760a8
Compare
backported from bitcoin#9614
This is more consistent with `JSONRPCReplyObj`.
d3b3725
to
0e94c29
Compare
0e94c29
to
922cca7
Compare
These initially mirror the account functions, with the following differences: * These functions aren't DEPRECATED in the help * Help mentions 'label' instead of accounts. In the language used, labels are associated with addresses, instead of addresses associated with labels. (unlike with accounts.) * Labels have no balance * No balances in listlabels * listlabels has no minconf or watchonly argument * Like in the GUI, labels can be set on any address, not just receiving addreses * Unlike accounts, labels can be deleted. Being unable to delete them is a common annoyance. Currently only by reassigning all addresses using `setlabel`, but an explicit call `deletelabel` which assigns all address to the default label may make sense.
Deprecate all accounts functionality and make it only accessible by using `-deprecatedrpc=accounts`. Accounts specific RPCs, account arguments, and account related results all require the `-deprecatedrpc=accunts` startup option now in order to see account things.
New optional input argument "addressFilter" allows the results to be filtered so that only that address' transactions are shown
922cca7
to
7ebebe8
Compare
All functional tests that were using the, now deprecated, account API have been switched over to the new label API. Testing of the account API still exists in the `rpc_deprecated.py` script however, which has been added to the list of tests to run.
This was preventing the `help` command from listing or returning help information on newer commands.
7ebebe8
to
6238aa4
Compare
|
||
# Node1's "from0" account balance should be just the doublespend: | ||
assert_equal(self.nodes[1].getbalance("from0"), (1240 * 5)) | ||
assert_equal(self.nodes[1].getbalance(), 6250 + (1240 * 5)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use starting_balance
instead of static 6250.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 6238aa4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor non-blocking thing in getaddressinfo
. But it can be addressed in a subsequent PR.
Tested with and without -deprecatedrpc=accounts
.
All good ACK 6238aa4
if (request.fHelp || request.params.size() > 1) | ||
throw std::runtime_error( | ||
"getaddressinfo ( \"address\" )\n" | ||
"\nReturn information about the given PIVX address.\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was already like this, but shouldn't the address be a required field? i.e.
if (request.fHelp || request.params.size() != 1)
throw std::runtime_error(
"getaddressinfo \"address\"\n"
...
This is the combined upstream PRs necessary to finalize Stage 2 of removing the internal wallet 'account' system in favor of a new 'label' system as detailed in #1706.
With this, references to 'account' in RPC command output has either been changed to 'label' (where appropriate), marked as deprecated and slated for removal in v5.0, or hidden/disabled entirely unless using a specific startup argument (
-deprecatedrpc=accounts
)The functional testing suite has also been updated to use the 'label' API, and only continue to use the old 'account' API to verify expected same results with newer counterpart RPC commands, if available.