File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
crates/chain-orchestrator/src Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -650,7 +650,7 @@ impl<
650650 . get_block_by_number ( block_number. into ( ) )
651651 . full ( )
652652 . await ?
653- . expect ( "L2 head block must exist" )
653+ . ok_or ( ChainOrchestratorError :: L2BlockNotFoundInL2Client ( block_number ) ) ?
654654 . header
655655 . hash_slow ( ) ;
656656
@@ -1015,7 +1015,9 @@ impl<
10151015 . get_block_by_number ( current_head_block_number. into ( ) )
10161016 . full ( )
10171017 . await ?
1018- . expect ( "current head block must exist" ) ;
1018+ . ok_or ( ChainOrchestratorError :: L2BlockNotFoundInL2Client (
1019+ current_head_block_number,
1020+ ) ) ?;
10191021
10201022 // If the timestamp of the received block is less than or equal to the current head,
10211023 // we ignore it.
@@ -1077,7 +1079,7 @@ impl<
10771079 . get_block_by_number ( header. number . into ( ) )
10781080 . full ( )
10791081 . await ?
1080- . expect ( "block must exist" )
1082+ . ok_or ( ChainOrchestratorError :: L2BlockNotFoundInL2Client ( header . number ) ) ?
10811083 . into_consensus ( )
10821084 . map_transactions ( |tx| tx. inner . into_inner ( ) ) ;
10831085
You can’t perform that action at this time.
0 commit comments