diff options
author | Ilya Kitaev <mbg033@gmail.com> | 2016-03-12 17:41:11 +0300 |
---|---|---|
committer | Ilya Kitaev <mbg033@gmail.com> | 2016-03-16 14:29:06 +0300 |
commit | 180ac6e438261aed02415cb1826e40c0eb0880ea (patch) | |
tree | 89b2aa3b0dfd2fa4cb1c5041a3bbfdd59c8cf535 /tests/libwallet_api_tests/main.cpp | |
parent | Wallet::setPassword() method for wallet2_api (diff) | |
download | monero-180ac6e438261aed02415cb1826e40c0eb0880ea.tar.xz |
WalletManager::recoveryWallet implemented
Diffstat (limited to 'tests/libwallet_api_tests/main.cpp')
-rw-r--r-- | tests/libwallet_api_tests/main.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/tests/libwallet_api_tests/main.cpp b/tests/libwallet_api_tests/main.cpp index fe6cd556f..7357e3a7f 100644 --- a/tests/libwallet_api_tests/main.cpp +++ b/tests/libwallet_api_tests/main.cpp @@ -51,19 +51,18 @@ struct WalletManagerTest : public testing::Test const char * WALLET_PASS2 = "password22"; const char * WALLET_LANG = "English"; - WalletManagerTest() { std::cout << __FUNCTION__ << std::endl; wmgr = Bitmonero::WalletManagerFactory::getWalletManager(); - //deleteWallet(WALLET_NAME); + deleteWallet(WALLET_NAME); } ~WalletManagerTest() { std::cout << __FUNCTION__ << std::endl; - deleteWallet(WALLET_NAME); + //deleteWallet(WALLET_NAME); } @@ -107,7 +106,6 @@ TEST_F(WalletManagerTest, WalletManagerOpensWallet) TEST_F(WalletManagerTest, WalletManagerChangesPassword) { - Bitmonero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG); std::string seed1 = wallet1->seed(); ASSERT_TRUE(wallet1->setPassword(WALLET_PASS2)); @@ -118,11 +116,22 @@ TEST_F(WalletManagerTest, WalletManagerChangesPassword) ASSERT_TRUE(wmgr->closeWallet(wallet2)); Bitmonero::Wallet * wallet3 = wmgr->openWallet(WALLET_NAME, WALLET_PASS); ASSERT_FALSE(wallet3->status() == Bitmonero::Wallet::Status_Ok); - } +TEST_F(WalletManagerTest, WalletManagerRecoversWallet) +{ + Bitmonero::Wallet * wallet1 = wmgr->createWallet(WALLET_NAME, WALLET_PASS, WALLET_LANG); + std::string seed1 = wallet1->seed(); + ASSERT_TRUE(wmgr->closeWallet(wallet1)); + deleteWallet(WALLET_NAME); + Bitmonero::Wallet * wallet2 = wmgr->recoveryWallet(WALLET_NAME, seed1); + ASSERT_TRUE(wallet2->status() == Bitmonero::Wallet::Status_Ok); + ASSERT_TRUE(wallet2->seed() == seed1); + ASSERT_TRUE(wmgr->closeWallet(wallet2)); +} + int main(int argc, char** argv) { |