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
2024-02-07 11:20:41 +01:00
parent faf3cd659a
commit faf2a975ad
3 changed files with 5 additions and 7 deletions

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)',