[test] Check for invalid flag combinations

This commit is contained in:
gzhao408 committed 2021-02-02 09:17:58 -08:00
1 parent a7098a2a8d
commit a260c22cad
1 file changed
+5
+5
View File
@@ -222,6 +222,11 @@ BOOST_AUTO_TEST_CASE(tx_valid)
PrecomputedTransactionData txdata(tx);
unsigned int verify_flags = ParseScriptFlags(test[2].get_str());
// Check that the test gives a valid combination of flags (otherwise VerifyScript will throw). Don't edit the flags.
if (~verify_flags != FillFlags(~verify_flags)) {
BOOST_ERROR("Bad test flags: " << strTest);
}
if (!CheckTxScripts(tx, mapprevOutScriptPubKeys, mapprevOutValues, ~verify_flags, txdata, strTest, /* expect_valid */ true)) {
BOOST_ERROR("Tx unexpectedly failed: " << strTest);
}