Skip to content

Commit

Permalink
cargo fix (#401)
Browse files Browse the repository at this point in the history
This just runs cargo fix on the codebase.
  • Loading branch information
hackaugusto authored Nov 1, 2024
1 parent 04bbfd8 commit 83a12f6
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 72 deletions.
7 changes: 2 additions & 5 deletions mp2-common/src/digest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,14 @@ mod test {
use crate::{types::CBuilder, utils::FromFields, C, D, F};

use super::{
Digest, DigestTarget, SplitDigest, SplitDigestPoint, SplitDigestTarget, TableDimension,
Digest, DigestTarget, SplitDigestPoint, SplitDigestTarget, TableDimension,
TableDimensionWire,
};
use crate::utils::TryIntoBool;
use mp2_test::circuit::{run_circuit, UserCircuit};
use plonky2::{
field::types::Sample,
iop::{
target::BoolTarget,
witness::{PartialWitness, WitnessWrite},
},
iop::witness::PartialWitness,
};
use plonky2_ecgfp5::{
curve::curve::Point,
Expand Down
8 changes: 3 additions & 5 deletions mp2-common/src/group_hashing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,25 +236,23 @@ mod test {

use plonky2::{
field::types::Sample,
iop::{target::Target, witness::PartialWitness},
iop::witness::PartialWitness,
};
use plonky2_ecdsa::curve::curve_types::base_to_scalar;

use plonky2_ecgfp5::{
curve::curve::{Point, WeierstrassPoint},
gadgets::curve::{CircuitBuilderEcGFp5, CurveTarget, PartialWitnessCurve},
};

use crate::{
digest::DigestTarget,
types::CBuilder,
utils::{FromFields, FromTargets, ToFields, ToTargets},
utils::{FromFields, ToFields},
C, D, F,
};
use mp2_test::circuit::{run_circuit, UserCircuit};

use super::{
circuit_hashed_scalar_mul, field_hashed_scalar_mul, weierstrass_to_point,
CircuitBuilderGroupHashing,
};

#[derive(Clone, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion mp2-v1/tests/common/cases/indexing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::common::{
identifier_single_var_column,
table_source::{
LengthExtractionArgs, MappingIndex, MappingValuesExtractionArgs, MergeSource,
SingleValuesExtractionArgs, UniqueMappingEntry, DEFAULT_ADDRESS,
SingleValuesExtractionArgs, DEFAULT_ADDRESS,
},
},
proof_storage::{ProofKey, ProofStorage},
Expand Down
23 changes: 3 additions & 20 deletions mp2-v1/tests/common/cases/mod.rs
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
//! Define test cases
use alloy::primitives::{Address, U256};
use contract::Contract;
use indexing::{TableRowUpdate, TableRowValues};
use log::debug;
use mp2_common::eth::StorageSlot;
use mp2_v1::{
indexing::{
block::BlockPrimaryIndex,
cell::Cell,
row::{RowTreeKey, ToNonce},
ColumnID,
},
values_extraction::{
use mp2_v1::values_extraction::{
identifier_for_mapping_key_column, identifier_for_mapping_value_column,
identifier_single_var_column,
},
};
use serde::{Deserialize, Serialize};
};
use table_source::{ContractExtractionArgs, TableSource};

use super::{
rowtree::SecondaryIndexCell,
table::{CellsUpdate, Table},
TableInfo,
};
use super::table::Table;

pub mod contract;
pub mod indexing;
Expand Down
3 changes: 1 addition & 2 deletions mp2-v1/tests/common/cases/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use super::{
};
use alloy::primitives::U256;
use anyhow::{bail, Context, Result};
use futures::{future::BoxFuture, stream, FutureExt, StreamExt};
use futures::{stream, FutureExt, StreamExt};

use super::TableSource;
use itertools::Itertools;
Expand Down Expand Up @@ -76,7 +76,6 @@ use verifiable_db::{
},
},
revelation::PublicInputs,
row_tree,
};

pub const MAX_NUM_RESULT_OPS: usize = 20;
Expand Down
2 changes: 1 addition & 1 deletion mp2-v1/tests/common/cases/table_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use alloy::{
providers::Provider,
};
use anyhow::{bail, Result};
use futures::{future::BoxFuture, stream, FutureExt, StreamExt};
use futures::{future::BoxFuture, FutureExt, StreamExt};
use log::{debug, info};
use mp2_common::{
digest::TableDimension,
Expand Down
4 changes: 2 additions & 2 deletions verifiable-db/src/cells_tree/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
use super::{
empty_node::{EmptyNodeCircuit, EmptyNodeWires},
full_node::{FullNodeCircuit, FullNodeWires},
full_node::FullNodeWires,
leaf::{LeafCircuit, LeafWires},
partial_node::{PartialNodeCircuit, PartialNodeWires},
partial_node::PartialNodeWires,
public_inputs::PublicInputs,
Cell,
};
Expand Down
3 changes: 1 addition & 2 deletions verifiable-db/src/cells_tree/full_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use super::{public_inputs::PublicInputs, Cell, CellWire};
use anyhow::Result;
use derive_more::{From, Into};
use mp2_common::{
group_hashing::CircuitBuilderGroupHashing, public_inputs::PublicInputCommon, types::CBuilder,
u256::CircuitBuilderU256, utils::ToTargets, CHasher, D, F,
public_inputs::PublicInputCommon, types::CBuilder, utils::ToTargets, CHasher, D, F,
};
use plonky2::{
iop::{target::Target, witness::PartialWitness},
Expand Down
17 changes: 4 additions & 13 deletions verifiable-db/src/cells_tree/partial_node.rs
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
//! Module handling the intermediate node with 1 child inside a cells tree
use super::{public_inputs::PublicInputs, Cell, CellWire};
use alloy::primitives::U256;
use anyhow::Result;
use derive_more::{From, Into};
use mp2_common::{
group_hashing::CircuitBuilderGroupHashing,
poseidon::empty_poseidon_hash,
public_inputs::PublicInputCommon,
types::CBuilder,
u256::{CircuitBuilderU256, UInt256Target, WitnessWriteU256},
utils::ToTargets,
CHasher, D, F,
poseidon::empty_poseidon_hash, public_inputs::PublicInputCommon, types::CBuilder,
utils::ToTargets, CHasher, D, F,
};
use plonky2::{
iop::{
target::{BoolTarget, Target},
witness::{PartialWitness, WitnessWrite},
},
iop::{target::Target, witness::PartialWitness},
plonk::proof::ProofWithPublicInputsTarget,
};
use plonky2_ecgfp5::gadgets::curve::CircuitBuilderEcGFp5;
use recursion_framework::circuit_builder::CircuitLogicWires;
use serde::{Deserialize, Serialize};
use std::iter;
Expand Down Expand Up @@ -96,6 +86,7 @@ impl CircuitLogicWires<F, D, 1> for PartialNodeWires {
#[cfg(test)]
mod tests {
use super::*;
use alloy::primitives::U256;
use mp2_common::{
group_hashing::{add_curve_point, map_to_curve_point},
poseidon::H,
Expand Down
1 change: 0 additions & 1 deletion verifiable-db/src/row_tree/full_node.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use derive_more::{From, Into};
use mp2_common::{
default_config,
group_hashing::{cond_circuit_hashed_scalar_mul, CircuitBuilderGroupHashing},
poseidon::H,
proof::ProofWithVK,
public_inputs::PublicInputCommon,
Expand Down
3 changes: 1 addition & 2 deletions verifiable-db/src/row_tree/leaf.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use derive_more::{From, Into};
use mp2_common::{
default_config,
group_hashing::{cond_circuit_hashed_scalar_mul, CircuitBuilderGroupHashing},
poseidon::{empty_poseidon_hash, H},
proof::ProofWithVK,
public_inputs::PublicInputCommon,
Expand All @@ -10,7 +9,7 @@ use mp2_common::{
};
use plonky2::{
iop::{
target::{BoolTarget, Target},
target::Target,
witness::PartialWitness,
},
plonk::{circuit_builder::CircuitBuilder, proof::ProofWithPublicInputsTarget},
Expand Down
17 changes: 0 additions & 17 deletions verifiable-db/src/row_tree/mod.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
use alloy::primitives::U256;
use derive_more::Constructor;
use mp2_common::{
group_hashing::CircuitBuilderGroupHashing,
u256::{CircuitBuilderU256, UInt256Target, WitnessWriteU256},
utils::{ToFields, ToTargets},
D, F,
};
use plonky2::{
iop::{
target::{BoolTarget, Target},
witness::{PartialWitness, WitnessWrite},
},
plonk::circuit_builder::CircuitBuilder,
};
use plonky2_ecgfp5::gadgets::curve::CurveTarget;
use serde::{Deserialize, Serialize};

mod api;
mod full_node;
Expand Down
1 change: 0 additions & 1 deletion verifiable-db/src/row_tree/partial_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use plonky2::plonk::proof::ProofWithPublicInputsTarget;

use mp2_common::{
default_config,
group_hashing::{cond_circuit_hashed_scalar_mul, CircuitBuilderGroupHashing},
hash::hash_maybe_first,
poseidon::empty_poseidon_hash,
proof::ProofWithVK,
Expand Down

0 comments on commit 83a12f6

Please sign in to comment.