aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/blocktools.py
diff options
context:
space:
mode:
authorZero-1729 <zero1729@protonmail.com>2021-08-04 19:59:06 +0100
committerZero-1729 <zero1729@protonmail.com>2021-08-04 19:59:13 +0100
commit5a1bef60a03b57de708a1a751bd90b8245fd8b83 (patch)
tree628d3356679e629d56e67ab20827b518c0b7fde5 /test/functional/test_framework/blocktools.py
parent71797beec54d36a055d5e172ecbf2141fa984428 (diff)
downloadbitcoin-5a1bef60a03b57de708a1a751bd90b8245fd8b83.tar.xz
test: refactor: remove binascii from test_framework
Diffstat (limited to 'test/functional/test_framework/blocktools.py')
-rw-r--r--test/functional/test_framework/blocktools.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/functional/test_framework/blocktools.py b/test/functional/test_framework/blocktools.py
index 5e6c9f37e8..1a2d9e1864 100644
--- a/test/functional/test_framework/blocktools.py
+++ b/test/functional/test_framework/blocktools.py
@@ -4,7 +4,6 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Utilities for manipulating blocks and transactions."""
-from binascii import a2b_hex
import struct
import time
import unittest
@@ -73,7 +72,7 @@ def create_block(hashprev=None, coinbase=None, ntime=None, *, version=None, tmpl
block.nTime = ntime or tmpl.get('curtime') or int(time.time() + 600)
block.hashPrevBlock = hashprev or int(tmpl['previousblockhash'], 0x10)
if tmpl and not tmpl.get('bits') is None:
- block.nBits = struct.unpack('>I', a2b_hex(tmpl['bits']))[0]
+ block.nBits = struct.unpack('>I', bytes.fromhex(tmpl['bits']))[0]
else:
block.nBits = 0x207fffff # difficulty retargeting is disabled in REGTEST chainparams
if coinbase is None: