Skip to content

Commit acf5840

Browse files
committed
refactor: update aligned agg layer integration to new sdk
1 parent a11d534 commit acf5840

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

examples/L2/crates/l2/src/aligned.rs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff 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(
96+
&verification_data,
9697
config.network.clone(),
9798
config.eth_rpc_url.clone(),
9899
config.beacon_client_url.clone(),
99100
None,
100-
&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

0 commit comments

Comments
 (0)