aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-12-12 19:44:18 +0100
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-01-29 11:10:59 +0100
commitfafc0d68eef9c9381b1a3d8e160aad9eeb8540a7 (patch)
tree0348b52833b75b5547f18a433260396729507441 /test/functional/test_framework
parentfa3886b7c69cbbe564478f30bb2c35e9e6b1cffa (diff)
downloadbitcoin-fafc0d68eef9c9381b1a3d8e160aad9eeb8540a7.tar.xz
test: Use int from_bytes and to_bytes over struct packing
This is done in prepration for the scripted diff, which can not deal with the 0 literal int.
Diffstat (limited to 'test/functional/test_framework')
-rwxr-xr-xtest/functional/test_framework/messages.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py
index 1e15113d88..c5050c0e6a 100755
--- a/test/functional/test_framework/messages.py
+++ b/test/functional/test_framework/messages.py
@@ -399,12 +399,12 @@ class CBlockLocator:
self.vHave = []
def deserialize(self, f):
- struct.unpack("<i", f.read(4))[0] # Ignore version field.
+ int.from_bytes(f.read(4), "little", signed=True) # Ignore version field.
self.vHave = deser_uint256_vector(f)
def serialize(self):
r = b""
- r += struct.pack("<i", 0) # Bitcoin Core ignores version field. Set it to 0.
+ r += (0).to_bytes(4, "little", signed=True) # Bitcoin Core ignores the version field. Set it to 0.
r += ser_uint256_vector(self.vHave)
return r