Pass NodeContext, ConnMan, BanMan references more places

So g_connman and g_banman globals can be removed next commit.
This commit is contained in:
Russell Yanofsky
2019-09-17 18:28:03 -04:00
parent 4d5448c76b
commit e6f4f895d5
34 changed files with 154 additions and 62 deletions

View File

@@ -51,11 +51,10 @@ void EditAddressAndSubmit(
* In each case, verify the resulting state of the address book and optionally
* the warning message presented to the user.
*/
void TestAddAddressesToSendBook()
void TestAddAddressesToSendBook(interfaces::Node& node)
{
TestChain100Setup test;
auto chain = interfaces::MakeChain();
std::shared_ptr<CWallet> wallet = std::make_shared<CWallet>(chain.get(), WalletLocation(), WalletDatabase::CreateMock());
std::shared_ptr<CWallet> wallet = std::make_shared<CWallet>(node.context()->chain.get(), WalletLocation(), WalletDatabase::CreateMock());
bool firstRun;
wallet->LoadWallet(firstRun);
@@ -101,10 +100,9 @@ void TestAddAddressesToSendBook()
// Initialize relevant QT models.
std::unique_ptr<const PlatformStyle> platformStyle(PlatformStyle::instantiate("other"));
auto node = interfaces::MakeNode();
OptionsModel optionsModel(*node);
OptionsModel optionsModel(node);
AddWallet(wallet);
WalletModel walletModel(std::move(node->getWallets()[0]), *node, platformStyle.get(), &optionsModel);
WalletModel walletModel(interfaces::MakeWallet(wallet), node, platformStyle.get(), &optionsModel);
RemoveWallet(wallet);
EditAddressDialog editAddressDialog(EditAddressDialog::NewSendingAddress);
editAddressDialog.setModel(walletModel.getAddressTableModel());
@@ -150,5 +148,5 @@ void AddressBookTests::addressBookTests()
return;
}
#endif
TestAddAddressesToSendBook();
TestAddAddressesToSendBook(m_node);
}