17void initialize_coincontrol()
23FUZZ_TARGET(coincontrol, .init = initialize_coincontrol)
25 FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
27 ArgsManager&
args = *node.args;
30 args.
ForceSetArg(
"-avoidpartialspends", fuzzed_data_provider.ConsumeBool()?
"1":
"0");
41 if (!optional_out_point) {
44 out_point = *optional_out_point;
59 (void)coin_control.
Select(out_point);
66 (void)coin_control.
UnSelect(out_point);
75 int64_t weight{fuzzed_data_provider.ConsumeIntegral<int64_t>()};
const TestingSetup * g_setup
void ForceSetArg(const std::string &strArg, const std::string &strValue)
bool IsSelected(const COutPoint &outpoint) const
Returns true if the given output is pre-selected.
std::optional< CTxOut > GetExternalOutput(const COutPoint &outpoint) const
Returns the external output for the given outpoint if it exists.
std::optional< int64_t > GetInputWeight(const COutPoint &outpoint) const
Returns the input weight.
void UnSelectAll()
Unselects all outputs.
void UnSelect(const COutPoint &outpoint)
Unselects the given output.
PreselectedInput & Select(const COutPoint &outpoint)
Lock-in the given output for spending.
bool HasSelected() const
Returns true if there are pre-selected inputs.
bool IsExternalSelected(const COutPoint &outpoint) const
Returns true if the given output is selected as an external input.
void SetInputWeight(const COutPoint &outpoint, int64_t weight)
Set an input's weight.
std::vector< COutPoint > ListSelected() const
List the selected inputs.
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
std::unique_ptr< T > MakeNoLogFileContext(const ChainType chain_type=ChainType::REGTEST, TestOpts opts={})
Make a test setup that has disk access to the debug.log file disabled.
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)
std::optional< T > ConsumeDeserializable(FuzzedDataProvider &fuzzed_data_provider, const P ¶ms, const std::optional< size_t > &max_length=std::nullopt) noexcept