From b6d5f4f9e8449f3fb77717d4f04266587fd4f45e Mon Sep 17 00:00:00 2001 From: fanquake Date: Thu, 16 Sep 2021 12:09:33 +0800 Subject: [PATCH] Merge bitcoin/bitcoin#22992: Fix Qt test broken by #22219 865ee1af201238f48671e3b79b8215f896db7a05 Fix Qt test broken by #22219 (Russell Yanofsky) Pull request description: It looks like this should have been caught by CI but there might have been a conflict with a recently merged PR like #19101. Failure was reported by fanquake https://github.com/bitcoin/bitcoin/pull/22219#issuecomment-920496509 Fix avoids null WalletClient pointer dereference in address book test by adding MakeWalletClient call and making address book test initialization more consistent with wallet test initialization: https://github.com/bitcoin/bitcoin/blob/865ee1af201238f48671e3b79b8215f896db7a05/src/qt/test/addressbooktests.cpp#L63-L66 https://github.com/bitcoin/bitcoin/blob/865ee1af201238f48671e3b79b8215f896db7a05/src/qt/test/wallettests.cpp#L141-L144 ACKs for top commit: fanquake: ACK 865ee1af201238f48671e3b79b8215f896db7a05 - I'm merging this now to unbreak the build. Tree-SHA512: 1f32b7fc79fa79fcf8600d23063896cbc7f8bbcff39d95747ecd546e754581f0f36ece3098ddecded175afccbb3709b4232da39a400dda23b7e550f361b515fb --- src/qt/test/addressbooktests.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt/test/addressbooktests.cpp b/src/qt/test/addressbooktests.cpp index c4a47847aa1c7b..ede8755afffcc2 100644 --- a/src/qt/test/addressbooktests.cpp +++ b/src/qt/test/addressbooktests.cpp @@ -63,6 +63,8 @@ void EditAddressAndSubmit( void TestAddAddressesToSendBook(interfaces::Node& node) { TestChain100Setup test; + auto wallet_loader = interfaces::MakeWalletLoader(*test.m_node.chain, test.m_node.coinjoin_loader, *Assert(test.m_node.args)); + test.m_node.wallet_loader = wallet_loader.get(); node.setContext(&test.m_node); const std::shared_ptr wallet = std::make_shared(node.context()->chain.get(), node.context()->coinjoin_loader.get(), "", CreateMockWalletDatabase()); wallet->SetupLegacyScriptPubKeyMan();