aboutsummaryrefslogtreecommitdiff
path: root/src/test/util
diff options
context:
space:
mode:
authorGreg Sanders <gsanders87@gmail.com>2023-09-28 09:04:01 -0400
committerGreg Sanders <gsanders87@gmail.com>2023-11-09 09:07:03 -0500
commita0626ccdadc0e965dc818d8a7c862e8c81b54fd1 (patch)
tree83a31157cdfb4c09a47792981d06d0033cf5be96 /src/test/util
parent21d985784f01280ec28429288e36397fcc842af8 (diff)
fuzz: allow reaching MempoolAcceptResult::ResultType::DIFFERENT_WITNESS in tx_package_eval target
Diffstat (limited to 'src/test/util')
-rw-r--r--src/test/util/script.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/util/script.h b/src/test/util/script.h
index 428b3e10b3..96c4d55e5a 100644
--- a/src/test/util/script.h
+++ b/src/test/util/script.h
@@ -18,6 +18,18 @@ static const CScript P2WSH_OP_TRUE{
return hash;
}())};
+static const std::vector<uint8_t> EMPTY{};
+static const CScript P2WSH_EMPTY{
+ CScript{}
+ << OP_0
+ << ToByteVector([] {
+ uint256 hash;
+ CSHA256().Write(EMPTY.data(), EMPTY.size()).Finalize(hash.begin());
+ return hash;
+ }())};
+static const std::vector<std::vector<uint8_t>> P2WSH_EMPTY_TRUE_STACK{{static_cast<uint8_t>(OP_TRUE)}, {}};
+static const std::vector<std::vector<uint8_t>> P2WSH_EMPTY_TWO_STACK{{static_cast<uint8_t>(OP_2)}, {}};
+
/** Flags that are not forbidden by an assert in script validation */
bool IsValidFlagCombination(unsigned flags);