Skip to content

Conversation

@jnewbery
Copy link
Contributor

Adds a test specifically to test the wallet's getbalance and
getunconfirmedbalance RPCs.

wallet_basic.py is too large and should be broken down into more focused test cases.

I wrote wallet_balance.py to test the changes in #14602. Offering as a PR in case people think it's more generally useful.

@fanquake fanquake added the Tests label Nov 29, 2018
@promag
Copy link
Contributor

promag commented Nov 30, 2018

more focused test cases

👍

@Empact
Copy link
Contributor

Empact commented Nov 30, 2018

Concept ACK

Copy link
Contributor

@kallewoof kallewoof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK b31985d8c9a1cac749250a8f976fa6ccc2095b1e

A little confused by "getbalance with a minconf incorrectly excludes coins that have been spent more recently than the minconf blocks ago". Isn't it supposed to ignore balance for UTXOs whose confirmations < minconf?

Adds a test specifically to test the wallet's getbalance and
getunconfirmedbalance RPCs.
@jnewbery
Copy link
Contributor Author

Thanks for the review @kallewoof and @practicalswift !

A little confused by "getbalance with a minconf incorrectly excludes coins that have been spent more recently than the minconf blocks ago". Isn't it supposed to ignore balance for UTXOs whose confirmations < minconf?

Yes, there's currently a bug when getbalance is called with minconf=0, that it checks for UTXO creation, but not UTXO spending. That's fixed in this commit: cfa948d, but there's more work to be done before that PR is ready for merge.

@maflcko
Copy link
Member

maflcko commented Nov 30, 2018

utACK c1825b9 (Also checked that the test passes on 0.17, which qualifies it for backport)

maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Nov 30, 2018
c1825b9 [tests] Add wallet_balance.py (John Newbery)

Pull request description:

  Adds a test specifically to test the wallet's getbalance and
  getunconfirmedbalance RPCs.

  `wallet_basic.py` is too large and should be broken down into more focused test cases.

  I wrote `wallet_balance.py` to test the changes in bitcoin#14602. Offering as a PR in case people think it's more generally useful.

Tree-SHA512: 573ae8faf377df3d87d5112870b40690efb285fc5578fff8acc2ac1a0e4625ae65d3dfa8abbac577c87bec015038f425833783fa09f014f87906e8d098ed30d7
@maflcko maflcko merged commit c1825b9 into bitcoin:master Nov 30, 2018
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Nov 30, 2018
Adds a test specifically to test the wallet's getbalance and
getunconfirmedbalance RPCs.

Github-Pull: bitcoin#14845
Rebased-From: c1825b9
@jnewbery jnewbery deleted the balance_tests branch November 30, 2018 16:30
@jnewbery
Copy link
Contributor Author

Backported in #14852

dartdart26 added a commit to projectpai/paicoin that referenced this pull request Dec 28, 2018
Adds a test specifically to test the wallet's getbalance and
getunconfirmedbalance RPCs.

Changes were made to make it work with paicoin's implementation of getbalance.
dartdart26 added a commit to projectpai/paicoin that referenced this pull request Dec 28, 2018
Adds a test specifically to test the wallet's getbalance and
getunconfirmedbalance RPCs.

Changes were made to make it work with paicoin's implementation of getbalance.
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request May 4, 2020
Summary:
Adds a test specifically to test the wallet's getbalance and
getunconfirmedbalance RPCs.

---

This is a backport of Core [[bitcoin/bitcoin#14845 | PR14845]]

Test Plan:
  cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug
  ./test/functional/test_runner,py wallet_balance wallet_basic

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5950
ftrader pushed a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this pull request Aug 17, 2020
Summary:
Adds a test specifically to test the wallet's getbalance and
getunconfirmedbalance RPCs.

---

This is a backport of Core [[bitcoin/bitcoin#14845 | PR14845]]

Test Plan:
  cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug
  ./test/functional/test_runner,py wallet_balance wallet_basic

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5950
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants