Auto merge of #4446 - str4d:heisenbug-squashing, r=ebfull

Heisenbug squashing

Both bugs addressed here had clear causes, so we are confident that the corresponding issues are fixed.
This commit is contained in:
Homu 2020-04-14 16:47:24 +00:00
commit ccc7735635
2 changed files with 15 additions and 1 deletions

View File

@ -208,7 +208,13 @@ class AddressIndexTest(BitcoinTestFramework):
assert_equal(mempool[2]['txid'], txid) assert_equal(mempool[2]['txid'], txid)
# a single address can be specified as a string (not json object) # a single address can be specified as a string (not json object)
assert_equal([mempool[1]], self.nodes[0].getaddressmempool(addr1)) addr1_mempool = self.nodes[0].getaddressmempool(addr1)
assert_equal(len(addr1_mempool), 1)
# Don't check the timestamp; it's local to the node, and can mismatch
# due to propagation delay.
del addr1_mempool[0]['timestamp']
for key in addr1_mempool[0].keys():
assert_equal(mempool[1][key], addr1_mempool[0][key])
tx = self.nodes[0].getrawtransaction(txid, 1) tx = self.nodes[0].getrawtransaction(txid, 1)
assert_equal(tx['vin'][0]['address'], addr1) assert_equal(tx['vin'][0]['address'], addr1)

View File

@ -1511,7 +1511,15 @@ TEST(WalletTests, ClearNoteWitnessCache) {
wallet.AddToWallet(wtx, true, NULL); wallet.AddToWallet(wtx, true, NULL);
// For Sprout, we have two outputs in the one JSDescription, only one of
// which is in the wallet.
std::vector<JSOutPoint> sproutNotes {jsoutpt, jsoutpt2}; std::vector<JSOutPoint> sproutNotes {jsoutpt, jsoutpt2};
// For Sapling, SetSaplingNoteData() only created a single Sapling output
// which is in the wallet, so we add a second SaplingOutPoint here to
// exercise the "note not in wallet" case.
saplingNotes.emplace_back(wtx.GetHash(), 1);
ASSERT_EQ(saplingNotes.size(), 2);
std::vector<boost::optional<SproutWitness>> sproutWitnesses; std::vector<boost::optional<SproutWitness>> sproutWitnesses;
std::vector<boost::optional<SaplingWitness>> saplingWitnesses; std::vector<boost::optional<SaplingWitness>> saplingWitnesses;