mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-05 11:28:49 +02: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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user