Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-mempool-coherence-on-activations.py
Show First 20 Lines • Show All 187 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
block.sha256] = self.block_heights[old_sha256] | block.sha256] = self.block_heights[old_sha256] | ||||
del self.block_heights[old_sha256] | del self.block_heights[old_sha256] | ||||
self.blocks[block_number] = block | self.blocks[block_number] = block | ||||
return block | return block | ||||
# send a txn to the mempool and check it was accepted | # send a txn to the mempool and check it was accepted | ||||
def send_transaction_to_mempool(tx): | def send_transaction_to_mempool(tx): | ||||
tx_id = node.sendrawtransaction(ToHex(tx)) | tx_id = node.sendrawtransaction(ToHex(tx)) | ||||
assert(tx_id in node.getrawmempool()) | assert tx_id in node.getrawmempool() | ||||
# checks the mempool has exactly the same txns as in the provided list | # checks the mempool has exactly the same txns as in the provided list | ||||
def check_mempool_equal(txns): | def check_mempool_equal(txns): | ||||
assert set(node.getrawmempool()) == set(tx.hash for tx in txns) | assert set(node.getrawmempool()) == set(tx.hash for tx in txns) | ||||
# Create an always-valid chained transaction. It spends a | # Create an always-valid chained transaction. It spends a | ||||
# scriptPub=OP_TRUE coin into another. Returns the transaction and its | # scriptPub=OP_TRUE coin into another. Returns the transaction and its | ||||
# spendable output for further chaining. | # spendable output for further chaining. | ||||
▲ Show 20 Lines • Show All 169 Lines • Show Last 20 Lines |