From efaf80e9bb0afeca2955720bfe6c225d7864036b Mon Sep 17 00:00:00 2001 From: Michael Dietz Date: Thu, 24 Dec 2020 13:48:30 -0600 Subject: [PATCH] fuzz: check that certain script TxoutType are nonstandard --- src/test/fuzz/script.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/test/fuzz/script.cpp b/src/test/fuzz/script.cpp index f43689290a7..d883426c81c 100644 --- a/src/test/fuzz/script.cpp +++ b/src/test/fuzz/script.cpp @@ -71,7 +71,15 @@ FUZZ_TARGET_INIT(script, initialize_script) (void)IsSolvable(signing_provider, script); TxoutType which_type; - (void)IsStandard(script, which_type); + bool is_standard_ret = IsStandard(script, which_type); + if (!is_standard_ret) { + assert(which_type == TxoutType::NONSTANDARD || + which_type == TxoutType::NULL_DATA || + which_type == TxoutType::MULTISIG); + } + if (which_type == TxoutType::NONSTANDARD) { + assert(!is_standard_ret); + } if (which_type == TxoutType::NULL_DATA) { assert(script.IsUnspendable()); }