test: Replace MiniWallet scan_blocks with rescan_utxos

This commit is contained in:
MarcoFalke committed 2021-09-20 08:31:04 +02:00
1 parent 226731ac11
commit fa7e3f1fc1
5 files changed
+7 -14

No files matched your search

+4 -4
View File
@@ -28,14 +28,14 @@ class MempoolSpendCoinbaseTest(BitcoinTestFramework):
chain_height = 198
self.nodes[0].invalidateblock(self.nodes[0].getblockhash(chain_height + 1))
assert_equal(chain_height, self.nodes[0].getblockcount())
wallet.rescan_utxos()
# Coinbase at height chain_height-100+1 ok in mempool, should
# get mined. Coinbase at height chain_height-100+2 is
# too immature to spend.
wallet.scan_blocks(start=chain_height - 100 + 1, num=1)
utxo_mature = wallet.get_utxo()
wallet.scan_blocks(start=chain_height - 100 + 2, num=1)
utxo_immature = wallet.get_utxo()
coinbase_txid = lambda h: self.nodes[0].getblock(self.nodes[0].getblockhash(h))['tx'][0]
utxo_mature = wallet.get_utxo(txid=coinbase_txid(chain_height - 100 + 1))
utxo_immature = wallet.get_utxo(txid=coinbase_txid(chain_height - 100 + 2))
spend_mature_id = wallet.send_self_transfer(from_node=self.nodes[0], utxo_to_spend=utxo_mature)["txid"]