aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/messages.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/test_framework/messages.py')
-rwxr-xr-xtest/functional/test_framework/messages.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py
index bab4ad0008..6ad4e13db2 100755
--- a/test/functional/test_framework/messages.py
+++ b/test/functional/test_framework/messages.py
@@ -564,6 +564,9 @@ class CTransaction:
def serialize(self):
return self.serialize_with_witness()
+ def getwtxid(self):
+ return hash256(self.serialize())[::-1].hex()
+
# Recalculate the txid (transaction hash without witness)
def rehash(self):
self.sha256 = None
@@ -579,7 +582,7 @@ class CTransaction:
if self.sha256 is None:
self.sha256 = uint256_from_str(hash256(self.serialize_without_witness()))
- self.hash = encode(hash256(self.serialize_without_witness())[::-1], 'hex_codec').decode('ascii')
+ self.hash = hash256(self.serialize_without_witness())[::-1].hex()
def is_valid(self):
self.calc_sha256()