test: refactor: remove binascii from test_framework

This commit is contained in:
Zero-1729
2021-08-04 19:59:06 +01:00
parent 71797beec5
commit 5a1bef60a0
5 changed files with 10 additions and 14 deletions

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])