test: refactor: add script_util helper for creating bare multisig scripts#23305
Merged
maflcko merged 1 commit intobitcoin:masterfrom Oct 27, 2021
Merged
Conversation
Contributor
|
Concept ACK The canonical bare multisig construction in |
maflcko
reviewed
Oct 19, 2021
31ca61b to
61cf9ac
Compare
Contributor
Author
|
Rebased on master and changed threshold parameter name from "m" to "k", to match the optech style guide (as suggested by MarcoFalke). |
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
61cf9ac to
4718897
Compare
Contributor
Author
|
Rebased on master. |
shaavan
approved these changes
Oct 26, 2021
Contributor
shaavan
left a comment
There was a problem hiding this comment.
utACK 4718897
This PR declares a new helper function keys_to_multisig_script in the file script_util.py, which serves two purposes:
- Helps simplify the code; each time, a bare multisig script needs to be created.
- Reduce the number of times different files have to import
CScriptandOP_CHECKMULTISIGas dependencies.
Contributor
rajarshimaitra
left a comment
There was a problem hiding this comment.
tACK 4718897
Verified that no other bare multisig cases exists.
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
Oct 27, 2021
…ating bare multisig scripts 4718897 test: add script_util helper for creating bare multisig scripts (Sebastian Falbesoner) Pull request description: This PR is a follow-up to bitcoin#22363 and bitcoin#23118 and introduces a helper `keys_to_multisig_script` for creating bare multisig outputs in the form of ``` OP_K PubKey1 PubKey2 ... PubKeyN OP_N OP_CHECKMULTISIG ``` The function takes a list of pubkeys (both hex- and byte-strings are accepted due to the `script_util.check_key` helper being used internally) and optionally a threshold _k_. If no threshold is passed, a n-of-n multisig output is created, with _n_ being the number of passed pubkeys. ACKs for top commit: shaavan: utACK 4718897 rajarshimaitra: tACK bitcoin@4718897 Tree-SHA512: b452d8a75b0d17316b66ac4ed4c6893fe59c7c417719931d4cd3955161f59afca43503cd09b83a35b5a252a122eb3f0fbb9da9f0e7c944cf8da572a02219ed9d
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 PR is a follow-up to #22363 and #23118 and introduces a helper
keys_to_multisig_scriptfor creating bare multisig outputs in the form ofThe function takes a list of pubkeys (both hex- and byte-strings are accepted due to the
script_util.check_keyhelper being used internally) and optionally a threshold k. If no threshold is passed, a n-of-n multisig output is created, with n being the number of passed pubkeys.