From eae85c11d5b59426dbffa49cd55000229f71d73e Mon Sep 17 00:00:00 2001 From: Fedor Sakharov Date: Fri, 22 Sep 2023 22:22:25 +0200 Subject: [PATCH] fix: l2 to l1 message should be searched by hash only (#197) --- client/src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index ecfedd93..359c7dd2 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -390,10 +390,7 @@ impl ZksyncMiddleware for Provider

{ let l2_to_l1_log_index = receipt .l2_to_l1_logs .iter() - .enumerate() - .filter(|(_, log)| log.value == l2_to_l1_message_hash) - .nth(index) - .map(|(i, _)| i) + .position(|l| l.value == l2_to_l1_message_hash) .ok_or(Error::L2ToL1WithValueNotFound( withdrawal_hash, l2_to_l1_message_hash,