aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-02-07 13:19:37 +0100
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-05-07 15:41:17 +0200
commitfa52e13ee81fcc7543890dbd6986fcb55168583f (patch)
tree51a198656b3102c6ca4e9e0147ef6bf6146b30e7 /test
parentfa826db477a981b48bff53021f9695a5f6682dc0 (diff)
test: Remove struct.pack from almost all places
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/feature_addrman.py1
-rwxr-xr-xtest/functional/feature_block.py3
-rwxr-xr-xtest/functional/p2p_segwit.py1
-rw-r--r--test/functional/test_framework/script.py1
4 files changed, 1 insertions, 5 deletions
diff --git a/test/functional/feature_addrman.py b/test/functional/feature_addrman.py
index f422673f6b..2efad70900 100755
--- a/test/functional/feature_addrman.py
+++ b/test/functional/feature_addrman.py
@@ -6,7 +6,6 @@
import os
import re
-import struct
from test_framework.messages import ser_uint256, hash256, MAGIC_BYTES
from test_framework.netutil import ADDRMAN_NEW_BUCKET_COUNT, ADDRMAN_TRIED_BUCKET_COUNT, ADDRMAN_BUCKET_SIZE
diff --git a/test/functional/feature_block.py b/test/functional/feature_block.py
index 8a95975184..932f37a083 100755
--- a/test/functional/feature_block.py
+++ b/test/functional/feature_block.py
@@ -4,7 +4,6 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test block processing."""
import copy
-import struct
import time
from test_framework.blocktools import (
@@ -67,7 +66,7 @@ class CBrokenBlock(CBlock):
def serialize(self, with_witness=False):
r = b""
r += super(CBlock, self).serialize()
- r += struct.pack("<BQ", 255, len(self.vtx))
+ r += (255).to_bytes(1, "little") + len(self.vtx).to_bytes(8, "little")
for tx in self.vtx:
if with_witness:
r += tx.serialize_with_witness()
diff --git a/test/functional/p2p_segwit.py b/test/functional/p2p_segwit.py
index 03a19be722..b63c2c7a8d 100755
--- a/test/functional/p2p_segwit.py
+++ b/test/functional/p2p_segwit.py
@@ -5,7 +5,6 @@
"""Test segwit transactions and blocks on P2P network."""
from decimal import Decimal
import random
-import struct
import time
from test_framework.blocktools import (
diff --git a/test/functional/test_framework/script.py b/test/functional/test_framework/script.py
index 4bf598ca15..ab3dc2ffb1 100644
--- a/test/functional/test_framework/script.py
+++ b/test/functional/test_framework/script.py
@@ -8,7 +8,6 @@ This file is modified from python-bitcoinlib.
"""
from collections import namedtuple
-import struct
import unittest
from .key import TaggedHash, tweak_add_pubkey, compute_xonly_pubkey