Fix bug where test was generating but not saving keys to wallet on disk.

This commit is contained in:
Simon 2016-12-15 23:31:54 -08:00
parent e96c8725af
commit 2911b35712
1 changed files with 9 additions and 0 deletions

View File

@ -43,13 +43,22 @@ TEST(founders_reward_test, create_testnet_2of3multisig) {
for (int i = 0; i < numKeys; i++) {
ASSERT_TRUE(pWallet->GetKeyFromPool(newKey));
pubkeys[0] = newKey;
pWallet->SetAddressBook(newKey.GetID(), "", "receive");
ASSERT_TRUE(pWallet->GetKeyFromPool(newKey));
pubkeys[1] = newKey;
pWallet->SetAddressBook(newKey.GetID(), "", "receive");
ASSERT_TRUE(pWallet->GetKeyFromPool(newKey));
pubkeys[2] = newKey;
pWallet->SetAddressBook(newKey.GetID(), "", "receive");
CScript result = GetScriptForMultisig(2, pubkeys);
ASSERT_FALSE(result.size() > MAX_SCRIPT_ELEMENT_SIZE);
CScriptID innerID(result);
pWallet->AddCScript(result);
pWallet->SetAddressBook(innerID, "", "receive");
std::string address = CBitcoinAddress(innerID).ToString();
addresses.push_back(address);
}