aboutsummaryrefslogtreecommitdiff
path: root/test/functional/interface_rest.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/interface_rest.py
parent71797beec54d36a055d5e172ecbf2141fa984428 (diff)
downloadbitcoin-5a1bef60a03b57de708a1a751bd90b8245fd8b83.tar.xz
test: refactor: remove binascii from test_framework
Diffstat (limited to 'test/functional/interface_rest.py')
-rwxr-xr-xtest/functional/interface_rest.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/functional/interface_rest.py b/test/functional/interface_rest.py
index 0cd6a7b0c6..d644a420fc 100755
--- a/test/functional/interface_rest.py
+++ b/test/functional/interface_rest.py
@@ -4,7 +4,6 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the REST API."""
-import binascii
from decimal import Decimal
from enum import Enum
from io import BytesIO
@@ -235,13 +234,13 @@ class RESTTest (BitcoinTestFramework):
response_hex = self.test_rest_request("/block/{}".format(bb_hash), req_type=ReqType.HEX, ret_type=RetType.OBJ)
assert_greater_than(int(response_hex.getheader('content-length')), BLOCK_HEADER_SIZE*2)
response_hex_bytes = response_hex.read().strip(b'\n')
- assert_equal(binascii.hexlify(response_bytes), response_hex_bytes)
+ assert_equal(response_bytes.hex().encode(), response_hex_bytes)
# Compare with hex block header
response_header_hex = self.test_rest_request("/headers/1/{}".format(bb_hash), req_type=ReqType.HEX, ret_type=RetType.OBJ)
assert_greater_than(int(response_header_hex.getheader('content-length')), BLOCK_HEADER_SIZE*2)
response_header_hex_bytes = response_header_hex.read(BLOCK_HEADER_SIZE*2)
- assert_equal(binascii.hexlify(response_bytes[:BLOCK_HEADER_SIZE]), response_header_hex_bytes)
+ assert_equal(response_bytes[:BLOCK_HEADER_SIZE].hex().encode(), response_header_hex_bytes)
# Check json format
block_json_obj = self.test_rest_request("/block/{}".format(bb_hash))