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)]
pub mod protocol;
pub mod circuit;
pub mod protocol;
#[cfg(feature = "dylib")]
pub use circuit::initialize;
#[cfg(test)]
mod tests {
use semaphore::{
hash_to_field, identity::Identity, poseidon_tree::PoseidonTree, Field,
};
use crate::protocol::*;
use semaphore::{hash_to_field, identity::Identity, poseidon_tree::PoseidonTree, Field};
#[test]
fn test_semaphore() {

View File

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