From ab175094e05b5e5a5f841152c7ec7cf0dc12b28b Mon Sep 17 00:00:00 2001 From: miha-stopar Date: Fri, 19 Apr 2024 08:53:36 +0200 Subject: [PATCH] clippy fixes --- bin/mpt-test/src/circuit/witness.rs | 2 +- zkevm-circuits/src/mpt_circuit/account_leaf.rs | 2 +- zkevm-circuits/src/mpt_circuit/helpers.rs | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/bin/mpt-test/src/circuit/witness.rs b/bin/mpt-test/src/circuit/witness.rs index 831e91ee64..214ed206b3 100644 --- a/bin/mpt-test/src/circuit/witness.rs +++ b/bin/mpt-test/src/circuit/witness.rs @@ -7,7 +7,7 @@ use std::{ time::Duration, }; -use ethers::core::utils; + use eth_types::{Field, ToScalar}; diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index b611500ffb..1c1b9af253 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -1,5 +1,5 @@ use eth_types::{Field, OpsIdentity, U256}; -use gadgets::util::{pow, xor, Scalar}; +use gadgets::util::{pow, Scalar}; use halo2_proofs::{ circuit::Value, plonk::{Error, Expression, VirtualCells}, diff --git a/zkevm-circuits/src/mpt_circuit/helpers.rs b/zkevm-circuits/src/mpt_circuit/helpers.rs index 67350da413..cfd4262e60 100644 --- a/zkevm-circuits/src/mpt_circuit/helpers.rs +++ b/zkevm-circuits/src/mpt_circuit/helpers.rs @@ -615,6 +615,7 @@ impl ParentData { parent_data } + #[allow(clippy::too_many_arguments)] pub(crate) fn store>( cb: &mut MPTConstraintBuilder, memory: &mut MB, @@ -1454,14 +1455,12 @@ impl WrongExtNodeGadget { .0; let mut mult = key_data.mult; - if !key_data.is_odd { - if key_data.num_nibbles > 1 { - let iters = (key_data.num_nibbles - 1 - 1) / 2; // -1 because of the branch nibble, -1 because of being odd - mult = F::one(); + if !key_data.is_odd && key_data.num_nibbles > 1 { + let iters = (key_data.num_nibbles - 1 - 1) / 2; // -1 because of the branch nibble, -1 because of being odd + mult = F::one(); - for _ in 0..iters { - mult = mult * region.key_r; - } + for _ in 0..iters { + mult *= region.key_r; } } let _ = self.mult_without_branch_nibble.assign(region, offset, mult);