@@ -276,7 +276,7 @@ async def test_stop_cancels_pending_requests(self, local_node_id, local_private_
276276 loop = asyncio .get_running_loop ()
277277 future : asyncio .Future = loop .create_future ()
278278 pending = PendingRequest (
279- request_id = b"\x01 \x02 \x03 \x04 " ,
279+ request_id = RequestId ( data = b"\x01 \x02 \x03 \x04 " ) ,
280280 dest_node_id = NodeId (bytes (32 )),
281281 sent_at = loop .time (),
282282 nonce = Nonce (bytes (12 )),
@@ -315,15 +315,15 @@ def test_create_pending_request(self):
315315 message = Ping (request_id = RequestId (data = b"\x01 " ), enr_seq = SeqNumber (1 ))
316316
317317 pending = PendingRequest (
318- request_id = b"\x01 \x02 \x03 \x04 " ,
318+ request_id = RequestId ( data = b"\x01 \x02 \x03 \x04 " ) ,
319319 dest_node_id = NodeId (bytes (32 )),
320320 sent_at = 123.456 ,
321321 nonce = Nonce (bytes (12 )),
322322 message = message ,
323323 future = future ,
324324 )
325325
326- assert pending .request_id == b"\x01 \x02 \x03 \x04 "
326+ assert pending .request_id == RequestId ( data = b"\x01 \x02 \x03 \x04 " )
327327 assert pending .dest_node_id == bytes (32 )
328328 assert pending .sent_at == 123.456
329329 assert pending .nonce == bytes (12 )
@@ -407,7 +407,7 @@ def test_pending_multi_request_creation(self, local_node_id, local_private_key,
407407 queue : asyncio .Queue = asyncio .Queue ()
408408
409409 pending = PendingMultiRequest (
410- request_id = b"\x01 \x02 \x03 \x04 " ,
410+ request_id = RequestId ( data = b"\x01 \x02 \x03 \x04 " ) ,
411411 dest_node_id = NodeId (bytes (32 )),
412412 sent_at = 123.456 ,
413413 nonce = Nonce (bytes (12 )),
@@ -417,7 +417,7 @@ def test_pending_multi_request_creation(self, local_node_id, local_private_key,
417417 received_count = 0 ,
418418 )
419419
420- assert pending .request_id == b"\x01 \x02 \x03 \x04 "
420+ assert pending .request_id == RequestId ( data = b"\x01 \x02 \x03 \x04 " )
421421 assert pending .expected_total is None
422422 assert pending .received_count == 0
423423
@@ -430,7 +430,7 @@ def test_pending_multi_request_expected_total_tracking(self):
430430 queue : asyncio .Queue = asyncio .Queue ()
431431
432432 pending = PendingMultiRequest (
433- request_id = b"\x01 \x02 \x03 \x04 " ,
433+ request_id = RequestId ( data = b"\x01 \x02 \x03 \x04 " ) ,
434434 dest_node_id = NodeId (bytes (32 )),
435435 sent_at = 123.456 ,
436436 nonce = Nonce (bytes (12 )),
@@ -466,7 +466,7 @@ async def test_queue():
466466 queue : asyncio .Queue = asyncio .Queue ()
467467
468468 pending = PendingMultiRequest (
469- request_id = b"\x01 \x02 \x03 \x04 " ,
469+ request_id = RequestId ( data = b"\x01 \x02 \x03 \x04 " ) ,
470470 dest_node_id = NodeId (bytes (32 )),
471471 sent_at = 123.456 ,
472472 nonce = Nonce (bytes (12 )),
@@ -572,7 +572,7 @@ def test_pending_request_stores_request_id(self):
572572 message = Ping (request_id = RequestId (data = b"\x01 \x02 \x03 \x04 " ), enr_seq = SeqNumber (1 ))
573573
574574 pending = PendingRequest (
575- request_id = b"\x01 \x02 \x03 \x04 " ,
575+ request_id = RequestId ( data = b"\x01 \x02 \x03 \x04 " ) ,
576576 dest_node_id = NodeId (bytes (32 )),
577577 sent_at = 123.456 ,
578578 nonce = Nonce (bytes (12 )),
@@ -581,8 +581,8 @@ def test_pending_request_stores_request_id(self):
581581 )
582582
583583 # Request ID should be stored for matching.
584- assert pending .request_id == b"\x01 \x02 \x03 \x04 "
585- assert bytes ( pending .message .request_id ) == b"\x01 \x02 \x03 \x04 "
584+ assert pending .request_id == RequestId ( data = b"\x01 \x02 \x03 \x04 " )
585+ assert pending .message .request_id == RequestId ( data = b"\x01 \x02 \x03 \x04 " )
586586
587587 loop .close ()
588588
@@ -596,7 +596,7 @@ async def test_future():
596596
597597 message = Ping (request_id = RequestId (data = b"\x01 " ), enr_seq = SeqNumber (1 ))
598598 pending = PendingRequest (
599- request_id = b"\x01 " ,
599+ request_id = RequestId ( data = b"\x01 " ) ,
600600 dest_node_id = NodeId (bytes (32 )),
601601 sent_at = loop .time (),
602602 nonce = Nonce (bytes (12 )),
@@ -632,7 +632,7 @@ def test_pending_request_future_cancellation(self):
632632
633633 message = Ping (request_id = RequestId (data = b"\x01 " ), enr_seq = SeqNumber (1 ))
634634 pending = PendingRequest (
635- request_id = b"\x01 " ,
635+ request_id = RequestId ( data = b"\x01 " ) ,
636636 dest_node_id = NodeId (bytes (32 )),
637637 sent_at = loop .time (),
638638 nonce = Nonce (bytes (12 )),
@@ -663,7 +663,7 @@ def test_request_id_bytes_for_dict_lookup(self):
663663 message2 = Ping (request_id = RequestId (data = request_id_2 ), enr_seq = SeqNumber (2 ))
664664
665665 pending1 = PendingRequest (
666- request_id = request_id_1 ,
666+ request_id = RequestId ( data = request_id_1 ) ,
667667 dest_node_id = NodeId (bytes (32 )),
668668 sent_at = loop .time (),
669669 nonce = Nonce (bytes (12 )),
@@ -672,7 +672,7 @@ def test_request_id_bytes_for_dict_lookup(self):
672672 )
673673
674674 pending2 = PendingRequest (
675- request_id = request_id_2 ,
675+ request_id = RequestId ( data = request_id_2 ) ,
676676 dest_node_id = NodeId (bytes (32 )),
677677 sent_at = loop .time (),
678678 nonce = Nonce (bytes (12 )),
@@ -703,7 +703,7 @@ def test_pending_request_stores_nonce_for_whoareyou_matching(self):
703703
704704 message = Ping (request_id = RequestId (data = b"\x01 " ), enr_seq = SeqNumber (1 ))
705705 pending = PendingRequest (
706- request_id = b"\x01 " ,
706+ request_id = RequestId ( data = b"\x01 " ) ,
707707 dest_node_id = NodeId (bytes (32 )),
708708 sent_at = loop .time (),
709709 nonce = nonce ,
@@ -724,7 +724,7 @@ def test_pending_request_stores_message_for_retransmission(self):
724724
725725 message = Ping (request_id = RequestId (data = b"\x01 " ), enr_seq = SeqNumber (42 ))
726726 pending = PendingRequest (
727- request_id = b"\x01 " ,
727+ request_id = RequestId ( data = b"\x01 " ) ,
728728 dest_node_id = NodeId (bytes (32 )),
729729 sent_at = loop .time (),
730730 nonce = Nonce (bytes (12 )),
@@ -782,7 +782,7 @@ async def test_pending_requests_cleared_on_stop(
782782 for i in range (3 ):
783783 future : asyncio .Future = loop .create_future ()
784784 pending = PendingRequest (
785- request_id = bytes ([i ]),
785+ request_id = RequestId ( data = bytes ([i ]) ),
786786 dest_node_id = NodeId (bytes (32 )),
787787 sent_at = loop .time (),
788788 nonce = Nonce (bytes (12 )),
@@ -825,7 +825,7 @@ async def test_pending_request_futures_cancelled_on_stop(
825825 future : asyncio .Future = loop .create_future ()
826826 futures .append (future )
827827 pending = PendingRequest (
828- request_id = bytes ([i ]),
828+ request_id = RequestId ( data = bytes ([i ]) ),
829829 dest_node_id = NodeId (bytes (32 )),
830830 sent_at = loop .time (),
831831 nonce = Nonce (bytes (12 )),
@@ -1086,7 +1086,7 @@ async def test_response_completes_pending_request_future(
10861086
10871087 loop = asyncio .get_running_loop ()
10881088 future : asyncio .Future [Pong | None ] = loop .create_future ()
1089- request_id = b"\x01 \x02 \x03 \x04 "
1089+ request_id = RequestId ( data = b"\x01 \x02 \x03 \x04 " )
10901090
10911091 pending = PendingRequest (
10921092 request_id = request_id ,
@@ -1099,7 +1099,7 @@ async def test_response_completes_pending_request_future(
10991099 transport ._pending_requests [request_id ] = pending
11001100
11011101 pong = Pong (
1102- request_id = RequestId ( data = request_id ) ,
1102+ request_id = request_id ,
11031103 enr_seq = SeqNumber (1 ),
11041104 recipient_ip = IPv4 (b"\x7f \x00 \x00 \x01 " ),
11051105 recipient_port = Port (9000 ),
@@ -1121,7 +1121,7 @@ async def test_response_enqueued_for_multi_request(
11211121 local_enr = local_enr ,
11221122 )
11231123
1124- request_id = b"\x01 \x02 \x03 \x04 "
1124+ request_id = RequestId ( data = b"\x01 \x02 \x03 \x04 " )
11251125 queue : asyncio .Queue = asyncio .Queue ()
11261126
11271127 multi_pending = PendingMultiRequest (
@@ -1137,7 +1137,7 @@ async def test_response_enqueued_for_multi_request(
11371137 transport ._pending_multi_requests [request_id ] = multi_pending
11381138
11391139 nodes = Nodes (
1140- request_id = RequestId ( data = request_id ) ,
1140+ request_id = request_id ,
11411141 total = Uint8 (1 ),
11421142 enrs = [b"enr1" ],
11431143 )
0 commit comments