diff options
author | brunoerg <brunoely.gc@gmail.com> | 2023-11-07 10:44:25 -0300 |
---|---|---|
committer | brunoerg <brunoely.gc@gmail.com> | 2023-11-20 15:57:56 -0300 |
commit | 641dddf01812407d163520def83f5975413691e4 (patch) | |
tree | fc1f51d2c5e901627dff2456ab9e2edafd2f48f4 /src/test/fuzz/script_sign.cpp | |
parent | 2e1833ca1341ab4dc92508a59181aa6c7c38db88 (diff) |
fuzz: create ConsumeCoins
Diffstat (limited to 'src/test/fuzz/script_sign.cpp')
-rw-r--r-- | src/test/fuzz/script_sign.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/test/fuzz/script_sign.cpp b/src/test/fuzz/script_sign.cpp index 0944c91c4a..9c2966e0cb 100644 --- a/src/test/fuzz/script_sign.cpp +++ b/src/test/fuzz/script_sign.cpp @@ -125,18 +125,7 @@ FUZZ_TARGET(script_sign, .init = initialize_script_sign) } (void)signature_creator.CreateSig(provider, vch_sig, address, ConsumeScript(fuzzed_data_provider), fuzzed_data_provider.PickValueInArray({SigVersion::BASE, SigVersion::WITNESS_V0})); } - std::map<COutPoint, Coin> coins; - LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 10000) { - const std::optional<COutPoint> outpoint = ConsumeDeserializable<COutPoint>(fuzzed_data_provider); - if (!outpoint) { - break; - } - const std::optional<Coin> coin = ConsumeDeserializable<Coin>(fuzzed_data_provider); - if (!coin) { - break; - } - coins[*outpoint] = *coin; - } + std::map<COutPoint, Coin> coins{ConsumeCoins(fuzzed_data_provider)}; std::map<int, bilingual_str> input_errors; (void)SignTransaction(sign_transaction_tx_to, &provider, coins, fuzzed_data_provider.ConsumeIntegral<int>(), input_errors); } |