aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-01-07 16:47:35 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-01-12 18:43:43 +0100
commitfa0aa87071eaec8a5df17774cdb352195e5e09de (patch)
tree454ced6a44964dcddf0351b8558d5a676d629e11 /test/functional/test_framework
parent6af013792f1bf85824803fc5283bf0d68a8fd080 (diff)
rpc: Return wtxid from testmempoolaccept
Diffstat (limited to 'test/functional/test_framework')
-rwxr-xr-xtest/functional/test_framework/messages.py5
-rw-r--r--test/functional/test_framework/wallet.py2
2 files changed, 5 insertions, 2 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()
diff --git a/test/functional/test_framework/wallet.py b/test/functional/test_framework/wallet.py
index 7cb74bdcb3..edd7792608 100644
--- a/test/functional/test_framework/wallet.py
+++ b/test/functional/test_framework/wallet.py
@@ -76,4 +76,4 @@ class MiniWallet:
from_node.sendrawtransaction(tx_hex)
assert_equal(tx_info['vsize'], vsize)
assert_equal(tx_info['fees']['base'], fee)
- return {'txid': tx_info['txid'], 'wtxid': from_node.decoderawtransaction(tx_hex)['hash'], 'hex': tx_hex}
+ return {'txid': tx_info['txid'], 'wtxid': tx_info['wtxid'], 'hex': tx_hex}