Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc_rpc_isfinal.py
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
with node.assert_debug_log([f"Avalanche finalized block {blockhash}"]): | with node.assert_debug_log([f"Avalanche finalized block {blockhash}"]): | ||||
self.wait_until(lambda: is_finalblock(blockhash)) | self.wait_until(lambda: is_finalblock(blockhash)) | ||||
assert node.isfinaltransaction(cb_txid, blockhash) | assert node.isfinaltransaction(cb_txid, blockhash) | ||||
self.log.info("Check block ancestors are finalized as well") | self.log.info("Check block ancestors are finalized as well") | ||||
tip_height = node.getblockheader(blockhash)['height'] | tip_height = node.getblockheader(blockhash)['height'] | ||||
for height in range(0, tip_height): | for height in range(0, tip_height): | ||||
hash = node.getblockhash(height) | blockhash = node.getblockhash(height) | ||||
assert node.isfinalblock(hash) | assert node.isfinalblock(blockhash) | ||||
txid = node.getblock(hash)['tx'][0] | txid = node.getblock(blockhash)['tx'][0] | ||||
assert node.isfinaltransaction(txid, hash) | assert node.isfinaltransaction(txid, blockhash) | ||||
if self.is_wallet_compiled(): | if self.is_wallet_compiled(): | ||||
self.log.info("Check mempool transactions are not finalized") | self.log.info("Check mempool transactions are not finalized") | ||||
# Mature some utxos | # Mature some utxos | ||||
tip = self.generate(node, 100, sync_fun=self.no_op)[-1] | tip = self.generate(node, 100, sync_fun=self.no_op)[-1] | ||||
wallet_txid = node.sendtoaddress( | wallet_txid = node.sendtoaddress( | ||||
ADDRESS_ECREG_UNSPENDABLE, 1_000_000) | ADDRESS_ECREG_UNSPENDABLE, 1_000_000) | ||||
assert wallet_txid in node.getrawmempool() | assert wallet_txid in node.getrawmempool() | ||||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |