From 5a1bef60a03b57de708a1a751bd90b8245fd8b83 Mon Sep 17 00:00:00 2001 From: Zero-1729 Date: Wed, 4 Aug 2021 19:59:06 +0100 Subject: test: refactor: remove binascii from test_framework --- test/functional/test_framework/blocktools.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/functional/test_framework/blocktools.py') 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: -- cgit v1.2.3