fuzz: set mempool options in wallet_fees
This commit is contained in:
1 parent
d31dc8f818
commit
19273d0705
1 file changed
+11
-3
@@ -14,11 +14,11 @@
|
|||||||
|
|
||||||
namespace wallet {
|
namespace wallet {
|
||||||
namespace {
|
namespace {
|
||||||
const TestingSetup* g_setup;
|
TestingSetup* g_setup;
|
||||||
|
|
||||||
void initialize_setup()
|
void initialize_setup()
|
||||||
{
|
{
|
||||||
static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>();
|
static const auto testing_setup = MakeNoLogFileContext<TestingSetup>();
|
||||||
g_setup = testing_setup.get();
|
g_setup = testing_setup.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,8 +27,16 @@ FUZZ_TARGET(wallet_fees, .init = initialize_setup)
|
|||||||
SeedRandomStateForTest(SeedRand::ZEROS);
|
SeedRandomStateForTest(SeedRand::ZEROS);
|
||||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||||
SetMockTime(ConsumeTime(fuzzed_data_provider));
|
SetMockTime(ConsumeTime(fuzzed_data_provider));
|
||||||
const auto& node{g_setup->m_node};
|
auto& node{g_setup->m_node};
|
||||||
Chainstate* chainstate = &node.chainman->ActiveChainstate();
|
Chainstate* chainstate = &node.chainman->ActiveChainstate();
|
||||||
|
|
||||||
|
bilingual_str error;
|
||||||
|
CTxMemPool::Options mempool_opts{
|
||||||
|
.incremental_relay_feerate = CFeeRate{ConsumeMoney(fuzzed_data_provider, 1'000'000)},
|
||||||
|
.min_relay_feerate = CFeeRate{ConsumeMoney(fuzzed_data_provider, 1'000'000)},
|
||||||
|
.dust_relay_feerate = CFeeRate{ConsumeMoney(fuzzed_data_provider, 1'000'000)}
|
||||||
|
};
|
||||||
|
node.mempool = std::make_unique<CTxMemPool>(mempool_opts, error);
|
||||||
std::unique_ptr<CWallet> wallet_ptr{std::make_unique<CWallet>(node.chain.get(), "", CreateMockableWalletDatabase())};
|
std::unique_ptr<CWallet> wallet_ptr{std::make_unique<CWallet>(node.chain.get(), "", CreateMockableWalletDatabase())};
|
||||||
CWallet& wallet{*wallet_ptr};
|
CWallet& wallet{*wallet_ptr};
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user