From 9f98fa6b6e5d99f3f6ab2570d1a41830c6e9bf33 Mon Sep 17 00:00:00 2001 From: Paul Calabrese Date: Thu, 14 Jun 2018 19:44:31 -0500 Subject: [PATCH] Fix wallet unit tests for remove_key --- tests/wallet_tests.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/wallet_tests.cpp b/tests/wallet_tests.cpp index e83f7ae11..cf97d1d20 100644 --- a/tests/wallet_tests.cpp +++ b/tests/wallet_tests.cpp @@ -122,7 +122,7 @@ BOOST_AUTO_TEST_CASE(wallet_manager_test) // key3 was not automatically imported BOOST_CHECK(std::find(keys.cbegin(), keys.cend(), pub_pri_pair(key3)) == keys.cend()); - wm.remove_key("test", pw, key2); + wm.remove_key("test", pw, string(pub_pri_pair(key2).first)); BOOST_CHECK_EQUAL(1, wm.get_public_keys().size()); keys = wm.list_keys("test", pw); BOOST_CHECK(std::find(keys.cbegin(), keys.cend(), pub_pri_pair(key2)) == keys.cend()); @@ -130,9 +130,10 @@ BOOST_AUTO_TEST_CASE(wallet_manager_test) BOOST_CHECK_EQUAL(2, wm.get_public_keys().size()); keys = wm.list_keys("test", pw); BOOST_CHECK(std::find(keys.cbegin(), keys.cend(), pub_pri_pair(key2)) != keys.cend()); - wm.remove_key("test", pw, key3); + BOOST_CHECK_THROW(wm.remove_key("test", pw, string(pub_pri_pair(key3).first)), fc::exception); + BOOST_CHECK_EQUAL(2, wm.get_public_keys().size()); + BOOST_CHECK_THROW(wm.remove_key("test", "PWnogood", string(pub_pri_pair(key2).first)), wallet_invalid_password_exception); BOOST_CHECK_EQUAL(2, wm.get_public_keys().size()); - BOOST_CHECK_THROW(wm.remove_key("test2", "PWnogood", key2), wallet_invalid_password_exception); wm.lock("test"); BOOST_CHECK_THROW(wm.list_keys("test", pw), wallet_locked_exception); -- GitLab