Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani committed Mar 5, 2024
1 parent 0010b48 commit daceb64
Show file tree
Hide file tree
Showing 42 changed files with 9 additions and 71 deletions.
4 changes: 0 additions & 4 deletions plonky2x/core/src/backend/circuit/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,7 @@ impl<L: PlonkParameters<D>, const D: usize> CircuitBuild<L, D> {
#[cfg(test)]
pub(crate) mod tests {

use plonky2::field::types::Field;

use crate::backend::circuit::serialization::{GateRegistry, HintRegistry};
use crate::backend::circuit::CircuitBuild;
use crate::frontend::builder::DefaultBuilder;
use crate::prelude::*;

type L = DefaultParameters;
Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/backend/circuit/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ impl<L: PlonkParameters<D>, const D: usize> MockCircuitBuild<L, D> {
pub(crate) mod tests {

use log::debug;
use plonky2::field::types::Field;

use crate::prelude::*;
use crate::utils;
Expand Down
2 changes: 1 addition & 1 deletion plonky2x/core/src/backend/function/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::backend::circuit::*;
use crate::backend::function::args::{Args, Commands};
use crate::backend::wrapper::wrap::WrappedCircuit;
use crate::frontend::builder::CircuitIO;
use crate::prelude::{CircuitBuilder, GateRegistry, HintRegistry};
use crate::prelude::CircuitBuilder;

/// `Plonky2xFunction`s have all necessary code for a circuit to be deployed end-to-end.
pub trait Plonky2xFunction {
Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/backend/wrapper/wrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ impl<L: PlonkParameters<D>, const D: usize> WrappedOutput<L, D> {
mod tests {
use super::*;
use crate::backend::circuit::{DefaultParameters, Groth16WrapperParameters};
use crate::frontend::builder::CircuitBuilder;
use crate::utils;

#[test]
Expand Down
2 changes: 0 additions & 2 deletions plonky2x/core/src/frontend/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,7 @@ impl<L: PlonkParameters<D>, const D: usize> Default for CircuitBuilder<L, D> {
pub(crate) mod tests {

use log::debug;
use plonky2::field::types::Field;

use super::DefaultBuilder;
use crate::prelude::*;
use crate::utils;

Expand Down
3 changes: 0 additions & 3 deletions plonky2x/core/src/frontend/builder/permutation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,7 @@ impl<L: PlonkParameters<D>, const D: usize> CircuitBuilder<L, D> {
#[cfg(test)]
pub(crate) mod tests {

use plonky2::field::types::Field;

use crate::frontend::extension::CubicExtensionVariable;
use crate::frontend::uint::uint32::U32Variable;
use crate::prelude::*;
use crate::utils;

Expand Down
2 changes: 0 additions & 2 deletions plonky2x/core/src/frontend/builder/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ impl<L: PlonkParameters<D>, V: CircuitVariable, const D: usize> SimpleGenerator<
#[cfg(test)]
mod tests {
use log::{debug, Level};
use plonky2::field::types::Field;

use crate::frontend::builder::DefaultBuilder;
use crate::prelude::*;
use crate::utils;

Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/frontend/curta/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ impl<L: PlonkParameters<D>, const D: usize> CircuitBuilder<L, D> {

#[cfg(test)]
mod tests {
use plonky2::field::goldilocks_field::GoldilocksField;
use plonky2::util::timing::TimingTree;
use serde::{Deserialize, Serialize};
use starkyx::chip::memory::time::Time;
Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/frontend/curta/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,6 @@ mod tests {
use starkyx::chip::register::element::ElementRegister;
use starkyx::chip::register::{Register, RegisterSerializable};
use starkyx::chip::trace::generator::ArithmeticGenerator;
use starkyx::chip::AirParameters;
use starkyx::math::goldilocks::cubic::GoldilocksCubicParameters;
use starkyx::plonky2::stark::config::{
CurtaPoseidonGoldilocksConfig, PoseidonGoldilocksStarkConfig,
Expand Down
2 changes: 1 addition & 1 deletion plonky2x/core/src/frontend/eth/beacon/vars/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ mod test {
use ethers::types::U64;

use super::*;
use crate::prelude::{CircuitBuilder, DefaultParameters, PlonkParameters};
use crate::prelude::DefaultParameters;
use crate::utils::eth::beacon::BeaconClient;

type L = DefaultParameters;
Expand Down
2 changes: 1 addition & 1 deletion plonky2x/core/src/frontend/eth/mpt/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ mod tests {
use ethers::types::Bytes;

use super::super::utils::{read_fixture, EIP1186ProofResponse};
use super::{get, *};
use super::*;
use crate::frontend::eth::utils::u256_to_h256_be;
use crate::utils::bytes32;

Expand Down
3 changes: 1 addition & 2 deletions plonky2x/core/src/frontend/hash/blake2/curta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ use starkyx::machine::hash::blake::blake2b::pure::BLAKE2BPure;
use starkyx::machine::hash::blake::blake2b::utils::BLAKE2BUtil;
use starkyx::machine::hash::blake::blake2b::BLAKE2B;

use crate::backend::circuit::PlonkParameters;
use crate::frontend::hash::curta::accelerator::HashAccelerator;
use crate::frontend::hash::curta::request::HashRequest;
use crate::frontend::hash::curta::Hash;
use crate::frontend::vars::{Bytes32Variable, EvmVariable};
use crate::frontend::vars::EvmVariable;
use crate::prelude::*;

pub type BLAKE2BAccelerator = HashAccelerator<U64Variable, 4>;
Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/frontend/hash/keccak/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ mod tests {

use super::*;
use crate::backend::circuit::DefaultParameters;
use crate::prelude::CircuitBuilder;
use crate::utils::bytes32;

type L = DefaultParameters;
Expand Down
3 changes: 1 addition & 2 deletions plonky2x/core/src/frontend/hash/sha/sha256/curta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ mod tests {
use ethers::types::H256;
use rand::{thread_rng, Rng};

use crate::backend::circuit::{CircuitBuild, DefaultParameters};
use crate::frontend::vars::Bytes32Variable;
use crate::backend::circuit::CircuitBuild;
use crate::prelude::*;
use crate::utils::hash::sha256;
use crate::utils::{bytes, bytes32};
Expand Down
2 changes: 1 addition & 1 deletion plonky2x/core/src/frontend/hash/sha/sha256/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ mod tests {
use rand::{thread_rng, Rng};

use super::*;
use crate::prelude::{ByteVariable, CircuitBuilder, DefaultParameters, U32Variable};
use crate::prelude::{DefaultParameters, U32Variable};
use crate::utils::hash::sha256;

type L = DefaultParameters;
Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/frontend/hint/simple/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ mod tests {
use serde::{Deserialize, Serialize};

use super::*;
use crate::frontend::vars::ValueStream;
use crate::prelude::*;

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/frontend/hint/simple/serializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ mod tests {

use super::*;
use crate::backend::circuit::CircuitBuild;
use crate::frontend::vars::ValueStream;
use crate::prelude::*;

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/frontend/hint/synchronous.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ mod tests {
use serde::{Deserialize, Serialize};

use super::*;
use crate::frontend::vars::{ValueStream, VariableStream};
use crate::prelude::*;

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/frontend/merkle/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ mod tests {

use std::env;

use crate::backend::circuit::DefaultParameters;
use crate::frontend::merkle::simple::SimpleMerkleTree;
use crate::prelude::*;

Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/frontend/merkle/tendermint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ mod tests {
use ethers::types::H256;
use itertools::Itertools;

use crate::backend::circuit::DefaultParameters;
use crate::frontend::merkle::tendermint::TendermintMerkleTree;
use crate::frontend::merkle::tree::{InclusionProof, MerkleInclusionProofVariable};
use crate::prelude::*;
Expand Down
2 changes: 0 additions & 2 deletions plonky2x/core/src/frontend/merkle/tree.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use plonky2::hash::hash_types::RichField;

use crate::prelude::*;

#[derive(Clone, Debug, CircuitVariable)]
Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/frontend/recursion/extension.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use plonky2::field::extension::FieldExtension;
use plonky2::iop::ext_target::ExtensionTarget;

use crate::frontend::vars::ValueStream;
use crate::prelude::*;

#[derive(Debug, Clone, Eq, PartialEq, CircuitVariable)]
Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/frontend/recursion/fri/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ impl<const D: usize> From<FriProofVariable<D>> for FriProofTarget<D> {

#[cfg(test)]
mod tests {
use plonky2::fri::proof::FriProofTarget;
use plonky2::hash::poseidon::PoseidonHash;
use plonky2::plonk::plonk_common::salt_size;

Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/frontend/recursion/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use plonky2::hash::merkle_tree::MerkleCap;
use plonky2::plonk::config::AlgebraicHasher;

use crate::frontend::hash::poseidon::poseidon256::PoseidonHashOutVariable;
use crate::frontend::vars::{OutputVariableStream, VariableStream};
use crate::prelude::*;

#[derive(Clone, Debug, Eq, PartialEq)]
Expand Down
3 changes: 1 addition & 2 deletions plonky2x/core/src/frontend/uint/num/biguint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,8 @@ impl ReadBigUint for Buffer<'_> {

#[cfg(test)]
mod tests {
use num::{BigUint, FromPrimitive, Integer};
use num::FromPrimitive;
use plonky2::iop::witness::PartialWitness;
use plonky2::plonk::circuit_builder::CircuitBuilder;
use plonky2::plonk::circuit_data::CircuitConfig;
use plonky2::plonk::config::{GenericConfig, PoseidonGoldilocksConfig};
use rand::rngs::OsRng;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use alloc::string::{String, ToString};
use alloc::vec;
use alloc::vec::Vec;
use core::marker::PhantomData;

use plonky2::field::extension::Extendable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use alloc::vec;
use alloc::vec::Vec;

use plonky2::field::extension::Extendable;
use plonky2::hash::hash_types::RichField;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use alloc::vec;
use alloc::vec::Vec;

use plonky2::field::extension::Extendable;
use plonky2::hash::hash_types::RichField;
Expand Down
2 changes: 0 additions & 2 deletions plonky2x/core/src/frontend/uint/num/u32/gates/add_many_u32.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use alloc::format;
use alloc::string::{String, ToString};
use alloc::vec::Vec;
use core::marker::PhantomData;

use itertools::unfold;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use alloc::string::{String, ToString};
use alloc::vec::Vec;
use alloc::{format, vec};
use core::marker::PhantomData;

Expand Down
2 changes: 0 additions & 2 deletions plonky2x/core/src/frontend/uint/num/u32/gates/comparison.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use alloc::string::{String, ToString};
use alloc::vec::Vec;
use alloc::{format, vec};
use core::marker::PhantomData;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use alloc::string::{String, ToString};
use alloc::vec::Vec;
use alloc::{format, vec};
use core::marker::PhantomData;

Expand Down Expand Up @@ -242,7 +240,7 @@ mod tests {
use itertools::unfold;
use plonky2::field::extension::quartic::QuarticExtension;
use plonky2::field::goldilocks_field::GoldilocksField;
use plonky2::field::types::{Field, Sample};
use plonky2::field::types::Sample;
use plonky2::gates::gate_testing::{test_eval_fns, test_low_degree};
use plonky2::hash::hash_types::HashOut;
use plonky2::plonk::config::{GenericConfig, PoseidonGoldilocksConfig};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use alloc::string::{String, ToString};
use alloc::vec::Vec;
use alloc::{format, vec};
use core::marker::PhantomData;

Expand Down
2 changes: 0 additions & 2 deletions plonky2x/core/src/frontend/uint/num/u32/serialization.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use alloc::vec::Vec;

use plonky2::util::serialization::{Buffer, IoResult, Read, Write};

use crate::frontend::uint::num::u32::gadgets::arithmetic_u32::U32Target;
Expand Down
8 changes: 1 addition & 7 deletions plonky2x/core/src/frontend/uint/uint32.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
use std::fmt::Debug;

use itertools::Itertools;
use plonky2::hash::hash_types::RichField;
use plonky2::iop::target::BoolTarget;

use super::uint64::U64Variable;
use crate::backend::circuit::PlonkParameters;
use crate::frontend::builder::CircuitBuilder;
use crate::frontend::uint::num::biguint::{BigUintTarget, CircuitBuilderBiguint};
use crate::frontend::uint::num::u32::gadgets::arithmetic_u32::{CircuitBuilderU32, U32Target};
use crate::frontend::uint::num::u32::gadgets::multiple_comparison::list_lte_circuit;
use crate::frontend::vars::{CircuitVariable, EvmVariable, Variable};
use crate::frontend::vars::EvmVariable;
use crate::prelude::*;

/// A variable in the circuit representing a u32 value.
Expand Down Expand Up @@ -277,8 +273,6 @@ impl U32Variable {
mod tests {
use rand::Rng;

use super::U32Variable;
use crate::backend::circuit::DefaultParameters;
use crate::frontend::vars::EvmVariable;
use crate::prelude::*;
use crate::utils::setup_logger;
Expand Down
3 changes: 0 additions & 3 deletions plonky2x/core/src/frontend/vars/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,10 @@ mod tests {

use ethers::types::U256;
use log::debug;
use plonky2::field::types::Field;
use rand::rngs::OsRng;
use rand::Rng;

use super::*;
use crate::backend::circuit::DefaultParameters;
use crate::frontend::vars::U256Variable;
use crate::prelude::*;
use crate::utils;

Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/frontend/vars/boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ impl<L: PlonkParameters<D>, const D: usize> Not<L, D> for BoolVariable {

#[cfg(test)]
mod tests {
use crate::backend::circuit::DefaultParameters;
use crate::prelude::*;

type L = DefaultParameters;
Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/frontend/vars/byte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ impl<L: PlonkParameters<D>, const D: usize> Zero<L, D> for ByteVariable {
mod tests {
use itertools::Itertools;

use crate::backend::circuit::DefaultParameters;
use crate::prelude::*;

type L = DefaultParameters;
Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/frontend/vars/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ impl<L: PlonkParameters<D>, const D: usize, const N: usize> RotateRight<L, D, us
mod tests {
use rand::{thread_rng, Rng};

use crate::backend::circuit::DefaultParameters;
use crate::prelude::*;

type L = DefaultParameters;
Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/frontend/vars/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ pub trait SSZVariable: CircuitVariable {

#[cfg(test)]
mod tests {
use crate::frontend::vars::ArrayVariable;
use crate::prelude::*;

#[test]
Expand Down
1 change: 0 additions & 1 deletion plonky2x/core/src/utils/eth/beacon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,6 @@ mod tests {

use std::env;

use anyhow::Result;
use log::debug;

use super::*;
Expand Down
3 changes: 0 additions & 3 deletions plonky2x/core/src/utils/lido/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use alloc::sync::Arc;
use std::convert::TryFrom;

use anyhow::Result;
use ethers::prelude::*;
use ethers::providers::{Http, Middleware, Provider};
use ethers::types::{Address, H256, U256};
use ethers::utils::keccak256;
use log::info;

Expand Down

0 comments on commit daceb64

Please sign in to comment.