Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/test/scriptpubkeyman_tests.cpp
Show All 14 Lines | |||||
// Test LegacyScriptPubKeyMan::CanProvide behavior, making sure it returns true | // Test LegacyScriptPubKeyMan::CanProvide behavior, making sure it returns true | ||||
// for recognized scripts even when keys may not be available for signing. | // for recognized scripts even when keys may not be available for signing. | ||||
BOOST_AUTO_TEST_CASE(CanProvide) { | BOOST_AUTO_TEST_CASE(CanProvide) { | ||||
// Set up wallet and keyman variables. | // Set up wallet and keyman variables. | ||||
NodeContext node; | NodeContext node; | ||||
std::unique_ptr<interfaces::Chain> chain = | std::unique_ptr<interfaces::Chain> chain = | ||||
interfaces::MakeChain(node, Params()); | interfaces::MakeChain(node, Params()); | ||||
CWallet wallet(chain.get(), WalletLocation(), | CWallet wallet(chain.get(), WalletLocation(), CreateDummyWalletDatabase()); | ||||
WalletDatabase::CreateDummy()); | |||||
LegacyScriptPubKeyMan &keyman = *wallet.GetOrCreateLegacyScriptPubKeyMan(); | LegacyScriptPubKeyMan &keyman = *wallet.GetOrCreateLegacyScriptPubKeyMan(); | ||||
// Make a 1 of 2 multisig script | // Make a 1 of 2 multisig script | ||||
std::vector<CKey> keys(2); | std::vector<CKey> keys(2); | ||||
std::vector<CPubKey> pubkeys; | std::vector<CPubKey> pubkeys; | ||||
for (CKey &key : keys) { | for (CKey &key : keys) { | ||||
key.MakeNewKey(true); | key.MakeNewKey(true); | ||||
pubkeys.emplace_back(key.GetPubKey()); | pubkeys.emplace_back(key.GetPubKey()); | ||||
Show All 13 Lines |