mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 10:19:26 +02:00
5cf0a1f230
test: add `createmultisig` P2MS encoding test for all n (1..20) (Sebastian Falbesoner)0570d2c204
test: add unit test for `keys_to_multisig_script` (Sebastian Falbesoner)0c41fc3fa5
test: fix `keys_to_multisig_script` (P2MS) helper for n/k > 16 (Sebastian Falbesoner) Pull request description: While reviewing #28307, I noticed that the test framework's `key_to_multisig_script` helper (introduced in #23305) is broken for pubkey count (n) and threshold (k) values larger than 16. This is due to the implementation currently enforcing a direct single-byte data push (using `CScriptOp.encode_op_n`), which obviously fails for values 17+. Fix that by passing the numbers directly to the CScript list, where it's automatically converted to minimally-encoded pushes (see class method `CScript.__coerce_instance`, branch `isinstance(other, int)`). The second commit adds a unit test to ensure that the encoding is correct. ACKs for top commit: achow101: ACK5cf0a1f230
tdb3: ACK5cf0a1f230
rkrux: reACK [5cf0a1f
](5cf0a1f230
) Tree-SHA512: 4168a165c3f483ec8e37a27dba1628a7ea0063545a2b7e74d9e20d753fddd7e33d37e1a190434fa6dca39adf9eef5d0211f7a0c1c7b44979f0a3bb350e267562