23 const unsigned int n_in = fuzzed_data_provider.
ConsumeIntegral<
unsigned int>();
32 std::vector<UTXO> spent_outputs;
33 std::vector<std::vector<unsigned char>> spent_spks;
35 spent_outputs.reserve(n_in);
36 spent_spks.reserve(n_in);
37 for (
size_t i = 0; i < n_in; ++i) {
40 const auto spk_size{
static_cast<unsigned>(spent_spks.back().size())};
41 spent_outputs.push_back({.scriptPubKey = spent_spks.back().data(), .scriptPubKeySize = spk_size, .value = value});
45 const auto spent_outs_size{
static_cast<unsigned>(spent_outputs.size())};
48 random_bytes_1.data(), random_bytes_1.size(), money, random_bytes_2.data(), random_bytes_2.size(),
49 spent_outputs.data(), spent_outs_size, n_in,
flags, err_p);
int64_t CAmount
Amount in satoshis (Can be negative)
unsigned int bitcoinconsensus_version()
int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, const unsigned char *txTo, unsigned int txToLen, unsigned int nIn, unsigned int flags, bitcoinconsensus_error *err)
Returns 1 if the input nIn of the serialized transaction pointed to by txTo correctly spends the scri...
int bitcoinconsensus_verify_script_with_amount(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, int64_t amount, const unsigned char *txTo, unsigned int txToLen, unsigned int nIn, unsigned int flags, bitcoinconsensus_error *err)
int bitcoinconsensus_verify_script_with_spent_outputs(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, int64_t amount, const unsigned char *txTo, unsigned int txToLen, const UTXO *spentOutputs, unsigned int spentOutputsLen, unsigned int nIn, unsigned int flags, bitcoinconsensus_error *err)
enum bitcoinconsensus_error_t bitcoinconsensus_error
#define BITCOINCONSENSUS_API_VER
FUZZ_TARGET(script_bitcoin_consensus)
CAmount ConsumeMoney(FuzzedDataProvider &fuzzed_data_provider, const std::optional< CAmount > &max) noexcept
std::vector< B > ConsumeRandomLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept