aboutsummaryrefslogtreecommitdiff
path: root/test/functional/rpc_txoutproof.py
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-06-16 00:32:18 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-06-21 14:30:03 +0200
commita79396fe5f8f81c78cf84117a87074c6ff6c9d95 (patch)
tree6d5a3a187d6968bd1c5236f1b20bb5ba7759628e /test/functional/rpc_txoutproof.py
parent2ce7b47958c4a10ba20dc86c011d71cda4b070a5 (diff)
downloadbitcoin-a79396fe5f8f81c78cf84117a87074c6ff6c9d95.tar.xz
test: remove `ToHex` helper, use .serialize().hex() instead
Diffstat (limited to 'test/functional/rpc_txoutproof.py')
-rwxr-xr-xtest/functional/rpc_txoutproof.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/functional/rpc_txoutproof.py b/test/functional/rpc_txoutproof.py
index bf96b6353c..9afeeaff10 100755
--- a/test/functional/rpc_txoutproof.py
+++ b/test/functional/rpc_txoutproof.py
@@ -5,9 +5,15 @@
"""Test gettxoutproof and verifytxoutproof RPCs."""
from test_framework.blocktools import COINBASE_MATURITY
-from test_framework.messages import CMerkleBlock, FromHex, ToHex
+from test_framework.messages import (
+ CMerkleBlock,
+ FromHex,
+)
from test_framework.test_framework import BitcoinTestFramework
-from test_framework.util import assert_equal, assert_raises_rpc_error
+from test_framework.util import (
+ assert_equal,
+ assert_raises_rpc_error,
+)
from test_framework.wallet import MiniWallet
@@ -91,7 +97,7 @@ class MerkleBlockTest(BitcoinTestFramework):
tweaked_proof = FromHex(CMerkleBlock(), proof)
# Make sure that our serialization/deserialization is working
- assert txid1 in self.nodes[0].verifytxoutproof(ToHex(tweaked_proof))
+ assert txid1 in self.nodes[0].verifytxoutproof(tweaked_proof.serialize().hex())
# Check to see if we can go up the merkle tree and pass this off as a
# single-transaction block
@@ -100,7 +106,7 @@ class MerkleBlockTest(BitcoinTestFramework):
tweaked_proof.txn.vBits = [True] + [False]*7
for n in self.nodes:
- assert not n.verifytxoutproof(ToHex(tweaked_proof))
+ assert not n.verifytxoutproof(tweaked_proof.serialize().hex())
# TODO: try more variants, eg transactions at different depths, and
# verify that the proofs are invalid