aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAva Chow <github@achow101.com>2024-01-02 11:26:15 -0500
committerAva Chow <github@achow101.com>2024-01-02 11:33:29 -0500
commitc3038bf95a4b9926001abb8a172f3d734f8e17ba (patch)
tree2e32248d845a2d2db90ea61ef69f2bc086b8bfda /src
parent00bf4a171115844b53e5c955d93be8505ad787bb (diff)
parente03d6f7ed534f423f58236866f8e83beee1871e1 (diff)
Merge bitcoin/bitcoin#29076: fuzz: set `m_fallback_fee` and `m_fee_mode` in `wallet_fees` target
e03d6f7ed534f423f58236866f8e83beee1871e1 fuzz: set `m_fallback_fee`/`m_fee_mode` in `wallet_fees` target (brunoerg) Pull request description: `m_fallback_fee` and `m_fee_mode` are used in `GetMinimumFeeRate` but we're not setting any value for them in `wallet_fees` target. That's the reason fuzzing is never reaching the following code: ![Screenshot 2023-12-13 at 15 04 30](https://github.com/bitcoin/bitcoin/assets/19480819/454ddcaa-75ca-452f-ad13-5f142de0bdce) This PR fixes it. ACKs for top commit: maflcko: review ACK e03d6f7ed534f423f58236866f8e83beee1871e1 achow101: ACK e03d6f7ed534f423f58236866f8e83beee1871e1 murchandamus: ACK e03d6f7ed534f423f58236866f8e83beee1871e1 Tree-SHA512: 5d364f5351d65762a3ddf88e3abb7bda401b7e4955285e083031d216fb50082b1ea98e2c065aff75a5a8a3d1bc4c2e5e3ca9f9478d902ee8f8d4347b6cbe53af
Diffstat (limited to 'src')
-rw-r--r--src/wallet/test/fuzz/fees.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wallet/test/fuzz/fees.cpp b/src/wallet/test/fuzz/fees.cpp
index 2f7892dc0a..c2e785651a 100644
--- a/src/wallet/test/fuzz/fees.cpp
+++ b/src/wallet/test/fuzz/fees.cpp
@@ -37,6 +37,10 @@ FUZZ_TARGET(wallet_fees, .init = initialize_setup)
}
if (fuzzed_data_provider.ConsumeBool()) {
+ wallet.m_fallback_fee = CFeeRate{ConsumeMoney(fuzzed_data_provider, /*max=*/COIN)};
+ }
+
+ if (fuzzed_data_provider.ConsumeBool()) {
wallet.m_discard_rate = CFeeRate{ConsumeMoney(fuzzed_data_provider, /*max=*/COIN)};
}
(void)GetDiscardRate(wallet);
@@ -58,6 +62,9 @@ FUZZ_TARGET(wallet_fees, .init = initialize_setup)
if (fuzzed_data_provider.ConsumeBool()) {
coin_control.m_confirm_target = fuzzed_data_provider.ConsumeIntegralInRange<unsigned int>(0, 999'000);
}
+ if (fuzzed_data_provider.ConsumeBool()) {
+ coin_control.m_fee_mode = fuzzed_data_provider.ConsumeBool() ? FeeEstimateMode::CONSERVATIVE : FeeEstimateMode::ECONOMICAL;
+ }
FeeCalculation fee_calculation;
FeeCalculation* maybe_fee_calculation{fuzzed_data_provider.ConsumeBool() ? nullptr : &fee_calculation};