test: refactor: remove binascii from test_framework

This commit is contained in:
Zero-1729 committed 2021-08-04 19:59:13 +01:00
1 parent 71797beec5
commit 5a1bef60a0
5 files changed
+10 -14

No files matched your search

+1 -2
View File
@@ -12,7 +12,6 @@ import socket
import struct
import array
import os
from binascii import unhexlify
# STATE_ESTABLISHED = '01'
# STATE_SYN_SENT = '02'
@@ -44,7 +43,7 @@ def _remove_empty(array):
def _convert_ip_port(array):
host,port = array.split(':')
# convert host from mangled-per-four-bytes form as used by kernel
host = unhexlify(host)
host = bytes.fromhex(host)
host_out = ''
for x in range(0, len(host) // 4):
(val,) = struct.unpack('=I', host[x*4:(x+1)*4])