16 bool CastToBool(
const std::vector<unsigned char>& vch);
23 const std::optional<CMutableTransaction> mtx = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider,
TX_WITH_WITNESS);
26 const unsigned int in = fuzzed_data_provider.ConsumeIntegral<
unsigned int>();
27 if (in < tx_to.vin.size()) {
28 auto n_hash_type = fuzzed_data_provider.ConsumeIntegral<
int>();
31 (void)
SignatureHash(script_code, tx_to, in, n_hash_type, amount, sigversion,
nullptr);
32 const std::optional<CMutableTransaction> mtx_precomputed = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider,
TX_WITH_WITNESS);
33 if (mtx_precomputed) {
36 n_hash_type = fuzzed_data_provider.ConsumeIntegral<
int>();
39 (void)
SignatureHash(script_code, tx_to, in, n_hash_type, amount, sigversion, &precomputed_transaction_data);
Witness v0 (P2WPKH and P2WSH); see BIP 141.
bool CastToBool(const std::vector< unsigned char > &vch)
CScript ConsumeScript(FuzzedDataProvider &fuzzed_data_provider, const bool maybe_p2wsh) noexcept
Bare scripts and BIP16 P2SH-wrapped redeemscripts.
std::vector< B > ConsumeRandomLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept
FUZZ_TARGET(script_interpreter)
Serialized script, used inside transaction inputs and outputs.
CAmount ConsumeMoney(FuzzedDataProvider &fuzzed_data_provider, const std::optional< CAmount > &max) noexcept
uint256 SignatureHash(const CScript &scriptCode, const T &txTo, unsigned int nIn, int32_t nHashType, const CAmount &amount, SigVersion sigversion, const PrecomputedTransactionData *cache)
The basic transaction that is broadcasted on the network and contained in blocks. ...
static constexpr TransactionSerParams TX_WITH_WITNESS