test: Use int.to_bytes over struct packing

This is done in prepration for the scripted diff, which can not deal
with those lines.
This commit is contained in:
MarcoFalke committed 2024-05-07 15:40:41 +02:00
1 parent faf3cd659a
commit faf2a975ad
3 files changed
+5 -7

No files matched your search

+1 -2
View File
@@ -5,7 +5,6 @@
"""Test node responses to invalid network messages."""
import random
import struct
import time
from test_framework.messages import (
@@ -233,7 +232,7 @@ class InvalidMessagesTest(BitcoinTestFramework):
'208d')) # port
def test_addrv2_unrecognized_network(self):
now_hex = struct.pack('<I', int(time.time())).hex()
now_hex = int(time.time()).to_bytes(4, "little").hex()
self.test_addrv2('unrecognized network',
[
'received: addrv2 (25 bytes)',