Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
chore: fix clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
roynalnaruto committed Jun 30, 2023
1 parent d84a681 commit 9255055
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions zkevm-circuits/src/evm_circuit/util/memory_gadget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use halo2_proofs::{
circuit::Value,
plonk::{Error, Expression},
};
use itertools::Itertools;

/// Decodes the usable part of an address stored in a Word
pub(crate) mod address_low {
Expand Down Expand Up @@ -494,10 +495,16 @@ impl<F: Field, const MAX_BYTES: usize, const ADDR_SIZE_IN_BYTES: usize>
bytes: &[u8],
) -> Result<(), Error> {
assert_eq!(bytes.len(), MAX_BYTES);
for idx in 0..MAX_BYTES {
for (idx, ((byte_col, &byte_val), selector_col)) in self
.bytes
.iter()
.zip_eq(bytes.iter())
.zip_eq(self.selectors.iter())
.enumerate()
{
let selector = (addr_start + idx as u64) < addr_end;
self.selectors[idx].assign(region, offset, Value::known(F::from(selector as u64)))?;
self.bytes[idx].assign(region, offset, Value::known(F::from(bytes[idx] as u64)))?;
selector_col.assign(region, offset, Value::known(F::from(selector as u64)))?;
byte_col.assign(region, offset, Value::known(F::from(byte_val as u64)))?;
}

let is_empty = addr_start >= addr_end;
Expand Down

0 comments on commit 9255055

Please sign in to comment.