Skip to content

Commit

Permalink
rusk-recovery: reorder imports to align with convention
Browse files Browse the repository at this point in the history
  • Loading branch information
Neotamandua committed Dec 4, 2024
1 parent b00479d commit 955ded3
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 38 deletions.
15 changes: 6 additions & 9 deletions rusk-recovery/src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down
3 changes: 1 addition & 2 deletions rusk-recovery/src/keys/circuits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<NOTES_TREE_DEPTH, 1>;
type TxCircuitTwoTwo = TxCircuit<NOTES_TREE_DEPTH, 2>;
Expand Down
24 changes: 11 additions & 13 deletions rusk-recovery/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 2 additions & 1 deletion rusk-recovery/src/state/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(uri: T) -> Result<Vec<u8>, Box<dyn Error>>
Expand Down
14 changes: 6 additions & 8 deletions rusk-recovery/src/state/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -105,7 +104,6 @@ mod tests {
use std::error::Error;

use super::*;

use crate::state;

pub(crate) fn testnet_from_file() -> Result<Snapshot, Box<dyn Error>> {
Expand Down
7 changes: 3 additions & 4 deletions rusk-recovery/src/state/snapshot/stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
3 changes: 2 additions & 1 deletion rusk-recovery/src/state/tar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 955ded3

Please sign in to comment.