style(semaphore): cargo fmt

This commit is contained in:
Oskar Thoren 2022-06-01 15:23:09 +01:00
parent c4ec421e2c
commit 8171439a44
No known key found for this signature in database
GPG Key ID: B2ECCFD3BC2EF77E
2 changed files with 11 additions and 15 deletions

View File

@ -1,17 +1,15 @@
#![allow(clippy::multiple_crate_versions)] #![allow(clippy::multiple_crate_versions)]
pub mod protocol;
pub mod circuit; pub mod circuit;
pub mod protocol;
#[cfg(feature = "dylib")] #[cfg(feature = "dylib")]
pub use circuit::initialize; pub use circuit::initialize;
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use semaphore::{
hash_to_field, identity::Identity, poseidon_tree::PoseidonTree, Field,
};
use crate::protocol::*; use crate::protocol::*;
use semaphore::{hash_to_field, identity::Identity, poseidon_tree::PoseidonTree, Field};
#[test] #[test]
fn test_semaphore() { fn test_semaphore() {

View File

@ -2,17 +2,8 @@
// For illustration purposes only as an example protocol // For illustration purposes only as an example protocol
// Private module // Private module
use crate::{ use crate::circuit::{witness_calculator, zkey};
circuit::{witness_calculator, zkey}
};
use semaphore::{
identity::Identity,
merkle_tree::{self, Branch},
poseidon_hash,
poseidon_tree::PoseidonHash,
Field,
};
use ark_bn254::{Bn254, Parameters}; use ark_bn254::{Bn254, Parameters};
use ark_circom::CircomReduction; use ark_circom::CircomReduction;
use ark_ec::bn::Bn; use ark_ec::bn::Bn;
@ -24,6 +15,13 @@ use ark_std::UniformRand;
use color_eyre::Result; use color_eyre::Result;
use primitive_types::U256; use primitive_types::U256;
use rand::{thread_rng, Rng}; use rand::{thread_rng, Rng};
use semaphore::{
identity::Identity,
merkle_tree::{self, Branch},
poseidon_hash,
poseidon_tree::PoseidonHash,
Field,
};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::time::Instant; use std::time::Instant;
use thiserror::Error; use thiserror::Error;
@ -218,9 +216,9 @@ pub fn verify_proof(
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use super::*; use super::*;
use semaphore::{hash_to_field, poseidon_tree::PoseidonTree};
use rand::SeedableRng as _; use rand::SeedableRng as _;
use rand_chacha::ChaChaRng; use rand_chacha::ChaChaRng;
use semaphore::{hash_to_field, poseidon_tree::PoseidonTree};
use serde_json::json; use serde_json::json;
fn arb_proof(seed: u64) -> Proof { fn arb_proof(seed: u64) -> Proof {