aboutsummaryrefslogtreecommitdiff
path: root/contrib
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 /contrib
parentfa826db477a981b48bff53021f9695a5f6682dc0 (diff)
downloadbitcoin-fa52e13ee81fcc7543890dbd6986fcb55168583f.tar.xz
test: Remove struct.pack from almost all places
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/seeds/generate-seeds.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/contrib/seeds/generate-seeds.py b/contrib/seeds/generate-seeds.py
index c84be1055d..f67e7b0f4c 100755
--- a/contrib/seeds/generate-seeds.py
+++ b/contrib/seeds/generate-seeds.py
@@ -29,7 +29,6 @@ These should be pasted into `src/chainparamsseeds.h`.
from base64 import b32decode
from enum import Enum
-import struct
import sys
import os
import re
@@ -117,11 +116,11 @@ def ser_compact_size(l):
if l < 253:
r = l.to_bytes(1, "little")
elif l < 0x10000:
- r = struct.pack("<BH", 253, l)
+ r = (253).to_bytes(1, "little") + l.to_bytes(2, "little")
elif l < 0x100000000:
- r = struct.pack("<BI", 254, l)
+ r = (254).to_bytes(1, "little") + l.to_bytes(4, "little")
else:
- r = struct.pack("<BQ", 255, l)
+ r = (255).to_bytes(1, "little") + l.to_bytes(8, "little")
return r
def bip155_serialize(spec):