diff --git a/qa/rpc-tests/sprout_sapling_migration.py b/qa/rpc-tests/sprout_sapling_migration.py index 3e5a094cf..c9ef9797a 100755 --- a/qa/rpc-tests/sprout_sapling_migration.py +++ b/qa/rpc-tests/sprout_sapling_migration.py @@ -102,14 +102,25 @@ class SproutSaplingMigration(BitcoinTestFramework): self.sync_all() # At 499 % 500 there will be a transaction in the mempool and the note will be locked - assert_equal(1, len(node.getrawmempool()), "mempool size at 499 % 500") + mempool = node.getrawmempool() + print("mempool: {}".format(mempool)) + assert_equal(1, len(mempool), "mempool size at 499 % 500") assert_equal(node.z_getbalance(sproutAddr), Decimal('0')) assert_equal(node.z_getbalance(saplingAddr), Decimal('0')) assert_true(node.z_getbalance(saplingAddr, 0) > Decimal('0'), "Unconfirmed sapling balance at 499 % 500") # Check that unmigrated amount + unfinalized = starting balance - fee status = node.z_getmigrationstatus() + print("status: {}".format(status)) assert_equal(Decimal('9.9999'), Decimal(status['unmigrated_amount']) + Decimal(status['unfinalized_migrated_amount'])) + # The transaction in the mempool should be the one listed in migration_txids, + # and it should expire at the next 450 % 500. + assert_equal(1, len(status['migration_txids'])) + txid = status['migration_txids'][0] + assert_equal(txid, mempool[0]) + tx = node.getrawtransaction(txid, 1) + assert_equal(target_height + 450, tx['expiryheight']) + node.generate(1) self.sync_all()