Skip to content

Commit 2959292

Browse files
committed
refactor: update aligned agg layer integration to new sdk
1 parent 9c501e5 commit 2959292

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

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

Lines changed: 15 additions & 6 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(
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

0 commit comments

Comments
 (0)