Merge 5adc5c0280 into merged_master (Bitcoin PR bitcoin/bitcoin#23403)

This commit is contained in:
Byron Hambly 2023-05-16 13:40:14 +00:00
commit 722506530a
3 changed files with 10 additions and 1 deletions

View file

@ -14,8 +14,9 @@
BOOST_FIXTURE_TEST_SUITE(psbt_wallet_tests, WalletTestingSetup)
static void import_descriptor(CWallet& wallet, const std::string& descriptor)
EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
{
LOCK(wallet.cs_wallet);
AssertLockHeld(wallet.cs_wallet);
FlatSigningProvider provider;
std::string error;
std::unique_ptr<Descriptor> desc = Parse(descriptor, provider, error, /* require_checksum=*/ false);

View file

@ -4,6 +4,8 @@
#include <wallet/test/wallet_test_fixture.h>
#include <scheduler.h>
WalletTestingSetup::WalletTestingSetup(const std::string& chainName)
: TestingSetup(chainName),
m_wallet(m_node.chain.get(), "", CreateMockWalletDatabase())
@ -12,3 +14,8 @@ WalletTestingSetup::WalletTestingSetup(const std::string& chainName)
m_chain_notifications_handler = m_node.chain->handleNotifications({ &m_wallet, [](CWallet*) {} });
m_wallet_client->registerRpcs();
}
WalletTestingSetup::~WalletTestingSetup()
{
if (m_node.scheduler) m_node.scheduler->stop();
}

View file

@ -19,6 +19,7 @@
*/
struct WalletTestingSetup : public TestingSetup {
explicit WalletTestingSetup(const std::string& chainName = CBaseChainParams::MAIN);
~WalletTestingSetup();
std::unique_ptr<interfaces::WalletClient> m_wallet_client = interfaces::MakeWalletClient(*m_node.chain, *Assert(m_node.args));
CWallet m_wallet;