diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-04-17 13:27:02 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-04-17 14:20:44 -0400 |
commit | fad7c33342cb51b310a7dd372bfa675df8810367 (patch) | |
tree | 64bc06d2bdd76ca1dc13d9be5a28d6462e07e990 /src/bench | |
parent | fa46ac3127142358116c8473741708b3bb70ca15 (diff) |
refactor: Add handleNotifications method to wallet
Further stylistic cleanups in touched files:
* Sort the includes
* Wrap long single-line constructors into multiple lines
Diffstat (limited to 'src/bench')
-rw-r--r-- | src/bench/wallet_balance.cpp | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/bench/wallet_balance.cpp b/src/bench/wallet_balance.cpp index 7fd2794164..46ca12826b 100644 --- a/src/bench/wallet_balance.cpp +++ b/src/bench/wallet_balance.cpp @@ -10,31 +10,16 @@ #include <validationinterface.h> #include <wallet/wallet.h> -struct WalletTestingSetup { - std::unique_ptr<interfaces::Chain> m_chain = interfaces::MakeChain(); - CWallet m_wallet; - - WalletTestingSetup() - : m_wallet{m_chain.get(), WalletLocation(), WalletDatabase::CreateMock()} - { - } - - void handleNotifications() - { - m_wallet.m_chain_notifications_handler = m_chain->handleNotifications(m_wallet); - } -}; - static void WalletBalance(benchmark::State& state, const bool set_dirty, const bool add_watchonly, const bool add_mine) { const auto& ADDRESS_WATCHONLY = ADDRESS_BCRT1_UNSPENDABLE; - WalletTestingSetup wallet_t{}; - auto& wallet = wallet_t.m_wallet; + std::unique_ptr<interfaces::Chain> chain = interfaces::MakeChain(); + CWallet wallet{chain.get(), WalletLocation(), WalletDatabase::CreateMock()}; { bool first_run; if (wallet.LoadWallet(first_run) != DBErrors::LOAD_OK) assert(false); - wallet_t.handleNotifications(); + wallet.handleNotifications(); } |