mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-15 16:38:23 +01:00
test: rename CTransaction .rehash()/.hash -> .txid_hex for consistency
Note that we unfortunately can't use a scripted diff here, as the same property and method name is also used for `CBlockHeader`/`CBlock` instances.
This commit is contained in:
@@ -121,13 +121,13 @@ class BytesPerSigOpTest(BitcoinTestFramework):
|
||||
parent_txid = tx.vin[0].prevout.hash.to_bytes(32, 'big').hex()
|
||||
parent_tx = tx_from_hex(self.nodes[0].getrawtransaction(txid=parent_txid))
|
||||
|
||||
entry_child = self.nodes[0].getmempoolentry(tx.rehash())
|
||||
entry_child = self.nodes[0].getmempoolentry(tx.txid_hex)
|
||||
assert_equal(entry_child['descendantcount'], 1)
|
||||
assert_equal(entry_child['descendantsize'], sigop_equivalent_vsize)
|
||||
assert_equal(entry_child['ancestorcount'], 2)
|
||||
assert_equal(entry_child['ancestorsize'], sigop_equivalent_vsize + parent_tx.get_vsize())
|
||||
|
||||
entry_parent = self.nodes[0].getmempoolentry(parent_tx.rehash())
|
||||
entry_parent = self.nodes[0].getmempoolentry(parent_tx.txid_hex)
|
||||
assert_equal(entry_parent['ancestorcount'], 1)
|
||||
assert_equal(entry_parent['ancestorsize'], parent_tx.get_vsize())
|
||||
assert_equal(entry_parent['descendantcount'], 2)
|
||||
@@ -147,7 +147,7 @@ class BytesPerSigOpTest(BitcoinTestFramework):
|
||||
tx = tx_dict["tx"]
|
||||
tx.vout.append(CTxOut(amount_for_bare, keys_to_multisig_script([pubkey], k=1)))
|
||||
tx.vout[0].nValue -= amount_for_bare
|
||||
tx_utxo["txid"] = tx.rehash()
|
||||
tx_utxo["txid"] = tx.txid_hex
|
||||
tx_utxo["value"] -= Decimal("0.00005000")
|
||||
return (tx_utxo, tx)
|
||||
|
||||
@@ -169,7 +169,7 @@ class BytesPerSigOpTest(BitcoinTestFramework):
|
||||
# When we actually try to submit, the parent makes it into the mempool, but the child would exceed ancestor vsize limits
|
||||
res = self.nodes[0].submitpackage([tx_parent.serialize().hex(), tx_child.serialize().hex()])
|
||||
assert "too-long-mempool-chain" in res["tx-results"][tx_child.getwtxid()]["error"]
|
||||
assert tx_parent.rehash() in self.nodes[0].getrawmempool()
|
||||
assert tx_parent.txid_hex in self.nodes[0].getrawmempool()
|
||||
|
||||
# Transactions are tiny in weight
|
||||
assert_greater_than(2000, tx_parent.get_weight() + tx_child.get_weight())
|
||||
|
||||
Reference in New Issue
Block a user