From 67100685ce721d6b921ed1c85b7ef12537e52c25 Mon Sep 17 00:00:00 2001 From: xdustinface Date: Fri, 21 Aug 2020 23:44:19 +0200 Subject: [PATCH 1/2] test: Fix importwallet_rescan test The wallet should be removed after the dumpwallet() call otherwise it may lead to unepexted behaviour in other wallet tests since the wallet stays in vpwallets then. --- src/wallet/test/wallet_tests.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index f4206edf79cc..e43c387a8300 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -479,6 +479,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup) request.params.push_back((pathTemp / "wallet.backup").string()); AddWallet(&wallet); ::dumpwallet(request); + RemoveWallet(&wallet); } // Call importwallet RPC and verify all blocks with timestamps >= BLOCK_TIME From cbf494b6b120519b285591d56991a6bcf26e7464 Mon Sep 17 00:00:00 2001 From: pasta Date: Sun, 23 Aug 2020 11:30:59 -0500 Subject: [PATCH 2/2] tests: Change where RemoveWallet call is to be more in line with upstream Signed-off-by: pasta --- src/wallet/test/wallet_tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index e43c387a8300..c1950fd299ab 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -492,6 +492,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup) request.params.push_back((pathTemp / "wallet.backup").string()); AddWallet(&wallet); ::importwallet(request); + RemoveWallet(&wallet); LOCK(wallet.cs_wallet); BOOST_CHECK_EQUAL(wallet.mapWallet.size(), 3); @@ -501,7 +502,6 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup) bool expected = i >= 100; BOOST_CHECK_EQUAL(found, expected); } - RemoveWallet(&wallet); } SetMockTime(0);