17void initialize_coincontrol()
19 static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>();
20 g_setup = testing_setup.get();
30 args.
ForceSetArg(
"-avoidpartialspends", fuzzed_data_provider.ConsumeBool()?
"1":
"0");
32 CCoinControl coin_control;
40 std::optional<COutPoint> optional_out_point = ConsumeDeserializable<COutPoint>(fuzzed_data_provider);
41 if (!optional_out_point) {
44 out_point = *optional_out_point;
47 (void)coin_control.HasSelected();
50 (void)coin_control.IsSelected(out_point);
53 (void)coin_control.IsExternalSelected(out_point);
56 (void)coin_control.GetExternalOutput(out_point);
59 (void)coin_control.Select(out_point);
63 (void)coin_control.Select(out_point).SetTxOut(tx_out);
66 (void)coin_control.UnSelect(out_point);
69 (void)coin_control.UnSelectAll();
72 (void)coin_control.ListSelected();
75 int64_t weight{fuzzed_data_provider.ConsumeIntegral<int64_t>()};
76 (void)coin_control.SetInputWeight(out_point, weight);
79 (void)coin_control.GetInputWeight(out_point);
void ForceSetArg(const std::string &strArg, const std::string &strValue)
An outpoint - a combination of a transaction hash and an index n into its vout.
An output of a transaction.
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
FUZZ_TARGET(coin_grinder)
Testing setup that configures a complete environment.
CScript ConsumeScript(FuzzedDataProvider &fuzzed_data_provider, const bool maybe_p2wsh) noexcept
CAmount ConsumeMoney(FuzzedDataProvider &fuzzed_data_provider, const std::optional< CAmount > &max) noexcept
size_t CallOneOf(FuzzedDataProvider &fuzzed_data_provider, Callables... callables)