From a98c95cef8406b1a6576307d5d9b19a3cdbbf672 Mon Sep 17 00:00:00 2001 From: Nikolai Golub Date: Tue, 1 Aug 2023 20:53:46 +0200 Subject: [PATCH] Remove array_windows feature to be closer to stable rust --- adapters/celestia/src/lib.rs | 1 - adapters/celestia/src/verifier/mod.rs | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/adapters/celestia/src/lib.rs b/adapters/celestia/src/lib.rs index efb60d8ec..56c2d6af8 100644 --- a/adapters/celestia/src/lib.rs +++ b/adapters/celestia/src/lib.rs @@ -1,4 +1,3 @@ -#![feature(array_windows)] #![feature(array_chunks)] pub mod celestia; pub mod shares; diff --git a/adapters/celestia/src/verifier/mod.rs b/adapters/celestia/src/verifier/mod.rs index 44131c699..8c4d3035d 100644 --- a/adapters/celestia/src/verifier/mod.rs +++ b/adapters/celestia/src/verifier/mod.rs @@ -174,8 +174,10 @@ impl da::DaVerifier for CelestiaVerifier { // Verify each sub-proof and flatten the shares back into a sequential array // First, enforce that the sub-proofs cover a contiguous range of shares - for [l, r] in tx_proof.proof.array_windows::<2>() { - assert_eq!(l.start_share_idx + l.shares.len(), r.start_share_idx) + for i in 1..tx_proof.proof.len() { + let l = &tx_proof.proof[i - 1]; + let r = &tx_proof.proof[i]; + assert_eq!(l.start_share_idx + l.shares.len(), r.start_share_idx); } let mut tx_shares = Vec::new(); // Then, verify the sub proofs