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 6ac6f248d1..5ad3c98f5c 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;