Skip to content

Commit efaf80e

Browse files
committed
fuzz: check that certain script TxoutType are nonstandard
1 parent 43fc7a5 commit efaf80e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/test/fuzz/script.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,15 @@ FUZZ_TARGET_INIT(script, initialize_script)
7171
(void)IsSolvable(signing_provider, script);
7272

7373
TxoutType which_type;
74-
(void)IsStandard(script, which_type);
74+
bool is_standard_ret = IsStandard(script, which_type);
75+
if (!is_standard_ret) {
76+
assert(which_type == TxoutType::NONSTANDARD ||
77+
which_type == TxoutType::NULL_DATA ||
78+
which_type == TxoutType::MULTISIG);
79+
}
80+
if (which_type == TxoutType::NONSTANDARD) {
81+
assert(!is_standard_ret);
82+
}
7583
if (which_type == TxoutType::NULL_DATA) {
7684
assert(script.IsUnspendable());
7785
}

0 commit comments

Comments
 (0)