Skip to content

Conversation

kouloumos
Copy link
Contributor

@kouloumos kouloumos commented Jun 15, 2022

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
Copy link
Contributor

DrahtBot commented Jun 21, 2022

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

Conflicts

No conflicts as of last run.

@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
Contributor Author

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

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.

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,
Copy link
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
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.

@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
Copy link
Member

maflcko commented Aug 1, 2022

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
Copy link
Contributor Author

@kouloumos kouloumos left a 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,
Copy link
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.

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
Copy link
Member

maflcko commented Aug 2, 2022

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
Copy link
Member

maflcko commented Aug 2, 2022

cc @glozow @theStack

Copy link
Member

@glozow glozow left a 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!

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

@theStack theStack left a 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 🌇

@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
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