diff --git a/qa/rpc-tests/addressindex.py b/qa/rpc-tests/addressindex.py index 5e87fc65d..30198a38a 100755 --- a/qa/rpc-tests/addressindex.py +++ b/qa/rpc-tests/addressindex.py @@ -208,7 +208,13 @@ class AddressIndexTest(BitcoinTestFramework): assert_equal(mempool[2]['txid'], txid) # 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) assert_equal(tx['vin'][0]['address'], addr1) diff --git a/src/wallet/gtest/test_wallet.cpp b/src/wallet/gtest/test_wallet.cpp index 458497e02..a2cb278ad 100644 --- a/src/wallet/gtest/test_wallet.cpp +++ b/src/wallet/gtest/test_wallet.cpp @@ -1511,7 +1511,15 @@ TEST(WalletTests, ClearNoteWitnessCache) { 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 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> sproutWitnesses; std::vector> saplingWitnesses;