From 53c990ad3406ee945305af84af98d2f020e5f316 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Tue, 25 Apr 2023 08:19:50 +0200 Subject: test: fix `feature_addrman.py` on big-endian systems The test `feature_addrman.py` currently serializes the addrdb without specifying endianness for `int`s, so the machine's native byte order is used (see https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment) and the generated `peers.dat` would be invalid on big-endian systems. Fix this by explicitly specifying little-endian serialization via the `<` character in `struct.pack(...)`. --- test/functional/feature_addrman.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/functional/feature_addrman.py b/test/functional/feature_addrman.py index 28c3880513..57a26b5030 100755 --- a/test/functional/feature_addrman.py +++ b/test/functional/feature_addrman.py @@ -32,12 +32,12 @@ def serialize_addrman( r += struct.pack("B", format) r += struct.pack("B", INCOMPATIBILITY_BASE + lowest_compatible) r += ser_uint256(bucket_key) - r += struct.pack("i", len_new or len(new)) - r += struct.pack("i", len_tried or len(tried)) + r += struct.pack("