-
Notifications
You must be signed in to change notification settings - Fork 38.8k
test: shift coverage from getunconfirmedbalance to getbalances #18451
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
test: shift coverage from getunconfirmedbalance to getbalances #18451
Conversation
|
Not sure if we should break RPC users because it is convenient for us to delete code |
|
These were deprecated in the 0.19.0.1 release notes. Some previous comments on this change:
In any case, it may be a good idea to update the tests. |
|
Yes, they could be (not: must be) removed in the future, but we don't need to be overly aggressive about it when there is no reason to be so. Every API change is going to cause pain for users, encouraging them to not upgrade to the latest version and thus causing harm to everyone involved. I think they can be removed when 0.19.0 is EOL or at least no longer actively maintained, since at that point we assume that no one is depending on the deprecated API. I understand an argument for aggressive deprecation and removal when there is a massive maintenance burden (such as wallet accounts) or danger in using the deprecated API, but I don't see any of this apply here. |
|
Much of the value of this PR (as well as the proposed follow-ups) is in updating the tests, so depending on consensus it can be oriented in that direction as well. |
|
I don't mind updating tests as long as test coverage is not decreased https://marcofalke.github.io/btc_cov/total.coverage/src/wallet/rpcwallet.cpp.gcov.html#775 |
|
And before removing, it might have to go through a deprecation cycle with -deprecatedrpc according to https://github.com/bitcoin/bitcoin/blob/master/doc/JSON-RPC-interface.md#versioning . I am not going to advocate to start this deprecation cycle now, but I wanted to mention it for completeness. |
|
Agreed. |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
|
I agree we should do a deprecation cycle first (with |
Agree, no need to rush here. |
and shift some getunconfirmedbalance calls to getbalances, as the former is deprecated, while leaving essential coverage for it in test_balances().
…andonconflict tests
b3afb07 to
0306d78
Compare
|
As per the review comments, this PR now only updates the test coverage to use That said, I've seen 3 regular contributors confused in the past 10 days by "DEPRECATED" warnings in the code that are not following the deprecation policy in JSON-RPC-interface.md#versioning. ISTM these warnings should either be removed, or the calls deprecated ( |
|
I think the right thing to do here is to go through a
We can't assume that. Simply writing 'DEPRECATED' in RPC documentation doesn't do anything. No-one who is using that API is going to see that documentation, so they'll continue to use the interface exactly as they have done in the past (and in my experience, even people who do see it don't make any changes to their client behaviour if they don't have to). I don't think it matters which release we start the |
I agree. The test updates in this PR should be done at any rate. Once they are merged, a PR can be opened to begin the deprecation process (or remove the warnings, or update the deprecation documentation if 2-stage soft-then-hard deprecation is the consensus preference). |
|
utACK 0306d78 |
…to getbalances 0306d78 Use getbalances in wallet_address_types tests (Jon Atack) 7eacdc5 Shift coverage from getunconfirmedbalance to getbalances in wallet_abandonconflict tests (Jon Atack) 3e6f737 Improve getbalances coverage in wallet_balance tests (Jon Atack) Pull request description: <strike>This PR updates several tests and then removes the `getunconfirmedbalance` RPC which was deprecated in facfb41 a year ago. Next steps: remove the deprecated `getwalletinfo` fields and the `getbalance` RPC in follow-ups, if there seems to be consensus on those removals.</strike> Update: `getunconfirmedbalance` RPC was deprecated in facfb41 a year ago, but following the review comments below, this PR now only updates the test coverage to use `getbalances` while still leaving basic coverage for `getunconfirmedbalance` in wallet_balance.py. That said, I've seen 3 regular contributors confused in the past 10 days by "DEPRECATED" warnings in the code that are not following the deprecation policy in [JSON-RPC-interface.md#versioning](https://github.com/bitcoin/bitcoin/blob/master/doc/JSON-RPC-interface.md#versioning). ISTM these warnings should either be removed, or the calls deprecated (`-deprecatedrpc`), or the policy updated to describe these warnings as a pre-deprecation practice. ACKs for top commit: jnewbery: utACK 0306d78 Tree-SHA512: 692e43e9bed5afa97d905740666e365f0b64e559e1c75a6a398236d9e943894e3477947fc11324f420a6feaffa0c0c1532aa983c50090ca39d06551399e6ddd1
Summary: > Improve getbalances coverage in wallet_balance tests > and shift some getunconfirmedbalance calls to getbalances, as the former is > deprecated, while leaving essential coverage for it in test_balances(). > > Shift coverage from getunconfirmedbalance to getbalances in wallet_abandonconflict tests > > Use getbalances in wallet_address_types tests This is a backport of Core [[bitcoin/bitcoin#18451 | PR18451]] Test Plan: `test/functional/test_runner.py wallet*` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D8927
This PR updates several tests and then removes thegetunconfirmedbalanceRPC which was deprecated in facfb41 a year ago.Next steps: remove the deprecatedgetwalletinfofields and thegetbalanceRPC in follow-ups, if there seems to be consensus on those removals.Update:
getunconfirmedbalanceRPC was deprecated in facfb41 a year ago, but following the review comments below, this PR now only updates the test coverage to usegetbalanceswhile still leaving basic coverage forgetunconfirmedbalancein wallet_balance.py.That said, I've seen 3 regular contributors confused in the past 10 days by "DEPRECATED" warnings in the code that are not following the deprecation policy in JSON-RPC-interface.md#versioning.
ISTM these warnings should either be removed, or the calls deprecated (
-deprecatedrpc), or the policy updated to describe these warnings as a pre-deprecation practice.