mirror of https://github.com/vacp2p/zerokit.git
style(semaphore): cargo fmt
This commit is contained in:
parent
c4ec421e2c
commit
8171439a44
|
@ -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() {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue