2525 BLOCKS_BY_ROOT_PROTOCOL_V1 ,
2626 STATUS_PROTOCOL_V1 ,
2727 BlocksByRootRequest ,
28- BlocksByRootRequestRoots ,
28+ RequestedBlockRoots ,
2929 Status ,
3030)
3131from lean_spec .types import Bytes32
@@ -354,7 +354,7 @@ async def lookup(root: Bytes32) -> SignedBlockWithAttestation | None:
354354 response = MockResponseStream ()
355355
356356 request = BlocksByRootRequest (
357- roots = BlocksByRootRequestRoots (data = [Bytes32 (b"\x11 " * 32 ), Bytes32 (b"\x22 " * 32 )])
357+ roots = RequestedBlockRoots (data = [Bytes32 (b"\x11 " * 32 ), Bytes32 (b"\x22 " * 32 )])
358358 )
359359
360360 await handler .handle_blocks_by_root (request , response )
@@ -390,7 +390,7 @@ async def lookup(root: Bytes32) -> SignedBlockWithAttestation | None:
390390
391391 # Request two blocks, only one exists
392392 request = BlocksByRootRequest (
393- roots = BlocksByRootRequestRoots (
393+ roots = RequestedBlockRoots (
394394 data = [
395395 Bytes32 (b"\x11 " * 32 ), # exists
396396 Bytes32 (b"\x99 " * 32 ), # missing
@@ -415,9 +415,7 @@ async def run_test() -> tuple[list[bytes], list[tuple[ResponseCode, str]]]:
415415 handler = DefaultRequestHandler () # No block_lookup set
416416 response = MockResponseStream ()
417417
418- request = BlocksByRootRequest (
419- roots = BlocksByRootRequestRoots (data = [Bytes32 (b"\x11 " * 32 )])
420- )
418+ request = BlocksByRootRequest (roots = RequestedBlockRoots (data = [Bytes32 (b"\x11 " * 32 )]))
421419
422420 await handler .handle_blocks_by_root (request , response )
423421
@@ -440,7 +438,7 @@ async def lookup(root: Bytes32) -> SignedBlockWithAttestation | None:
440438 handler = DefaultRequestHandler (block_lookup = lookup )
441439 response = MockResponseStream ()
442440
443- request = BlocksByRootRequest (roots = BlocksByRootRequestRoots (data = []))
441+ request = BlocksByRootRequest (roots = RequestedBlockRoots (data = []))
444442
445443 await handler .handle_blocks_by_root (request , response )
446444
@@ -469,7 +467,7 @@ async def lookup(root: Bytes32) -> SignedBlockWithAttestation | None:
469467
470468 # First block causes error, second succeeds
471469 request = BlocksByRootRequest (
472- roots = BlocksByRootRequestRoots (data = [Bytes32 (b"\x11 " * 32 ), Bytes32 (b"\x22 " * 32 )])
470+ roots = RequestedBlockRoots (data = [Bytes32 (b"\x11 " * 32 ), Bytes32 (b"\x22 " * 32 )])
473471 )
474472
475473 await handler .handle_blocks_by_root (request , response )
@@ -546,7 +544,7 @@ async def lookup(root: Bytes32) -> SignedBlockWithAttestation | None:
546544 server = ReqRespServer (handler = handler )
547545
548546 # Build wire-format request
549- request = BlocksByRootRequest (roots = BlocksByRootRequestRoots (data = [root1 ]))
547+ request = BlocksByRootRequest (roots = RequestedBlockRoots (data = [root1 ]))
550548 request_bytes = encode_request (request .encode_bytes ())
551549
552550 stream = MockStream (request_data = request_bytes )
@@ -794,7 +792,7 @@ async def lookup(root: Bytes32) -> SignedBlockWithAttestation | None:
794792 server = ReqRespServer (handler = handler )
795793
796794 # Client side: encode request
797- request = BlocksByRootRequest (roots = BlocksByRootRequestRoots (data = [root1 , root2 ]))
795+ request = BlocksByRootRequest (roots = RequestedBlockRoots (data = [root1 , root2 ]))
798796 request_wire = encode_request (request .encode_bytes ())
799797
800798 # Server side: handle request
@@ -835,9 +833,7 @@ async def lookup(root: Bytes32) -> SignedBlockWithAttestation | None:
835833 server = ReqRespServer (handler = handler )
836834
837835 # Request two blocks, only one exists
838- request = BlocksByRootRequest (
839- roots = BlocksByRootRequestRoots (data = [root1 , root_missing ])
840- )
836+ request = BlocksByRootRequest (roots = RequestedBlockRoots (data = [root1 , root_missing ]))
841837 request_wire = encode_request (request .encode_bytes ())
842838
843839 stream = MockStream (request_data = request_wire )
@@ -1190,7 +1186,7 @@ async def lookup(r: Bytes32) -> SignedBlockWithAttestation | None:
11901186 handler = DefaultRequestHandler (block_lookup = lookup )
11911187 response = MockResponseStream ()
11921188
1193- request = BlocksByRootRequest (roots = BlocksByRootRequestRoots (data = [root ]))
1189+ request = BlocksByRootRequest (roots = RequestedBlockRoots (data = [root ]))
11941190
11951191 await handler .handle_blocks_by_root (request , response )
11961192
@@ -1215,7 +1211,7 @@ async def lookup(root: Bytes32) -> SignedBlockWithAttestation | None:
12151211 response = MockResponseStream ()
12161212
12171213 request = BlocksByRootRequest (
1218- roots = BlocksByRootRequestRoots (
1214+ roots = RequestedBlockRoots (
12191215 data = [
12201216 Bytes32 (b"\x11 " * 32 ),
12211217 Bytes32 (b"\x22 " * 32 ),
@@ -1253,7 +1249,7 @@ async def lookup(root: Bytes32) -> SignedBlockWithAttestation | None:
12531249 response = MockResponseStream ()
12541250
12551251 request = BlocksByRootRequest (
1256- roots = BlocksByRootRequestRoots (
1252+ roots = RequestedBlockRoots (
12571253 data = [
12581254 Bytes32 (b"\x11 " * 32 ),
12591255 Bytes32 (b"\x22 " * 32 ),
@@ -1374,7 +1370,7 @@ async def lookup(r: Bytes32) -> SignedBlockWithAttestation | None:
13741370
13751371 # BlocksByRoot request
13761372 blocks_request = encode_request (
1377- BlocksByRootRequest (roots = BlocksByRootRequestRoots (data = [root ])).encode_bytes ()
1373+ BlocksByRootRequest (roots = RequestedBlockRoots (data = [root ])).encode_bytes ()
13781374 )
13791375 blocks_stream = MockStream (request_data = blocks_request )
13801376
0 commit comments