Skip to content

Commit 47ee866

Browse files
fanquakevijaydasmp
authored andcommitted
Merge bitcoin#28825: fuzz: Minor improvements to tx_package_eval target
6a91791 fuzz: allow fake and duplicate inputs in tx_package_eval target (Greg Sanders) a0626cc fuzz: allow reaching MempoolAcceptResult::ResultType::DIFFERENT_WITNESS in tx_package_eval target (Greg Sanders) Pull request description: Exercises `DIFFERENT_WITNESS` by using "blank" WSH() and allowing witness to determine wtxid, and attempts to make invalid/duplicate inputs. ACKs for top commit: dergoegge: Coverage looks good to me ACK 6a91791 Tree-SHA512: db894f5f5b81c6b454874baf11f296462832285f41ccb09f23c0db92b9abc98f8ecacd72fc8f60dc92cb7947f543a2e55bed2fd210b0e8ca7c7d5389d90b14af
1 parent c0eb3c9 commit 47ee866

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/test/util/script.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ static const CScript P2SH_OP_TRUE{
1616
<< ToByteVector(CScriptID{CScript{} << OP_TRUE})
1717
<< OP_EQUAL};
1818

19+
static const std::vector<uint8_t> EMPTY{};
20+
static const CScript P2WSH_EMPTY{
21+
CScript{}
22+
<< OP_0
23+
<< ToByteVector([] {
24+
uint256 hash;
25+
CSHA256().Write(EMPTY.data(), EMPTY.size()).Finalize(hash.begin());
26+
return hash;
27+
}())};
28+
static const std::vector<std::vector<uint8_t>> P2WSH_EMPTY_TRUE_STACK{{static_cast<uint8_t>(OP_TRUE)}, {}};
29+
static const std::vector<std::vector<uint8_t>> P2WSH_EMPTY_TWO_STACK{{static_cast<uint8_t>(OP_2)}, {}};
30+
1931
/** Flags that are not forbidden by an assert in script validation */
2032
bool IsValidFlagCombination(unsigned flags);
2133

0 commit comments

Comments
 (0)