From d37eb0ca4d30ab3a12552c95060f6a7a95cfc442 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Wed, 15 Dec 2021 20:07:18 +0100 Subject: [PATCH] Clean imports Signed-off-by: Jakub Sztandera --- storage-proofs-update/src/circuit_poseidon.rs | 16 ++++++---------- storage-proofs-update/tests/common.rs | 14 ++++---------- storage-proofs-update/tests/compound.rs | 4 ++-- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/storage-proofs-update/src/circuit_poseidon.rs b/storage-proofs-update/src/circuit_poseidon.rs index 3468f71854..d1268cd5be 100644 --- a/storage-proofs-update/src/circuit_poseidon.rs +++ b/storage-proofs-update/src/circuit_poseidon.rs @@ -20,8 +20,7 @@ use storage_proofs_core::{ use crate::{ constants::{ - hs, validate_tree_r_shape, TreeRDomain, TreeRHasher, - POSEIDON_CONSTANTS_GEN_RANDOMNESS, + hs, validate_tree_r_shape, TreeRDomain, TreeRHasher, POSEIDON_CONSTANTS_GEN_RANDOMNESS, }, gadgets::{gen_challenge_bits, get_challenge_high_bits, label_r_new}, PublicParams, @@ -313,7 +312,10 @@ where comm_c: None, root_r_old: None, root_r_new: None, - challenge_proofs: vec![ChallengeProof::empty(sector_nodes); challenge_count(sector_nodes)], + challenge_proofs: vec![ + ChallengeProof::empty(sector_nodes); + challenge_count(sector_nodes) + ], } } } @@ -355,13 +357,8 @@ where { /// This circuit is NOT AUDITED, USE AT YOUR OWN RISK. fn synthesize>(self, cs: &mut CS) -> Result<(), SynthesisError> { - let EmptySectorUpdateCircuit { - pub_params: - PublicParams { - sector_nodes, - .. - }, + pub_params: PublicParams { sector_nodes, .. }, pub_inputs: PublicInputs { h_select, @@ -380,7 +377,6 @@ where let challenge_bit_len = sector_nodes.trailing_zeros() as usize; - validate_tree_r_shape::(sector_nodes); let hs = hs(sector_nodes); let h_select_bit_len = hs.len(); diff --git a/storage-proofs-update/tests/common.rs b/storage-proofs-update/tests/common.rs index b4714ace49..6d0723a614 100644 --- a/storage-proofs-update/tests/common.rs +++ b/storage-proofs-update/tests/common.rs @@ -1,27 +1,21 @@ use std::path::Path; -use bellperson::{util_cs::test_cs::TestConstraintSystem, Circuit}; use blstrs::Scalar as Fr; -use filecoin_hashers::{Domain, HashFunction, Hasher}; -use generic_array::typenum::{Unsigned, U0, U2, U4, U8}; -use merkletree::store::{DiskStore, StoreConfig}; -use rand::SeedableRng; -use rand_xorshift::XorShiftRng; +use filecoin_hashers::{Domain, Hasher}; +use generic_array::typenum::Unsigned; +use merkletree::store::StoreConfig; + use storage_proofs_core::{ merkle::{MerkleTreeTrait, MerkleTreeWrapper}, util::default_rows_to_discard, - TEST_SEED, }; use storage_proofs_update::{ - circuit, constants::{ - apex_leaf_count, hs, partition_count, validate_tree_r_shape, TreeD, TreeDDomain, TreeRDomain, TreeRHasher, SECTOR_SIZE_16_KIB, SECTOR_SIZE_1_KIB, SECTOR_SIZE_2_KIB, SECTOR_SIZE_32_KIB, SECTOR_SIZE_4_KIB, SECTOR_SIZE_8_KIB, }, phi, rho, vanilla, Challenges, EmptySectorUpdateCircuit, PublicParams, }; -use tempfile::tempdir; // Selects a value for `h` via `h = hs[log2(h_select)]`; default to taking `h = hs[2]`. pub const H_SELECT: u64 = 1 << 2; diff --git a/storage-proofs-update/tests/compound.rs b/storage-proofs-update/tests/compound.rs index 077a3119bf..74446686e1 100644 --- a/storage-proofs-update/tests/compound.rs +++ b/storage-proofs-update/tests/compound.rs @@ -1,7 +1,7 @@ use std::fs; use std::path::Path; -use blstrs::Scalar as Fr; + use filecoin_hashers::{Domain, HashFunction, Hasher, PoseidonArity}; use generic_array::typenum::{Unsigned, U0, U2, U4, U8}; use merkletree::{merkle::get_merkle_tree_len, store::StoreConfig}; @@ -21,7 +21,7 @@ use storage_proofs_update::{ TreeRDomain, TreeRHasher, SECTOR_SIZE_16_KIB, SECTOR_SIZE_1_KIB, SECTOR_SIZE_2_KIB, SECTOR_SIZE_32_KIB, SECTOR_SIZE_4_KIB, SECTOR_SIZE_8_KIB, }, - phi, rho, EmptySectorUpdateCompound, PrivateInputs, PublicInputs, SetupParams, + phi, EmptySectorUpdateCompound, PrivateInputs, PublicInputs, SetupParams, }; use tempfile::tempdir;