Skip to content

Commit

Permalink
Clean imports
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
  • Loading branch information
Jakub Sztandera committed Dec 15, 2021
1 parent 46ada3f commit d37eb0c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
16 changes: 6 additions & 10 deletions storage-proofs-update/src/circuit_poseidon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
],
}
}
}
Expand Down Expand Up @@ -355,13 +357,8 @@ where
{
/// This circuit is NOT AUDITED, USE AT YOUR OWN RISK.
fn synthesize<CS: ConstraintSystem<Fr>>(self, cs: &mut CS) -> Result<(), SynthesisError> {

let EmptySectorUpdateCircuit {
pub_params:
PublicParams {
sector_nodes,
..
},
pub_params: PublicParams { sector_nodes, .. },
pub_inputs:
PublicInputs {
h_select,
Expand All @@ -380,7 +377,6 @@ where

let challenge_bit_len = sector_nodes.trailing_zeros() as usize;


validate_tree_r_shape::<TreeR>(sector_nodes);
let hs = hs(sector_nodes);
let h_select_bit_len = hs.len();
Expand Down
14 changes: 4 additions & 10 deletions storage-proofs-update/tests/common.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions storage-proofs-update/tests/compound.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand All @@ -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;

Expand Down

0 comments on commit d37eb0c

Please sign in to comment.