aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/blocktools.py
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2020-11-09 15:46:59 +0100
committerWladimir J. van der Laan <laanwj@protonmail.com>2020-11-09 15:47:04 +0100
commit4fd37d0a104ff1b05a3c8e374af9b2c92a0078c2 (patch)
tree3190e3de468adf9ac05dae5cb644a05123e45fe4 /test/functional/test_framework/blocktools.py
parent05aeeee34f1552ea9be553a55f927110393927bf (diff)
parentfab900802d74799ac1004265951be1b66e70cf76 (diff)
downloadbitcoin-4fd37d0a104ff1b05a3c8e374af9b2c92a0078c2.tar.xz
Merge #20292: test: Fix intermittent feature_taproot issue
fab900802d74799ac1004265951be1b66e70cf76 ci: Bump timeout factor (MarcoFalke) 50eb0c2512842b96a0128a7d592a357665f6e006 Small improvements to the Taproot functional tests (Pieter Wuille) fac865b72d5c0e01fce74b84ab21e5ebbf069327 test: Fix intermittent feature_taproot issue (MarcoFalke) fa1dea19fc50db449386c9f969adc5ad327a0f0d test: Fix deser issue in create_block (MarcoFalke) fa762a3fd43e49f8572be69e9129cd9170855f76 test: Remove unused unnamed parameter from block.serialize call (MarcoFalke) Pull request description: This fixes three bugs. Also, fix some unrelated code style issues. Please refer to the commit messages for more information. ACKs for top commit: laanwj: Code review ACK fab900802d74799ac1004265951be1b66e70cf76 Tree-SHA512: 4e22c240cf345710f3b21fc63243126b90014b3656d0865ff87156e958dd1442e6572c6c0a5701dbbe503eee931a0ceb66eeeb3553137f3d1f5afd27a9f9cada
Diffstat (limited to 'test/functional/test_framework/blocktools.py')
-rw-r--r--test/functional/test_framework/blocktools.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/test/functional/test_framework/blocktools.py b/test/functional/test_framework/blocktools.py
index 64bc7e0485..6b7214f03a 100644
--- a/test/functional/test_framework/blocktools.py
+++ b/test/functional/test_framework/blocktools.py
@@ -5,7 +5,6 @@
"""Utilities for manipulating blocks and transactions."""
from binascii import a2b_hex
-import io
import struct
import time
import unittest
@@ -45,7 +44,6 @@ from .script import (
hash160,
)
from .util import assert_equal
-from io import BytesIO
WITNESS_SCALE_FACTOR = 4
MAX_BLOCK_SIGOPS = 20000
@@ -78,9 +76,7 @@ def create_block(hashprev=None, coinbase=None, ntime=None, *, version=None, tmpl
if txlist:
for tx in txlist:
if not hasattr(tx, 'calc_sha256'):
- txo = CTransaction()
- txo.deserialize(io.BytesIO(tx))
- tx = txo
+ tx = FromHex(CTransaction(), tx)
block.vtx.append(tx)
block.hashMerkleRoot = block.calc_merkle_root()
block.calc_sha256()
@@ -166,8 +162,7 @@ def create_transaction(node, txid, to_address, *, amount):
sign for the output that is being spent.
"""
raw_tx = create_raw_transaction(node, txid, to_address, amount=amount)
- tx = CTransaction()
- tx.deserialize(BytesIO(hex_str_to_bytes(raw_tx)))
+ tx = FromHex(CTransaction(), raw_tx)
return tx
def create_raw_transaction(node, txid, to_address, *, amount):