test: MiniWallet: introduce enum type for output mode#22048
Merged
maflcko merged 1 commit intobitcoin:masterfrom May 25, 2021
Merged
test: MiniWallet: introduce enum type for output mode#22048maflcko merged 1 commit intobitcoin:masterfrom
maflcko merged 1 commit intobitcoin:masterfrom
Conversation
For the MiniWallet constructor, the two boolean parameters "raw_script" and "use_p2pk" are replaced by a single parameter of the newly introduced type MiniWalletMode (derived by enum.Enum), which can hold the following values: - ADDRESS_OP_TRUE - RAW_OP_TRUE - RAW_P2PK
|
Tested ACK. Run on Fedora 34. log[user@fedora bitcoin]$ git grep MiniWalletMode
test/functional/feature_cltv.py: MiniWalletMode,
test/functional/feature_cltv.py: wallet = MiniWallet(self.nodes[0], mode=MiniWalletMode.RAW_OP_TRUE)
test/functional/feature_csv_activation.py: MiniWalletMode,
test/functional/feature_csv_activation.py: self.miniwallet = MiniWallet(self.nodes[0], mode=MiniWalletMode.RAW_P2PK)
test/functional/test_framework/wallet.py:class MiniWalletMode(Enum):
test/functional/test_framework/wallet.py: def __init__(self, test_node, *, mode=MiniWalletMode.ADDRESS_OP_TRUE):
test/functional/test_framework/wallet.py: assert isinstance(mode, MiniWalletMode)
test/functional/test_framework/wallet.py: if mode == MiniWalletMode.RAW_OP_TRUE:
test/functional/test_framework/wallet.py: elif mode == MiniWalletMode.RAW_P2PK:
test/functional/test_framework/wallet.py: elif mode == MiniWalletMode.ADDRESS_OP_TRUE:
[user@fedora bitcoin]$ ./test/functional/feature_csv_activation.py
2021-05-24T20:29:11.065000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_wrpsqui0
2021-05-24T20:29:11.457000Z TestFramework (INFO): Generate blocks in the past for coinbase outputs.
2021-05-24T20:29:12.781000Z TestFramework (INFO): Height = 430, CSV not yet active (will activate for block 432, not 431)
2021-05-24T20:29:13.915000Z TestFramework (INFO): TESTING
2021-05-24T20:29:13.915000Z TestFramework (INFO): Pre-Soft Fork Tests. All txs should pass.
2021-05-24T20:29:13.915000Z TestFramework (INFO): Test version 1 txs
2021-05-24T20:29:14.038000Z TestFramework (INFO): Test version 2 txs
2021-05-24T20:29:14.279000Z TestFramework (INFO): Post-Soft Fork Tests.
2021-05-24T20:29:14.279000Z TestFramework (INFO): BIP 113 tests
2021-05-24T20:29:14.861000Z TestFramework (INFO): BIP 68 tests
2021-05-24T20:29:14.861000Z TestFramework (INFO): Test version 1 txs - all should still pass
2021-05-24T20:29:14.977000Z TestFramework (INFO): Test version 2 txs
2021-05-24T20:29:16.794000Z TestFramework (INFO): BIP 112 tests
2021-05-24T20:29:16.795000Z TestFramework (INFO): Test version 1 txs
2021-05-24T20:29:22.180000Z TestFramework (INFO): Test version 2 txs
2021-05-24T20:29:27.030000Z TestFramework (INFO): Stopping nodes
2021-05-24T20:29:27.184000Z TestFramework (INFO): Cleaning up /tmp/bitcoin_func_test_wrpsqui0 on exit
2021-05-24T20:29:27.185000Z TestFramework (INFO): Tests successful |
reemuru
approved these changes
May 25, 2021
Member
|
cr ACK 6cebac5 |
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
May 25, 2021
… mode 6cebac5 test: MiniWallet: introduce enum type for output mode (Sebastian Falbesoner) Pull request description: This is a follow-up PR to bitcoin#21945 which lifted the number of MiniWallet's tx output modes from 2 to 3 (by adding P2PK Support). Since the current way of specifying the mode on the ctor via two booleans is ugly and error-prone (see table in comment bitcoin#21945 (comment)), a new Enum type `MiniWalletMode` is introduced that can hold the following values: - ADDRESS_OP_TRUE - RAW_OP_TRUE - RAW_P2PK Also adds documentation that should guide the user on which mode is useful for what etc. with a summary table. (Can also be split up in a separate commit or shortened if that is desired, maybe it's considered to be too verbose). ACKs for top commit: MarcoFalke: cr ACK 6cebac5 Tree-SHA512: cbbc10806d9d9e62829548094415e9f1a281cd247b9a9fc7f7f33b923c723aa03e7bc3024623a77fb1f7da4d73455fa8244840f746980d32acdad97ee12100da
gwillen
pushed a commit
to ElementsProject/elements
that referenced
this pull request
Jun 1, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a follow-up PR to #21945 which lifted the number of MiniWallet's tx output modes from 2 to 3 (by adding P2PK Support).
Since the current way of specifying the mode on the ctor via two booleans is ugly and error-prone (see table in comment #21945 (comment)), a new Enum type
MiniWalletModeis introduced that can hold the following values:Also adds documentation that should guide the user on which mode is useful for what etc. with a summary table. (Can also be split up in a separate commit or shortened if that is desired, maybe it's considered to be too verbose).