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:
Sebastian Falbesoner
2025-05-05 00:11:32 +02:00
parent e9cdaefb0a
commit ce83924237
30 changed files with 136 additions and 141 deletions

View File

@@ -667,7 +667,7 @@ class CTransaction:
return uint256_from_str(hash256(self.serialize_with_witness()))
@property
def hash(self):
def txid_hex(self):
"""Return txid (transaction hash without witness) as hex string."""
return hash256(self.serialize_without_witness())[::-1].hex()
@@ -676,11 +676,6 @@ class CTransaction:
"""Return txid (transaction hash without witness) as integer."""
return uint256_from_str(hash256(self.serialize_without_witness()))
# Recalculate the txid (transaction hash without witness)
# TODO: get rid of this method, replace call-sites by .hash access
def rehash(self):
return self.hash
def is_valid(self):
for tout in self.vout:
if tout.nValue < 0 or tout.nValue > 21000000 * COIN: