diff --git a/rusk-abi/src/abi.rs b/rusk-abi/src/abi.rs index 94bb6ef191..b1719a187c 100644 --- a/rusk-abi/src/abi.rs +++ b/rusk-abi/src/abi.rs @@ -7,18 +7,13 @@ use alloc::vec::Vec; use dusk_bytes::Serializable; -use execution_core::{ - signatures::{ - bls::{ - MultisigSignature, PublicKey as BlsPublicKey, - Signature as BlsSignature, - }, - schnorr::{ - PublicKey as SchnorrPublicKey, Signature as SchnorrSignature, - }, - }, - BlsScalar, ContractId, +use execution_core::signatures::bls::{ + MultisigSignature, PublicKey as BlsPublicKey, Signature as BlsSignature, }; +use execution_core::signatures::schnorr::{ + PublicKey as SchnorrPublicKey, Signature as SchnorrSignature, +}; +use execution_core::{BlsScalar, ContractId}; use piecrust_uplink::{host_query, meta_data}; use crate::{Metadata, Query}; diff --git a/rusk-abi/src/host.rs b/rusk-abi/src/host.rs index 54d8572a70..c3505a7211 100644 --- a/rusk-abi/src/host.rs +++ b/rusk-abi/src/host.rs @@ -9,24 +9,20 @@ use std::path::{Path, PathBuf}; use dusk_bytes::DeserializableSlice; use dusk_poseidon::{Domain, Hash as PoseidonHash}; -use execution_core::{ - groth16::{ - bn254::{Bn254, G1Projective}, - serialize::CanonicalDeserialize, - Groth16, PreparedVerifyingKey, Proof as Groth16Proof, - }, - plonk::{Proof as PlonkProof, Verifier}, - signatures::{ - bls::{ - MultisigPublicKey, MultisigSignature, PublicKey as BlsPublicKey, - Signature as BlsSignature, - }, - schnorr::{ - PublicKey as SchnorrPublicKey, Signature as SchnorrSignature, - }, - }, - BlsScalar, +use execution_core::groth16::bn254::{Bn254, G1Projective}; +use execution_core::groth16::serialize::CanonicalDeserialize; +use execution_core::groth16::{ + Groth16, PreparedVerifyingKey, Proof as Groth16Proof, }; +use execution_core::plonk::{Proof as PlonkProof, Verifier}; +use execution_core::signatures::bls::{ + MultisigPublicKey, MultisigSignature, PublicKey as BlsPublicKey, + Signature as BlsSignature, +}; +use execution_core::signatures::schnorr::{ + PublicKey as SchnorrPublicKey, Signature as SchnorrSignature, +}; +use execution_core::BlsScalar; use piecrust::{Error as PiecrustError, Session, SessionData, VM}; use rkyv::ser::serializers::AllocSerializer; use rkyv::{Archive, Deserialize, Serialize}; diff --git a/rusk-abi/tests/lib.rs b/rusk-abi/tests/lib.rs index 6a9d83815f..65c25939bb 100644 --- a/rusk-abi/tests/lib.rs +++ b/rusk-abi/tests/lib.rs @@ -8,36 +8,29 @@ use std::sync::OnceLock; -use rand::rngs::OsRng; - use dusk_bytes::{ParseHexStr, Serializable}; -use execution_core::{ - groth16::{ - bn254::{Bn254, Fr as Bn254Fr}, - relations::{ - lc, - r1cs::{ - ConstraintSynthesizer, ConstraintSystemRef, - Field as Groth16Field, SynthesisError, Variable, - }, - }, - serialize::{CanonicalSerialize, Compress}, - verifier::prepare_verifying_key, - Groth16, - }, - plonk::{ - Circuit, Compiler, Composer, Constraint, Error as PlonkError, - PublicParameters, - }, - signatures::{ - bls::{PublicKey as BlsPublicKey, SecretKey as BlsSecretKey}, - schnorr::{ - PublicKey as SchnorrPublicKey, SecretKey as SchnorrSecretKey, - }, - }, - BlsScalar, ContractId, +use execution_core::groth16::bn254::{Bn254, Fr as Bn254Fr}; +use execution_core::groth16::relations::lc; +use execution_core::groth16::relations::r1cs::{ + ConstraintSynthesizer, ConstraintSystemRef, Field as Groth16Field, + SynthesisError, Variable, +}; +use execution_core::groth16::serialize::{CanonicalSerialize, Compress}; +use execution_core::groth16::verifier::prepare_verifying_key; +use execution_core::groth16::Groth16; +use execution_core::plonk::{ + Circuit, Compiler, Composer, Constraint, Error as PlonkError, + PublicParameters, }; +use execution_core::signatures::bls::{ + PublicKey as BlsPublicKey, SecretKey as BlsSecretKey, +}; +use execution_core::signatures::schnorr::{ + PublicKey as SchnorrPublicKey, SecretKey as SchnorrSecretKey, +}; +use execution_core::{BlsScalar, ContractId}; use ff::Field; +use rand::rngs::OsRng; use rusk_abi::{ContractData, Session, VM}; const POINT_LIMIT: u64 = 0x4000000; diff --git a/rusk-profile/src/circuit.rs b/rusk-profile/src/circuit.rs index 7d79db70e1..1bd16705fd 100644 --- a/rusk-profile/src/circuit.rs +++ b/rusk-profile/src/circuit.rs @@ -4,16 +4,16 @@ // // Copyright (c) DUSK NETWORK. All rights reserved. -use blake3::Hasher; -use serde::{Deserialize, Serialize}; -use tracing::info; -use version_check::Version; - use std::fs::{self, read, File}; use std::io::prelude::*; use std::io::{self, ErrorKind}; use std::path::PathBuf; +use blake3::Hasher; +use serde::{Deserialize, Serialize}; +use tracing::info; +use version_check::Version; + use crate::{ extension, file_name, file_stem, get_rusk_circuits_dir, get_rusk_keys_dir, Theme, diff --git a/rusk-profile/src/lib.rs b/rusk-profile/src/lib.rs index 1f6c39117f..b14c2e694f 100644 --- a/rusk-profile/src/lib.rs +++ b/rusk-profile/src/lib.rs @@ -7,15 +7,14 @@ #![deny(unused_crate_dependencies)] #![deny(unused_extern_crates)] +use std::fs::{self, read, remove_file, write}; +use std::path::{Path, PathBuf}; +use std::{env, io}; + use dirs::home_dir; use sha2::{Digest, Sha256}; use tracing::{info, warn}; -use std::env; -use std::fs::{self, read, remove_file, write}; -use std::io; -use std::path::{Path, PathBuf}; - mod theme; pub use theme::Theme; diff --git a/rusk-prover/src/lib.rs b/rusk-prover/src/lib.rs index c3a40fed4b..89cb41f41f 100644 --- a/rusk-prover/src/lib.rs +++ b/rusk-prover/src/lib.rs @@ -17,12 +17,11 @@ use alloc::vec::Vec; use dusk_bytes::Serializable; use dusk_plonk::prelude::Prover as PlonkProver; -use once_cell::sync::Lazy; - -use execution_core::{ - transfer::phoenix::{Prove, TxCircuit, TxCircuitVec, NOTES_TREE_DEPTH}, - Error, +use execution_core::transfer::phoenix::{ + Prove, TxCircuit, TxCircuitVec, NOTES_TREE_DEPTH, }; +use execution_core::Error; +use once_cell::sync::Lazy; static TX_CIRCUIT_1_2_PROVER: Lazy = Lazy::new(|| fetch_prover("TxCircuitOneTwo")); diff --git a/rusk-recovery/src/keys.rs b/rusk-recovery/src/keys.rs index dd60556b0b..46c017a085 100644 --- a/rusk-recovery/src/keys.rs +++ b/rusk-recovery/src/keys.rs @@ -4,21 +4,18 @@ // // Copyright (c) DUSK NETWORK. All rights reserved. -use crate::Theme; +use std::sync::{mpsc, Mutex}; +use std::{io, thread}; + use dusk_plonk::prelude::{Compiler, PublicParameters}; use execution_core::transfer::phoenix::TRANSCRIPT_LABEL; +use lazy_static::lazy_static; use once_cell::sync::Lazy; -use std::{ - io, - sync::{mpsc, Mutex}, - thread, -}; - use rusk_profile::Circuit as CircuitProfile; - -use lazy_static::lazy_static; use tracing::{info, warn}; +use crate::Theme; + mod circuits; lazy_static! { diff --git a/rusk-recovery/src/keys/circuits.rs b/rusk-recovery/src/keys/circuits.rs index 7ac4af23af..ba18d8a8a3 100644 --- a/rusk-recovery/src/keys/circuits.rs +++ b/rusk-recovery/src/keys/circuits.rs @@ -7,10 +7,9 @@ use std::io::{self, ErrorKind}; use cargo_toml::{Dependency, Manifest}; -use tracing::info; - use dusk_plonk::prelude::Circuit; use execution_core::transfer::phoenix::{TxCircuit, NOTES_TREE_DEPTH}; +use tracing::info; type TxCircuitOneTwo = TxCircuit; type TxCircuitTwoTwo = TxCircuit; diff --git a/rusk-recovery/src/state.rs b/rusk-recovery/src/state.rs index a863659ebe..5ef81ddf78 100644 --- a/rusk-recovery/src/state.rs +++ b/rusk-recovery/src/state.rs @@ -9,31 +9,29 @@ use std::fs; use std::path::Path; use dusk_bytes::DeserializableSlice; +use execution_core::signatures::bls::PublicKey as AccountPublicKey; +use execution_core::stake::{StakeAmount, StakeData, STAKE_CONTRACT}; +use execution_core::transfer::phoenix::{Note, PublicKey, Sender}; +use execution_core::transfer::TRANSFER_CONTRACT; +use execution_core::{ContractId, JubJubScalar}; use ff::Field; use once_cell::sync::Lazy; use rand::rngs::StdRng; use rand::SeedableRng; +use rusk_abi::{ContractData, Session, VM}; + use tracing::info; use url::Url; -use execution_core::{ - signatures::bls::PublicKey as AccountPublicKey, - stake::{StakeAmount, StakeData, STAKE_CONTRACT}, - transfer::{ - phoenix::{Note, PublicKey, Sender}, - TRANSFER_CONTRACT, - }, - ContractId, JubJubScalar, -}; -use rusk_abi::{ContractData, Session, VM}; - use crate::Theme; -pub use snapshot::{GenesisStake, PhoenixBalance, Snapshot}; mod http; +mod zip; + mod snapshot; +pub use snapshot::{GenesisStake, PhoenixBalance, Snapshot}; + pub mod tar; -mod zip; pub const DEFAULT_SNAPSHOT: &str = include_str!("../config/testnet_remote.toml"); diff --git a/rusk-recovery/src/state/http.rs b/rusk-recovery/src/state/http.rs index b6c0ba53c5..79a439ee9d 100644 --- a/rusk-recovery/src/state/http.rs +++ b/rusk-recovery/src/state/http.rs @@ -4,9 +4,10 @@ // // Copyright (c) DUSK NETWORK. All rights reserved. -use http_req::request; use std::error::Error; +use http_req::request; + const MAX_REDIRECT: usize = 3; pub(super) fn download(uri: T) -> Result, Box> diff --git a/rusk-recovery/src/state/snapshot.rs b/rusk-recovery/src/state/snapshot.rs index 903bf9d136..b5f6483c9e 100644 --- a/rusk-recovery/src/state/snapshot.rs +++ b/rusk-recovery/src/state/snapshot.rs @@ -7,17 +7,16 @@ use std::fmt::Debug; use dusk_bytes::Serializable; -use execution_core::{ - signatures::bls::PublicKey as AccountPublicKey, - transfer::phoenix::PublicKey as PhoenixPublicKey, Dusk, -}; +use execution_core::signatures::bls::PublicKey as AccountPublicKey; +use execution_core::transfer::phoenix::PublicKey as PhoenixPublicKey; +use execution_core::Dusk; use serde_derive::{Deserialize, Serialize}; -mod stake; -mod wrapper; - use crate::state; + +mod stake; pub use stake::GenesisStake; +mod wrapper; use wrapper::Wrapper; #[derive(Serialize, Deserialize, PartialEq, Eq)] @@ -105,7 +104,6 @@ mod tests { use std::error::Error; use super::*; - use crate::state; pub(crate) fn testnet_from_file() -> Result> { diff --git a/rusk-recovery/src/state/snapshot/stake.rs b/rusk-recovery/src/state/snapshot/stake.rs index 8d09973b0a..503c449c84 100644 --- a/rusk-recovery/src/state/snapshot/stake.rs +++ b/rusk-recovery/src/state/snapshot/stake.rs @@ -5,12 +5,11 @@ // Copyright (c) DUSK NETWORK. All rights reserved. use dusk_bytes::Serializable; +use execution_core::signatures::bls::PublicKey as BlsPublicKey; +use execution_core::stake::StakeKeys; +use execution_core::Dusk; use serde_derive::{Deserialize, Serialize}; -use execution_core::{ - signatures::bls::PublicKey as BlsPublicKey, stake::StakeKeys, Dusk, -}; - use super::wrapper::Wrapper; #[derive(Serialize, Deserialize, PartialEq, Eq)] diff --git a/rusk-recovery/src/state/tar.rs b/rusk-recovery/src/state/tar.rs index 39fcaf586b..2f9a32ac9d 100644 --- a/rusk-recovery/src/state/tar.rs +++ b/rusk-recovery/src/state/tar.rs @@ -4,10 +4,11 @@ // // Copyright (c) DUSK NETWORK. All rights reserved. -use flate2::{read, write, Compression}; use std::error::Error; use std::fs::File; use std::path::Path; + +use flate2::{read, write, Compression}; use tar::Archive; use super::zip;