Skip to content

test: use MiniWallet to simplify mempool_package_limits.py tests#25379

Merged
maflcko merged 2 commits into
bitcoin:masterfrom
kouloumos:simplify-mempool_package_limits.py
Aug 3, 2022
Merged

test: use MiniWallet to simplify mempool_package_limits.py tests#25379
maflcko merged 2 commits into
bitcoin:masterfrom
kouloumos:simplify-mempool_package_limits.py

Conversation

@kouloumos

@kouloumos kouloumos commented Jun 15, 2022

Copy link
Copy Markdown
Contributor

While wallet.py includes the MiniWallet class and some helper methods, it also includes some methods that have been moved there without having any direct relation with the MiniWallet class. Specifically make_chain, create_child_with_parents and create_raw_chain methods that were extracted from rpc_packages.py at f8253d6 in order to be used on both mempool_package_limits.py and rpc_packages.py.

Since that change, due to the introduction of additional methods in MiniWallet, the functionality of those methods can now be replicated with the existing MiniWallet methods and simultaneously simplify those tests by using the MiniWallet.

This PR's goals are

  • to simplify the mempool_package_limits.py functional tests with usage of the MiniWallet.
  • to make progress towards the removal of the make_chain, create_child_with_parents and create_raw_chain methods of wallet.py.

For the purpose of the aforementioned goals, a helper method MiniWallet.send_self_transfer_chain is introduced and method bulk_transaction has been integrated in create_self_transfer* methods using an optional target_weight option.

@DrahtBot

DrahtBot commented Jun 21, 2022

Copy link
Copy Markdown
Contributor

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

Conflicts

No conflicts as of last run.

Comment thread test/functional/mempool_package_limits.py Outdated
@kouloumos kouloumos force-pushed the simplify-mempool_package_limits.py branch from 2b55bd3 to fab7280 Compare June 21, 2022 08:20
@kouloumos kouloumos force-pushed the simplify-mempool_package_limits.py branch 2 times, most recently from 754874c to 1c9243b Compare June 28, 2022 12:04
@kouloumos

Copy link
Copy Markdown
Contributor Author

Forced-pushed to take advantage of the logic introduced in #25445

@maflcko maflcko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm 1c9243b40db5746575ed55d09774872f0a98b24a 🐐

Show signature

Signature:

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

lgtm 1c9243b40db5746575ed55d09774872f0a98b24a 🐐
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUjMzgv8Ck6nSSmgAatlxCMG837PArkz0UTGPh4ek3WbN73Mn1dLmSCBsvlzbSVG
4yQlx+vMpDNUrJO07nU7fVszAKK5+BOFUcd1pElpZbIoOWHIudbDdEuOeOIDjuKC
368yHXtcXZUnx4ZUGJvC11LtkH2eZxjrwt70iVWqoNWMz2Wj3dNS01VGOkAN6Bb2
8wUWoNYwgm+iTNJIsQnzPuc9I7qjhILvhcbMTXKX/NQQi4StPq+5nBRFIXSePSuD
ApxcDIGIB2s3cYu/SswObSHtCtRKt/gaG0Xd7OkOMZ8bpNPU0vWiRAFtRn5OhKj7
2csGoyU1prVU52njdCYaC/EAiyWumqBmw/4CtffajgZ4UJluPhvn2ZBjAJDq9DAb
SiFfaITnyqEA327CahBPIkyTXmL15HC0zipUDjs0U5YYLby2z05h6i9htpQv+iCJ
eH1N+nmixN9aA6v1gkXNEs7qVcVWWLhLUuatmxzgaEr5pdhn+7701yNirhqu004l
JrbTuRmo
=dEET
-----END PGP SIGNATURE-----

Comment thread test/functional/mempool_package_limits.py Outdated
Comment thread test/functional/test_framework/wallet.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can remove all of these functions now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

create_child_with_parents and make_chain are still used in rpc_packages.py from which I anticipate to remove on a follow-up PR.

Comment thread test/functional/test_framework/wallet.py Outdated
@bitcoin bitcoin deleted a comment from neto626roman Aug 1, 2022
@kouloumos kouloumos force-pushed the simplify-mempool_package_limits.py branch 2 times, most recently from 8f11c3d to b43ff6c Compare August 1, 2022 14:46
@maflcko

maflcko commented Aug 1, 2022

Copy link
Copy Markdown
Member

Also, should be rebased

@kouloumos kouloumos force-pushed the simplify-mempool_package_limits.py branch from b43ff6c to 48afe03 Compare August 1, 2022 15:15

@kouloumos kouloumos left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Rebased and addressed @MarcoFalke comments.

The failing CI task is also on master, it seems not to be related with the changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

create_child_with_parents and make_chain are still used in rpc_packages.py from which I anticipate to remove on a follow-up PR.

Comment thread test/functional/mempool_package_limits.py Outdated
Comment thread test/functional/test_framework/wallet.py Outdated
Comment thread test/functional/test_framework/wallet.py Outdated
Moved `bulk_transaction` into MiniWallet class as `_bulk_tx` private
helper method to be used when the newly added `target_weight` option is
passed to `create_self_transfer*`
With this new method, a chain of transactions can be created. This
method is introduced to further simplify the mempool_package_limits.py
tests.
@kouloumos kouloumos force-pushed the simplify-mempool_package_limits.py branch from 48afe03 to f2f6068 Compare August 1, 2022 16:12
@maflcko

maflcko commented Aug 2, 2022

Copy link
Copy Markdown
Member

ACK f2f6068 👜

Show signature

Signature:

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

ACK f2f6068b69b1b532db92b276f024c89b56f38294 👜
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUjJEAwAs/RUpTTagS6DLfFVOT2d+FAmEcS+/m1s5438bxGA9pb/lhVYxxYlOTvM
wtgbP2N1G496b2wmgzRWZ8LPdI4JvUmzgP4+f9fvPO2jXo6+bLZFfLBnVvhbybVn
keiIkU38nUmohPlQ2OZvNfXFxrf3Ij1jQDauEcg2wk4fjog7WPFK3tkA6Js338bE
/GzH7hmy/pNMMTZcsX6etEwxT+zOfit/PKo4b7+VD1R41lkSg1SacUdMbUph13Lw
bVtPG450XzW0U2MSS8iPyG81y1Wnlcvtj2Z8wO5MsSuJbcoYT5/haDjsMssKDHF9
YpRhKbRVYeejJny9xIqrtGP56WIjIdGrJ7h3I14vmn9zqeu4qvW9nUeUN7VHyEiw
dTb8YDFwTjmI6h2XzVA2OBltMB4ZlUJqvL59CO6DOHKwzObtWh/Y5ox2GKqEzEUz
QXBwKrNA3g+5jKAJYfpRy6c8OTTsN4elrnl45T5QmVXe5npyStD3TMPoZJhCASgI
3a/nCGHb
=PXPl
-----END PGP SIGNATURE-----

@maflcko

maflcko commented Aug 2, 2022

Copy link
Copy Markdown
Member

cc @glozow @theStack

@glozow glozow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Concept ACK

I was just thinking it would be nice to get rid of these functions that are only used in package functional tests and use MiniWallet instead, thanks for working on this!

@maflcko maflcko merged commit 9155f9b into bitcoin:master Aug 3, 2022

@theStack theStack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Post-merge concept and light code-review ACK f2f6068 🌇

@kouloumos kouloumos deleted the simplify-mempool_package_limits.py branch September 2, 2022 17:44
@bitcoin bitcoin locked and limited conversation to collaborators Sep 2, 2023
knst added a commit to knst/dash that referenced this pull request Jan 4, 2026
Otherwise this error appears:

    test_framework.authproxy.JSONRPCException: min relay fee not met, 25500 < 30332 (-26)
knst added a commit to knst/dash that referenced this pull request Jan 4, 2026
Otherwise this error appears:

    test_framework.authproxy.JSONRPCException: min relay fee not met, 25500 < 30332 (-26)
knst added a commit to knst/dash that referenced this pull request Jan 6, 2026
Otherwise this error appears:

    test_framework.authproxy.JSONRPCException: min relay fee not met, 25500 < 30332 (-26)
knst added a commit to knst/dash that referenced this pull request Jan 7, 2026
Otherwise this error appears:

    test_framework.authproxy.JSONRPCException: min relay fee not met, 25500 < 30332 (-26)
knst added a commit to knst/dash that referenced this pull request Jan 24, 2026
Otherwise this error appears:

    test_framework.authproxy.JSONRPCException: min relay fee not met, 25500 < 30332 (-26)
knst added a commit to knst/dash that referenced this pull request Jan 24, 2026
Otherwise this error appears:

    test_framework.authproxy.JSONRPCException: min relay fee not met, 25500 < 30332 (-26)
knst added a commit to knst/dash that referenced this pull request Feb 6, 2026
Otherwise this error appears:

    test_framework.authproxy.JSONRPCException: min relay fee not met, 25500 < 30332 (-26)
knst added a commit to knst/dash that referenced this pull request Feb 10, 2026
Otherwise this error appears:

    test_framework.authproxy.JSONRPCException: min relay fee not met, 25500 < 30332 (-26)
PastaPastaPasta added a commit to dashpay/dash that referenced this pull request Feb 15, 2026
…itcoin#25957, bitcoin#25986, bitcoin#26158, bitcoin#26294, bitcoin#26349, bitcoin#26388, bitcoin#26404, bitcoin#26424, bitcoin#26625, bitcoin#26920, bitcoin#27350

2ca4df5 Merge bitcoin#27350: test: refactor: dedup mempool_package_limits.py subtests via decorator (glozow)
f845321 Merge bitcoin#26625: test: Run mempool_packages.py with MiniWallet (fanquake)
ce002be Merge bitcoin#25986: test: refactor `RPCPackagesTest` to use `MiniWallet` (glozow)
9cbc631 Merge bitcoin#25773: test: Target exact weight in MiniWallet _bulk_tx (MacroFake)
f764261 fix: add missing changes and adjust fee rate to fix bitcoin#25379 (Konstantin Akimov)
afb8d47 Merge bitcoin#25379: test: use MiniWallet to simplify mempool_package_limits.py tests (MacroFake)
302ed45 Merge bitcoin#24836: add RPC (-regtest only) for testing package policy (fanquake)
f66147b Merge bitcoin#26294: build: move util/url to common/url (fanquake)
d7e3cf6 Merge bitcoin#26424: doc: correct deriveaddresses RPC name (MacroFake)
4a15fe7 Merge bitcoin#26404: test: fix intermittent failure in rpc_getblockfrompeer.py (MacroFake)
4401e24 Merge bitcoin#26349: rpc: make `address` field optional `list{transactions, sinceblock}` response (Andrew Chow)
0a269f3 Merge bitcoin#26388: ci: Use `macos-ventura-xcode:14.1` image for "macOS native" task (MacroFake)
c2d79d0 fmt: apply clang-format for blsl_dkg.cpp (Konstantin Akimov)
b09f75f Merge bitcoin#26158: bench: add "priority level" to the benchmark framework (Andrew Chow)
5d2d43f Merge bitcoin#26920: doc: add release note for bitcoin#25957 (fast wallet rescan) (fanquake)
962e810 Merge bitcoin#25957: wallet: fast rescan with BIP157 block filters for descriptor wallets (Andrew Chow)

Pull request description:

  ## What was done?
  Regular backports from bitcoin core v25

  ## How Has This Been Tested?
  Run unit & functional tests

  ## Breaking Changes
  N/A

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  UdjinM6:
    utACK 2ca4df5

Tree-SHA512: a5153869717e73a38fe8ae0b20cde36fefa84322d8852c21b13548c142836e3013ad4e75858ce1209bf3985f032faad0aabf6406e0710bbaff19d73149faf6fb
Shailendra53 pushed a commit to CryptoTuraTeam/dash that referenced this pull request Feb 27, 2026
Otherwise this error appears:

    test_framework.authproxy.JSONRPCException: min relay fee not met, 25500 < 30332 (-26)
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.

6 participants