Approaches another missing unit test of issue #17394: Checks that the function IsStandardTx() returns rejection reason "bare-multisig" if any one of the outputs' scriptPubKey has bare multisignature format (i.e. M <PubKey1> <PubKey2> ... <PubKeyN> N OP_CHECKSIG, not P2SH!) and the policy flag fIsBareMultisigStd is set to false.
test: add unit test for non-standard bare multisig txs #17502
pull theStack wants to merge 1 commits into bitcoin:master from theStack:20191118-test_check-for-non-standard-txs-bare-multisig changing 1 files +11 −0-
theStack commented at 2:37 AM on November 18, 2019: member
- fanquake added the label Tests on Nov 18, 2019
- fanquake requested review from instagibbs on Nov 20, 2019
-
instagibbs commented at 1:51 PM on November 21, 2019: member
huh,
permitbaremultisighas no tests either, good you're working through these. -
in src/test/transaction_tests.cpp:803 in ac9da052ab outdated
796 | @@ -797,6 +797,17 @@ BOOST_AUTO_TEST_CASE(test_IsStandard) 797 | reason.clear(); 798 | BOOST_CHECK(!IsStandardTx(CTransaction(t), reason)); 799 | BOOST_CHECK_EQUAL(reason, "scriptsig-size"); 800 | + 801 | + // Check bare multisig (standard if policy flag fIsBareMultisigStd is set) 802 | + fIsBareMultisigStd = true; 803 | + t.vout[0].scriptPubKey = GetScriptForMultisig(2, std::vector<CPubKey>(3, key.GetPubKey())); // 2-of-3
instagibbs commented at 1:52 PM on November 21, 2019:For this test I think you should do the simplest base case to make it trivially certain you're not hitting some size-based restriction(as I recall, naked multisigs increase virtual size of transactions during relay....)
so just make a 1-of-1 multisig
theStack commented at 3:06 PM on November 21, 2019:Done, thanks for reviewing.
1bb5d517aatest: add unit test for non-standard bare multisig txs
The function IsStandardTx() returns rejection reason "bare-multisig" if the transaction has a bare multisig output and the policy flag fIsBareMultisigStd is false (set by the boolean command-line argument "-permitbaremultisig" -- for the unit test, we simply set the global flag variable directly).
theStack force-pushed on Nov 21, 2019instagibbs commented at 3:12 PM on November 21, 2019: memberfanquake requested review from MarcoFalke on Nov 21, 2019DrahtBot commented at 12:00 PM on November 23, 2019: member<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #17570 (test: add unit test for non-standard txs w/ too large tx size by KaanKC)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
MarcoFalke referenced this in commit ea756bc48c on Dec 10, 2019MarcoFalke merged this on Dec 10, 2019MarcoFalke closed this on Dec 10, 2019sidhujag referenced this in commit 67c61e5a9a on Dec 10, 2019MarcoFalke referenced this in commit ec9b964cc9 on Jan 16, 2020sidhujag referenced this in commit 6f3eaef555 on Jan 17, 2020MarcoFalke referenced this in commit 0130abbdb7 on Jan 30, 2020deadalnix referenced this in commit 0fb36f0811 on Nov 7, 2020sidhujag referenced this in commit c4127b0278 on Nov 10, 2020sidhujag referenced this in commit 348d49416b on Nov 10, 2020theStack deleted the branch on Dec 1, 2020DrahtBot locked this on Feb 15, 2022
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-30 21:14 UTC
More mirrored repositories can be found on mirror.b10c.me