-
Notifications
You must be signed in to change notification settings - Fork 37.7k
test: use MiniWallet to simplify mempool_package_limits.py tests #25379
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 to simplify mempool_package_limits.py tests #25379
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
2b55bd3
to
fab7280
Compare
754874c
to
1c9243b
Compare
Forced-pushed to take advantage of the logic introduced in #25445 |
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.
lgtm 1c9243b 🐐
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-----
from test_framework.util import ( | ||
assert_equal, | ||
) | ||
from test_framework.wallet import ( | ||
bulk_transaction, |
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.
Can remove all of these functions now?
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.
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.
8f11c3d
to
b43ff6c
Compare
Also, should be rebased |
b43ff6c
to
48afe03
Compare
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.
Rebased and addressed @MarcoFalke comments.
The failing CI task is also on master, it seems not to be related with the changes.
from test_framework.util import ( | ||
assert_equal, | ||
) | ||
from test_framework.wallet import ( | ||
bulk_transaction, |
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.
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.
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.
48afe03
to
f2f6068
Compare
ACK f2f6068 👜 Show signatureSignature:
|
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.
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!
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.
Post-merge concept and light code-review ACK f2f6068 🌇
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. Specificallymake_chain
,create_child_with_parents
andcreate_raw_chain
methods that were extracted fromrpc_packages.py
at f8253d6 in order to be used on bothmempool_package_limits.py
andrpc_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
mempool_package_limits.py
functional tests with usage of the MiniWallet.make_chain
,create_child_with_parents
andcreate_raw_chain
methods ofwallet.py
.For the purpose of the aforementioned goals, a helper method
MiniWallet.send_self_transfer_chain
is introduced and methodbulk_transaction
has been integrated increate_self_transfer*
methods using an optionaltarget_weight
option.