aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/test')
-rw-r--r--src/wallet/test/fuzz/fees.cpp7
-rw-r--r--src/wallet/test/ismine_tests.cpp3
-rw-r--r--src/wallet/test/wallet_tests.cpp12
3 files changed, 12 insertions, 10 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};
diff --git a/src/wallet/test/ismine_tests.cpp b/src/wallet/test/ismine_tests.cpp
index 95d5c1b9ce..dfad0e2126 100644
--- a/src/wallet/test/ismine_tests.cpp
+++ b/src/wallet/test/ismine_tests.cpp
@@ -47,8 +47,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
pubkeys[i] = keys[i].GetPubKey();
}
- CKey uncompressedKey;
- uncompressedKey.MakeNewKey(false);
+ CKey uncompressedKey = GenerateRandomKey(/*compressed=*/false);
CPubKey uncompressedPubkey = uncompressedKey.GetPubKey();
std::unique_ptr<interfaces::Chain>& chain = m_node.chain;
diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp
index 1c5ca1483f..65297054df 100644
--- a/src/wallet/test/wallet_tests.cpp
+++ b/src/wallet/test/wallet_tests.cpp
@@ -231,8 +231,7 @@ BOOST_FIXTURE_TEST_CASE(importmulti_rescan, TestChain100Setup)
keys.push_back(key);
key.clear();
key.setObject();
- CKey futureKey;
- futureKey.MakeNewKey(true);
+ CKey futureKey = GenerateRandomKey();
key.pushKV("scriptPubKey", HexStr(GetScriptForRawPubKey(futureKey.GetPubKey())));
key.pushKV("timestamp", newTip->GetBlockTimeMax() + TIMESTAMP_WINDOW + 1);
key.pushKV("internal", UniValue(true));
@@ -704,8 +703,7 @@ BOOST_FIXTURE_TEST_CASE(wallet_disableprivkeys, TestChain100Setup)
static size_t CalculateNestedKeyhashInputSize(bool use_max_sig)
{
// Generate ephemeral valid pubkey
- CKey key;
- key.MakeNewKey(true);
+ CKey key = GenerateRandomKey();
CPubKey pubkey = key.GetPubKey();
// Generate pubkey hash
@@ -789,8 +787,7 @@ BOOST_FIXTURE_TEST_CASE(CreateWallet, TestChain100Setup)
context.args = &m_args;
context.chain = m_node.chain.get();
auto wallet = TestLoadWallet(context);
- CKey key;
- key.MakeNewKey(true);
+ CKey key = GenerateRandomKey();
AddKey(*wallet, key);
TestUnloadWallet(std::move(wallet));
@@ -898,8 +895,7 @@ BOOST_FIXTURE_TEST_CASE(ZapSelectTx, TestChain100Setup)
context.args = &m_args;
context.chain = m_node.chain.get();
auto wallet = TestLoadWallet(context);
- CKey key;
- key.MakeNewKey(true);
+ CKey key = GenerateRandomKey();
AddKey(*wallet, key);
std::string error;