Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/test/wallet_tests.cpp
Show First 20 Lines • Show All 801 Lines • ▼ Show 20 Lines | BOOST_FIXTURE_TEST_CASE(CreateWalletFromFile, TestChain100Setup) { | ||||
// Reload wallet and make sure new transactions are detected despite events | // Reload wallet and make sure new transactions are detected despite events | ||||
// being blocked | // being blocked | ||||
wallet = TestLoadWallet(*chain); | wallet = TestLoadWallet(*chain); | ||||
BOOST_CHECK(rescan_completed); | BOOST_CHECK(rescan_completed); | ||||
BOOST_CHECK_EQUAL(addtx_count, 2); | BOOST_CHECK_EQUAL(addtx_count, 2); | ||||
{ | { | ||||
LOCK(wallet->cs_wallet); | LOCK(wallet->cs_wallet); | ||||
BOOST_CHECK_EQUAL(wallet->mapWallet.count(block_tx.GetId()), 1); | BOOST_CHECK_EQUAL(wallet->mapWallet.count(block_tx.GetId()), 1U); | ||||
BOOST_CHECK_EQUAL(wallet->mapWallet.count(mempool_tx.GetId()), 1); | BOOST_CHECK_EQUAL(wallet->mapWallet.count(mempool_tx.GetId()), 1U); | ||||
} | } | ||||
// Unblock notification queue and make sure stale blockConnected and | // Unblock notification queue and make sure stale blockConnected and | ||||
// transactionAddedToMempool events are processed | // transactionAddedToMempool events are processed | ||||
promise.set_value(); | promise.set_value(); | ||||
SyncWithValidationInterfaceQueue(); | SyncWithValidationInterfaceQueue(); | ||||
BOOST_CHECK_EQUAL(addtx_count, 4); | BOOST_CHECK_EQUAL(addtx_count, 4); | ||||
Show All 31 Lines | auto handler = HandleLoadWallet( | ||||
LEAVE_CRITICAL_SECTION(wallet_param->wallet()->cs_wallet); | LEAVE_CRITICAL_SECTION(wallet_param->wallet()->cs_wallet); | ||||
SyncWithValidationInterfaceQueue(); | SyncWithValidationInterfaceQueue(); | ||||
ENTER_CRITICAL_SECTION(wallet_param->wallet()->cs_wallet); | ENTER_CRITICAL_SECTION(wallet_param->wallet()->cs_wallet); | ||||
}); | }); | ||||
wallet = TestLoadWallet(*chain); | wallet = TestLoadWallet(*chain); | ||||
BOOST_CHECK_EQUAL(addtx_count, 4); | BOOST_CHECK_EQUAL(addtx_count, 4); | ||||
{ | { | ||||
LOCK(wallet->cs_wallet); | LOCK(wallet->cs_wallet); | ||||
BOOST_CHECK_EQUAL(wallet->mapWallet.count(block_tx.GetId()), 1); | BOOST_CHECK_EQUAL(wallet->mapWallet.count(block_tx.GetId()), 1U); | ||||
BOOST_CHECK_EQUAL(wallet->mapWallet.count(mempool_tx.GetId()), 1); | BOOST_CHECK_EQUAL(wallet->mapWallet.count(mempool_tx.GetId()), 1U); | ||||
} | } | ||||
TestUnloadWallet(std::move(wallet)); | TestUnloadWallet(std::move(wallet)); | ||||
} | } | ||||
BOOST_AUTO_TEST_SUITE_END() | BOOST_AUTO_TEST_SUITE_END() |