aboutsummaryrefslogtreecommitdiff
path: root/tests/libwallet_api_tests/main.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-02-05 13:42:41 +0200
committerRiccardo Spagni <ric@spagni.net>2017-02-05 13:42:41 +0200
commit3473af00ad871a52ede2baee14de83eebc7a5760 (patch)
tree277d90aa5ba6b43c42d536b45541ab7a5684a889 /tests/libwallet_api_tests/main.cpp
parentMerge pull request #1669 (diff)
parentupdate wallet api tests (diff)
downloadmonero-3473af00ad871a52ede2baee14de83eebc7a5760.tar.xz
Merge pull request #1655
b14d109b update wallet api tests (Jaquee) 0cc50bdd GUI: Improved refresh performance (Jaquee) 805625b5 wallet api: Remove initAsync() and don't start refresh automatically on init (Jaquee) 031b060a wallet2::init() - disconnect before init if connected Makes it possible for GUI to reinit with new daemon without closing and reopening wallet. (Jaquee)
Diffstat (limited to 'tests/libwallet_api_tests/main.cpp')
-rw-r--r--tests/libwallet_api_tests/main.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/libwallet_api_tests/main.cpp b/tests/libwallet_api_tests/main.cpp
index 6f33684cd..cb1169df3 100644
--- a/tests/libwallet_api_tests/main.cpp
+++ b/tests/libwallet_api_tests/main.cpp
@@ -897,7 +897,8 @@ TEST_F(WalletTest2, WalletCallBackRefreshedAsync)
std::chrono::seconds wait_for = std::chrono::seconds(20);
std::unique_lock<std::mutex> lock (wallet_src_listener->mutex);
- wallet_src->initAsync(TESTNET_DAEMON_ADDRESS, 0);
+ wallet_src->init(MAINNET_DAEMON_ADDRESS, 0);
+ wallet_src->startRefresh();
std::cerr << "TEST: waiting on refresh lock...\n";
wallet_src_listener->cv_refresh.wait_for(lock, wait_for);
std::cerr << "TEST: refresh lock acquired...\n";
@@ -1050,8 +1051,8 @@ TEST_F(WalletManagerMainnetTest, CreateAndRefreshWalletMainNetAsync)
std::chrono::seconds wait_for = std::chrono::seconds(SECONDS_TO_REFRESH);
std::unique_lock<std::mutex> lock (wallet_listener->mutex);
- wallet->initAsync(MAINNET_DAEMON_ADDRESS, 0);
- // wallet->init(MAINNET_DAEMON_ADDRESS, 0);
+ wallet->init(MAINNET_DAEMON_ADDRESS, 0);
+ wallet->startRefresh();
std::cerr << "TEST: waiting on refresh lock...\n";
wallet_listener->cv_refresh.wait_for(lock, wait_for);
std::cerr << "TEST: refresh lock acquired...\n";
@@ -1076,8 +1077,8 @@ TEST_F(WalletManagerMainnetTest, OpenAndRefreshWalletMainNetAsync)
std::chrono::seconds wait_for = std::chrono::seconds(SECONDS_TO_REFRESH);
std::unique_lock<std::mutex> lock (wallet_listener->mutex);
- wallet->initAsync(MAINNET_DAEMON_ADDRESS, 0);
- // wallet->init(MAINNET_DAEMON_ADDRESS, 0);
+ wallet->init(MAINNET_DAEMON_ADDRESS, 0);
+ wallet->startRefresh();
std::cerr << "TEST: waiting on refresh lock...\n";
wallet_listener->cv_refresh.wait_for(lock, wait_for);
std::cerr << "TEST: refresh lock acquired...\n";
@@ -1110,8 +1111,8 @@ TEST_F(WalletManagerMainnetTest, RecoverAndRefreshWalletMainNetAsync)
std::unique_ptr<MyWalletListener> wallet_listener (new MyWalletListener(wallet));
std::chrono::seconds wait_for = std::chrono::seconds(SECONDS_TO_REFRESH);
std::unique_lock<std::mutex> lock (wallet_listener->mutex);
- wallet->initAsync(MAINNET_DAEMON_ADDRESS, 0);
- // wallet->init(MAINNET_DAEMON_ADDRESS, 0);
+ wallet->init(MAINNET_DAEMON_ADDRESS, 0);
+ wallet->startRefresh();
std::cerr << "TEST: waiting on refresh lock...\n";
// here we wait for 120 seconds and test if wallet doesn't syncrnonize blockchain completely,