Skip to content
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: use MiniWallet for make_utxo helper in feature_rbf.py #22998

Merged

Conversation

theStack
Copy link
Contributor

This PR aims to further increase MiniWallet usage in the functional test feature_rbf.py by using it in the make_utxo(...) helper, which is the only part that needs a wallet for most sub-tests. In order to do that, the amounts for the utxos have to be scaled down in two sub-tests first (test_doublespend_chain and test_doublespend_tree, see first two commits), since we need amounts passed to make_utxo than can be funded by only one input. For creating UTXOs with a value of 50 BTC, we'd need to implement a method for consolidating multiple utxos into one first, which seems to be overkill.

Note that after this PR's change, there is only one sub-test left (test_rpc) that needs the wallet compiled into bitcoind.

This is done in order to prepare the make_utxo helper to use MiniWallet,
which only supports creating transactions with single inputs, i.e. we
need to create amounts small enough to be funded by coinbase transactions
(50 BTC).
This is done in order to prepare the make_utxo helper to use MiniWallet,
which only supports creating transactions with single inputs, i.e. we
need to create amounts small enough to be funded by coinbase transactions
(50 BTC).
@theStack theStack force-pushed the 202109-test-use_miniwallet_for_make_utxo branch from 63b96c1 to f680d27 Compare September 16, 2021 14:49
@DrahtBot DrahtBot added the Tests label Sep 16, 2021
@DrahtBot
Copy link
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #22867 (test: Extend test coverage of BIP125 and document confusing/inconsistent behavior by mjdietzx)
  • #22290 (Package Mempool Submission with Package Fee-Bumping by glozow)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@Shubhankar-Gambhir
Copy link
Contributor

concept ACK
successfully ran test with

commenting test_rpc subtest
2021-09-21T10:20:52.294000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_gvoms1s4
2021-09-21T10:20:57.334000Z TestFramework (INFO): Running test simple doublespend...
2021-09-21T10:20:57.352000Z TestFramework (INFO): Running test doublespend chain...
2021-09-21T10:20:57.415000Z TestFramework (INFO): Running test doublespend tree...
2021-09-21T10:20:57.877000Z TestFramework (INFO): Running test replacement feeperkb...
2021-09-21T10:20:57.934000Z TestFramework (INFO): Running test spends of conflicting outputs...
2021-09-21T10:20:57.945000Z TestFramework (INFO): Running test new unconfirmed inputs...
2021-09-21T10:20:57.953000Z TestFramework (INFO): Running test too many replacements...
2021-09-21T10:20:58.020000Z TestFramework (INFO): Running test opt-in...
2021-09-21T10:20:58.034000Z TestFramework (INFO): Running test prioritised transactions...
2021-09-21T10:20:58.114000Z TestFramework (INFO): Running test no inherited signaling...
2021-09-21T10:20:58.121000Z TestFramework (INFO): Check that the child tx can still be replaced (via a tx that also replaces the parent)
2021-09-21T10:20:58.124000Z TestFramework (INFO): Running test replacement relay fee...
2021-09-21T10:20:58.126000Z TestFramework (INFO): Passed
2021-09-21T10:20:58.177000Z TestFramework (INFO): Stopping nodes
2021-09-21T10:20:58.581000Z TestFramework (INFO): Cleaning up /tmp/bitcoin_func_test_gvoms1s4 on exit
2021-09-21T10:20:58.582000Z TestFramework (INFO): Tests successful
changes on test_rpc proposed in #23052
2021-09-21T10:18:35.765000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_q9cpp4nw
2021-09-21T10:18:42.487000Z TestFramework (INFO): Running test simple doublespend...
2021-09-21T10:18:42.504000Z TestFramework (INFO): Running test doublespend chain...
2021-09-21T10:18:42.553000Z TestFramework (INFO): Running test doublespend tree...
2021-09-21T10:18:43.002000Z TestFramework (INFO): Running test replacement feeperkb...
2021-09-21T10:18:43.062000Z TestFramework (INFO): Running test spends of conflicting outputs...
2021-09-21T10:18:43.073000Z TestFramework (INFO): Running test new unconfirmed inputs...
2021-09-21T10:18:43.081000Z TestFramework (INFO): Running test too many replacements...
2021-09-21T10:18:43.147000Z TestFramework (INFO): Running test opt-in...
2021-09-21T10:18:43.159000Z TestFramework (INFO): Running test RPC...
2021-09-21T10:18:43.728000Z TestFramework (INFO): Running test prioritised transactions...
2021-09-21T10:18:43.817000Z TestFramework (INFO): Running test no inherited signaling...
2021-09-21T10:18:43.823000Z TestFramework (INFO): Check that the child tx can still be replaced (via a tx that also replaces the parent)
2021-09-21T10:18:43.825000Z TestFramework (INFO): Running test replacement relay fee...
2021-09-21T10:18:43.828000Z TestFramework (INFO): Passed
2021-09-21T10:18:43.878000Z TestFramework (INFO): Stopping nodes
2021-09-21T10:18:47.246000Z TestFramework (INFO): Cleaning up /tmp/bitcoin_func_test_q9cpp4nw on exit
2021-09-21T10:18:47.246000Z TestFramework (INFO): Tests successful

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

review ACK f680d27 🦐

Show signature and timestamp

Signature:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

review ACK f680d27155374de658d40db0ba40460919aa1ba2 🦐
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUjbcgwAkRTDpqwf/UETFI6ocdBFK2PZqYgMFszvH/UuC2h2MvgeZGV8ZnBl8BKQ
4wyWuZJSY13QCjVbaUeF0jqzMw8mJd1KUMaAw3nHP4lasGpuOxhhP5l0xyK6UJB1
1inOWwb1GEB2p5Bhd6m0q4ucSo3da5OBdE1OO+GAmOBaEZE5AKvExIxnZEd74A1E
yL1K6vzw+ajJaofIOm/AkOe9x7mrHC4ilqOrQVf4UHZ3YG9np9BVDx4srCbyaXWr
OHeTY9EJx38XSLJooQs9Ap+7zexx8jXv6vqsJuR+deZoq83xqo4WaInrXsCFDiux
yFccruXkXlIh47BEkwSKRBI/7avqiNvNoVKiQGHhFbn2km9YIkEJRASfCuB5kxca
MM6xt6GfvSQc7IiUiN3DaACJH1ut5GALVX0KiJRw1Y+wYlWJjqwoG0TgJUezXaUy
5+oP93maZNRsWses07raJXmJ8j2hSYcvPmfGeOKWDgDpEXJfk/r7b/MZFPBzOG8q
kqgKZP7P
=4DjW
-----END PGP SIGNATURE-----

Timestamp of file with hash 8c9f3fb0e7a45d86ca12d77967ff62c2f410f3766b9ea0920fb291caba583a61 -

@maflcko maflcko merged commit ae674a0 into bitcoin:master Sep 21, 2021
@theStack theStack deleted the 202109-test-use_miniwallet_for_make_utxo branch September 21, 2021 13:36
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Sep 21, 2021
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Sep 29, 2021
cfdb6ba test: use MiniWallet for p2p_filter.py (Sebastian Falbesoner)
6fc2cd3 test: introduce helper to create random P2WPKH scriptPubKeys (Sebastian Falbesoner)
aa26797 test: MiniWallet: add `send_to` method to create arbitrary txouts (Sebastian Falbesoner)

Pull request description:

  This PR enables one more of the non-wallet functional tests (p2p_filter.py) to be run even with the Bitcoin Core wallet disabled by using the MiniWallet instead, as proposed in bitcoin#20078.
  For this purpose, a MiniWallet method `send_to` is introduced first, which allows to create arbitrary outputs (scriptPubKey/amount). Note that the implementation for this is already present in feature_rbf.py (recently added in PR bitcoin#22998), i.e. it is simply moved to the MiniWallet interface.

ACKs for top commit:
  laanwj:
    Code review ACK cfdb6ba

Tree-SHA512: 13b063631f0d7af065b7757cfe8b47c9be6cb9850ac5db2968a2bba4f5a18cdc9f89173a9b03971545356225082042f5fdbe49d3036027d18e8b7eb042d04f5e
@bitcoin bitcoin locked and limited conversation to collaborators Oct 30, 2022
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.

4 participants