aboutsummaryrefslogtreecommitdiff
path: root/src/bench/wallet_balance.cpp
diff options
context:
space:
mode:
authorAndrew Chow <github@achow101.com>2023-05-25 14:06:21 -0400
committerAndrew Chow <github@achow101.com>2023-05-25 14:40:26 -0400
commitc61d3f02f5122b38ea8bf0029aa9dfbbf38e10d0 (patch)
tree5cf8152ce5f1e625619cdfada6332ad7488a8ad0 /src/bench/wallet_balance.cpp
parent25202cace9140870c75cb3a811e10045df88c226 (diff)
tests, bench: Consolidate {Test,Bench}Un/LoadWallet helper
The wallet tests and benchmarks both had helper functions for loading and unloading the wallet for the test that were almost identical. These functions are consolidated and reused.
Diffstat (limited to 'src/bench/wallet_balance.cpp')
-rw-r--r--src/bench/wallet_balance.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/bench/wallet_balance.cpp b/src/bench/wallet_balance.cpp
index 2c77b9b22b..099ef1635a 100644
--- a/src/bench/wallet_balance.cpp
+++ b/src/bench/wallet_balance.cpp
@@ -14,14 +14,9 @@
#include <optional>
-using wallet::CWallet;
-using wallet::CreateMockableWalletDatabase;
-using wallet::DBErrors;
-using wallet::GetBalance;
-using wallet::WALLET_FLAG_DESCRIPTORS;
-
const std::string ADDRESS_BCRT1_UNSPENDABLE = "bcrt1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3xueyj";
+namespace wallet {
static void WalletBalance(benchmark::Bench& bench, const bool set_dirty, const bool add_mine)
{
const auto test_setup = MakeNoLogFileContext<const TestingSetup>();
@@ -63,3 +58,4 @@ BENCHMARK(WalletBalanceDirty, benchmark::PriorityLevel::HIGH);
BENCHMARK(WalletBalanceClean, benchmark::PriorityLevel::HIGH);
BENCHMARK(WalletBalanceMine, benchmark::PriorityLevel::HIGH);
BENCHMARK(WalletBalanceWatch, benchmark::PriorityLevel::HIGH);
+} // namespace wallet