mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
test: Normalize struct.pack format
* Add () around some int values * Remove b-prefix from strings This is needed for the scripted diff to work.
This commit is contained in:
@@ -29,14 +29,14 @@ def serialize_addrman(
|
||||
INCOMPATIBILITY_BASE = 32
|
||||
r = MAGIC_BYTES[net_magic]
|
||||
r += struct.pack("B", format)
|
||||
r += struct.pack("B", INCOMPATIBILITY_BASE + lowest_compatible)
|
||||
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("<i", (len_new or len(new)))
|
||||
r += struct.pack("<i", (len_tried or len(tried)))
|
||||
ADDRMAN_NEW_BUCKET_COUNT = 1 << 10
|
||||
r += struct.pack("<i", ADDRMAN_NEW_BUCKET_COUNT ^ (1 << 30))
|
||||
r += struct.pack("<i", (ADDRMAN_NEW_BUCKET_COUNT ^ (1 << 30)))
|
||||
for _ in range(ADDRMAN_NEW_BUCKET_COUNT):
|
||||
r += struct.pack("<i", 0)
|
||||
r += struct.pack("<i", (0))
|
||||
checksum = hash256(r)
|
||||
r += mock_checksum or checksum
|
||||
return r
|
||||
|
||||
Reference in New Issue
Block a user