aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-01-03 18:28:43 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-01-03 18:28:45 +0100
commit2dab2d239a4777b5ffd59a94a8eebd8638644e6c (patch)
tree0e70ce53a8a17446f7fa7e8504b2e1808a545b5f
parent6e70674cda65d873de5b26f473b38871ccd4d412 (diff)
parentefaf80e9bb0afeca2955720bfe6c225d7864036b (diff)
downloadbitcoin-2dab2d239a4777b5ffd59a94a8eebd8638644e6c.tar.xz
Merge #20765: fuzz: check that certain script TxoutType are nonstandard
efaf80e9bb0afeca2955720bfe6c225d7864036b fuzz: check that certain script TxoutType are nonstandard (Michael Dietz) Pull request description: - Every transaction of type NONSTANDARD must not be a standard script - The only know types of nonstandard scripts are NONSTANDARD and certain NULL_DATA and MULTISIG scripts When reviewing https://github.com/bitcoin/bitcoin/pull/20761 I figured this is very similar and might also be good to have ACKs for top commit: MarcoFalke: ACK efaf80e9bb0afeca2955720bfe6c225d7864036b Tree-SHA512: 6f563ee3104ea9d2633aad95f1d003474bea759d0f22636c37aa91b5536a6ff0800c42447285ca8ed12f1b3699bf781dae1e5e0a3362da578749cd3164a06ea4
-rw-r--r--src/test/fuzz/script.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/test/fuzz/script.cpp b/src/test/fuzz/script.cpp
index f43689290a..d883426c81 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());
}