From ad0120e5a0f3d9f00f1b2ae174a54806d8aef5c3 Mon Sep 17 00:00:00 2001 From: Nikolai Golub Date: Tue, 1 Aug 2023 23:20:47 +0200 Subject: [PATCH] Remove array_windows feature to be closer to stable rust (#606) Co-authored-by: Preston Evans <32944016+preston-evans98@users.noreply.github.com> --- 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 bb1d308c1..23e284287 100644 --- a/adapters/celestia/src/lib.rs +++ b/adapters/celestia/src/lib.rs @@ -1,4 +1,3 @@ -#![feature(array_windows)] pub mod celestia; pub mod shares; pub use celestia::*; 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