File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
examples/L2/crates/l2/src Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -92,19 +92,28 @@ pub async fn wait_until_proof_is_aggregated(
9292 let mut merkle_path = vec ! [ ] ;
9393
9494 while stream. next ( ) . await . is_some ( ) {
95- if let Some ( merkle_proof ) = aligned_sdk:: aggregation_layer:: get_merkle_path_for_proof (
95+ let proof_status = aligned_sdk:: aggregation_layer:: check_proof_verification (
9696 config. network . clone ( ) ,
9797 config. eth_rpc_url . clone ( ) ,
9898 config. beacon_client_url . clone ( ) ,
9999 None ,
100100 & verification_data,
101101 )
102102 . await
103- . expect ( "Get merkle path for proof" )
104- {
105- merkle_path = merkle_proof;
106- break ;
107- } ;
103+ . expect ( "Get merkle path for proof" ) ;
104+
105+ match proof_status {
106+ aligned_sdk:: aggregation_layer:: ProofStatus :: Verified {
107+ merkle_path : path, ..
108+ } => {
109+ merkle_path = path;
110+ break ;
111+ }
112+ aligned_sdk:: aggregation_layer:: ProofStatus :: Invalid => {
113+ panic ! ( "Proof did pass merkle root verification" )
114+ }
115+ aligned_sdk:: aggregation_layer:: ProofStatus :: NotFound => continue ,
116+ }
108117 }
109118
110119 merkle_path
You can’t perform that action at this time.
0 commit comments