Skip to content

Commit

Permalink
Update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
raychu86 committed Jul 3, 2023
1 parent a91e915 commit 2e8eb04
Show file tree
Hide file tree
Showing 34 changed files with 129 additions and 68 deletions.
10 changes: 7 additions & 3 deletions .integration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
#[cfg(test)]
mod tests {
use snarkos_node_cdn::sync_ledger_with_cdn;
use snarkvm::{
prelude::{Block, FromBytes, Ledger, Network, Testnet3},
synthesizer::store::helpers::memory::ConsensusMemory,
use snarkvm::prelude::{
block::Block,
store::helpers::memory::ConsensusMemory,
FromBytes,
Ledger,
Network,
Testnet3,
};

use tracing_test::traced_test;
Expand Down
11 changes: 8 additions & 3 deletions cli/src/commands/developer/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@

use super::{CurrentNetwork, Developer};

use snarkvm::{
prelude::{ConsensusStore, Plaintext, PrivateKey, ProgramID, Query, Record, VM},
synthesizer::store::helpers::memory::ConsensusMemory,
use snarkvm::prelude::{
query::Query,
store::{helpers::memory::ConsensusMemory, ConsensusStore},
Plaintext,
PrivateKey,
ProgramID,
Record,
VM,
};

use anyhow::{bail, Result};
Expand Down
14 changes: 11 additions & 3 deletions cli/src/commands/developer/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@

use super::{CurrentNetwork, Developer, Program};

use snarkvm::{
prelude::{ConsensusStore, Identifier, Locator, Plaintext, PrivateKey, ProgramID, Query, Record, Value, VM},
synthesizer::store::helpers::memory::ConsensusMemory,
use snarkvm::prelude::{
query::Query,
store::{helpers::memory::ConsensusMemory, ConsensusStore},
Identifier,
Locator,
Plaintext,
PrivateKey,
ProgramID,
Record,
Value,
VM,
};

use anyhow::{bail, Result};
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/developer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub use transfer_private::*;
use snarkvm::{
file::{AleoFile, Manifest},
package::Package,
prelude::{Program, ProgramID, ToBytes, Transaction},
prelude::{block::Transaction, Program, ProgramID, ToBytes},
};

use anyhow::{bail, ensure, Result};
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/developer/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use super::CurrentNetwork;

use snarkvm::prelude::{Block, Ciphertext, Field, Network, Plaintext, PrivateKey, Record, ViewKey};
use snarkvm::prelude::{block::Block, Ciphertext, Field, Network, Plaintext, PrivateKey, Record, ViewKey};

use anyhow::{bail, ensure, Result};
use clap::Parser;
Expand Down
13 changes: 10 additions & 3 deletions cli/src/commands/developer/transfer_private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@

use super::{CurrentNetwork, Developer};

use snarkvm::{
prelude::{Address, ConsensusStore, Locator, Plaintext, PrivateKey, Query, Record, Value, VM},
synthesizer::store::helpers::memory::ConsensusMemory,
use snarkvm::prelude::{
query::Query,
store::{helpers::memory::ConsensusMemory, ConsensusStore},
Address,
Locator,
Plaintext,
PrivateKey,
Record,
Value,
VM,
};

use anyhow::{bail, Result};
Expand Down
11 changes: 8 additions & 3 deletions cli/src/commands/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@
use snarkos_account::Account;
use snarkos_display::Display;
use snarkos_node::{messages::NodeType, Node};
use snarkvm::{
prelude::{Block, ConsensusStore, FromBytes, Network, PrivateKey, Testnet3, VM},
synthesizer::store::helpers::memory::ConsensusMemory,
use snarkvm::prelude::{
block::Block,
store::{helpers::memory::ConsensusMemory, ConsensusStore},
FromBytes,
Network,
PrivateKey,
Testnet3,
VM,
};

use anyhow::{bail, Result};
Expand Down
7 changes: 3 additions & 4 deletions node/cdn/src/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
// limitations under the License.

use snarkvm::prelude::{
cow_to_copied,
Block,
ConsensusStorage,
block::Block,
store::{cow_to_copied, ConsensusStorage},
Deserialize,
DeserializeOwned,
Ledger,
Expand Down Expand Up @@ -384,7 +383,7 @@ mod tests {
blocks::{cdn_get, cdn_height, handle_dispatch_error, log_progress, BLOCKS_PER_FILE},
load_blocks,
};
use snarkvm::prelude::{Block, Testnet3};
use snarkvm::prelude::{block::Block, Testnet3};

use anyhow::{anyhow, Result};
use parking_lot::RwLock;
Expand Down
7 changes: 6 additions & 1 deletion node/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ pub use memory_pool::*;
#[cfg(test)]
mod tests;

use snarkvm::prelude::*;
use snarkvm::prelude::{
block::{Block, Transaction},
coinbase::{CoinbasePuzzle, ProverSolution},
store::ConsensusStorage,
*,
};

use anyhow::Result;

Expand Down
10 changes: 7 additions & 3 deletions node/consensus/src/memory_pool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ mod solutions;
mod transactions;

use crate::Consensus;
use snarkvm::{
ledger::anchor_block_height,
prelude::{ConsensusStorage, Itertools, Network, ProverSolution, PuzzleCommitment, Transaction},
use snarkvm::prelude::{
anchor_block_height,
block::Transaction,
coinbase::{ProverSolution, PuzzleCommitment},
store::ConsensusStorage,
Itertools,
Network,
};

use anyhow::{anyhow, Result};
Expand Down
13 changes: 7 additions & 6 deletions node/consensus/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ use snarkvm::{
network::{prelude::*, Testnet3},
program::{Entry, Identifier, Literal, Plaintext, Value},
},
prelude::{Ledger, RecordsFilter, TestRng},
synthesizer::{
prelude::{
block::{Block, Transaction},
process::Program,
store::ConsensusStore,
vm::VM,
Ledger,
Program,
RecordsFilter,
TestRng,
VM,
},
};

Expand All @@ -40,8 +42,7 @@ pub(crate) mod test_helpers {
use crate::Consensus;
use snarkvm::{
console::{account::PrivateKey, network::Testnet3, program::Value},
prelude::TestRng,
synthesizer::{process::FinalizeGlobalState, store::helpers::memory::ConsensusMemory, Block},
prelude::{block::Block, store::helpers::memory::ConsensusMemory, FinalizeGlobalState, TestRng},
};

use once_cell::sync::OnceCell;
Expand Down
8 changes: 2 additions & 6 deletions node/messages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,14 @@ mod unconfirmed_transaction;
pub use unconfirmed_transaction::UnconfirmedTransaction;

use snarkvm::prelude::{
block::{Block, Header, Transaction},
coinbase::{EpochChallenge, ProverSolution, PuzzleCommitment},
error,
Address,
Block,
EpochChallenge,
FromBytes,
Header,
Network,
ProverSolution,
PuzzleCommitment,
Signature,
ToBytes,
Transaction,
};

use ::bytes::{Buf, BytesMut};
Expand Down
3 changes: 1 addition & 2 deletions node/rest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ use snarkos_node_messages::{Data, Message, UnconfirmedTransaction};
use snarkos_node_router::Routing;
use snarkvm::{
console::{program::ProgramID, types::Field},
prelude::{cfg_into_iter, Ledger, Network},
synthesizer::ConsensusStorage,
prelude::{cfg_into_iter, store::ConsensusStorage, Ledger, Network},
};

use anyhow::Result;
Expand Down
2 changes: 1 addition & 1 deletion node/rest/src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use super::*;
use rayon::prelude::*;
use serde::{Deserialize, Serialize};
use snarkos_node_env::ENV_INFO;
use snarkvm::prelude::{Identifier, Plaintext, Transaction};
use snarkvm::prelude::{block::Transaction, Identifier, Plaintext};

/// The `get_blocks` query object.
#[derive(Deserialize, Serialize)]
Expand Down
2 changes: 1 addition & 1 deletion node/router/src/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use snarkos_node_messages::{
MessageTrait,
};
use snarkos_node_tcp::{ConnectionSide, Tcp, P2P};
use snarkvm::prelude::{error, Address, Header, Network};
use snarkvm::prelude::{block::Header, error, Address, Network};

use anyhow::{bail, Result};
use futures::SinkExt;
Expand Down
2 changes: 1 addition & 1 deletion node/router/src/helpers/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

use snarkos_node_messages::BlockRequest;
use snarkvm::prelude::{Network, PuzzleCommitment};
use snarkvm::prelude::{coinbase::PuzzleCommitment, Network};

use core::hash::Hash;
use indexmap::{IndexMap, IndexSet};
Expand Down
2 changes: 1 addition & 1 deletion node/router/src/helpers/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

use snarkos_node_messages::BlockLocators;
use snarkvm::prelude::{Block, Network};
use snarkvm::prelude::{block::Block, Network};

use anyhow::{bail, ensure, Result};
use colored::Colorize;
Expand Down
6 changes: 5 additions & 1 deletion node/router/src/inbound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ use snarkos_node_messages::{
UnconfirmedTransaction,
};
use snarkos_node_tcp::{is_bogon_address, protocols::Reading};
use snarkvm::prelude::{Block, EpochChallenge, Header, Network, ProverSolution, Transaction};
use snarkvm::prelude::{
block::{Block, Header, Transaction},
coinbase::{EpochChallenge, ProverSolution},
Network,
};

use anyhow::{bail, ensure, Result};
use std::{net::SocketAddr, time::Instant};
Expand Down
2 changes: 1 addition & 1 deletion node/router/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use std::{
use snarkos_account::Account;
use snarkos_node_messages::NodeType;
use snarkos_node_router::Router;
use snarkvm::prelude::{Block, FromBytes, Network, Testnet3 as CurrentNetwork};
use snarkvm::prelude::{block::Block, FromBytes, Network, Testnet3 as CurrentNetwork};

/// A helper macro to print the TCP listening address, along with the connected and connecting peers.
#[macro_export]
Expand Down
6 changes: 5 additions & 1 deletion node/router/tests/common/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ use snarkos_node_tcp::{
Tcp,
P2P,
};
use snarkvm::prelude::{Block, EpochChallenge, Header, Network, ProverSolution, Transaction};
use snarkvm::prelude::{
block::{Block, Header, Transaction},
coinbase::{EpochChallenge, ProverSolution},
Network,
};

use async_trait::async_trait;
use std::{io, net::SocketAddr};
Expand Down
14 changes: 7 additions & 7 deletions node/src/beacon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,16 @@ use snarkos_node_tcp::{
P2P,
};
use snarkvm::prelude::{
Block,
ConsensusStorage,
block::{Block, Transaction},
coinbase::ProverSolution,
store::ConsensusStorage,
Entry,
Identifier,
Ledger,
Literal,
Network,
Plaintext,
ProverSolution,
RecordMap,
Transaction,
Value,
Zero,
};
Expand Down Expand Up @@ -444,9 +443,10 @@ impl<N: Network, C: ConsensusStorage<N>> Beacon<N, C> {
#[cfg(test)]
mod tests {
use super::*;
use snarkvm::{
prelude::{ConsensusStore, Testnet3, VM},
synthesizer::store::helpers::memory::ConsensusMemory,
use snarkvm::prelude::{
store::{helpers::memory::ConsensusMemory, ConsensusStore},
Testnet3,
VM,
};

use rand::SeedableRng;
Expand Down
2 changes: 1 addition & 1 deletion node/src/beacon/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use super::*;
use snarkos_node_messages::{BlockRequest, BlockResponse, DataBlocks, DisconnectReason, Message, MessageCodec, Pong};
use snarkos_node_router::Routing;
use snarkos_node_tcp::{Connection, ConnectionSide, Tcp};
use snarkvm::prelude::{error, EpochChallenge, Header};
use snarkvm::prelude::{block::Header, coinbase::EpochChallenge, error};

use std::{io, net::SocketAddr};
use tokio::task::spawn_blocking;
Expand Down
7 changes: 6 additions & 1 deletion node/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ use snarkos_node_tcp::{
protocols::{Disconnect, Handshake, OnConnect, Reading, Writing},
P2P,
};
use snarkvm::prelude::{Block, CoinbasePuzzle, ConsensusStorage, EpochChallenge, Header, Network, ProverSolution};
use snarkvm::prelude::{
block::{Block, Header},
coinbase::{CoinbasePuzzle, EpochChallenge, ProverSolution},
store::ConsensusStorage,
Network,
};

use anyhow::Result;
use core::marker::PhantomData;
Expand Down
2 changes: 1 addition & 1 deletion node/src/client/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use super::*;
use snarkos_node_messages::{BlockRequest, DisconnectReason, MessageCodec, Pong, UnconfirmedTransaction};
use snarkos_node_router::Routing;
use snarkos_node_tcp::{Connection, ConnectionSide, Tcp};
use snarkvm::prelude::{Network, Transaction};
use snarkvm::prelude::{block::Transaction, Network};

use std::{io, net::SocketAddr, time::Duration};

Expand Down
2 changes: 1 addition & 1 deletion node/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

use snarkos_node_messages::{BlockLocators, CHECKPOINT_INTERVAL, NUM_RECENTS};
use snarkvm::prelude::{ConsensusStorage, Ledger, Network};
use snarkvm::prelude::{store::ConsensusStorage, Ledger, Network};

use anyhow::Result;
use indexmap::IndexMap;
Expand Down
10 changes: 7 additions & 3 deletions node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@
use crate::{traits::NodeInterface, Beacon, Client, Prover, Validator};
use snarkos_account::Account;
use snarkos_node_messages::NodeType;
use snarkvm::{
prelude::{Address, Block, Network, PrivateKey, ViewKey},
synthesizer::store::helpers::{memory::ConsensusMemory, rocksdb::ConsensusDB},
use snarkvm::prelude::{
block::Block,
store::helpers::{memory::ConsensusMemory, rocksdb::ConsensusDB},
Address,
Network,
PrivateKey,
ViewKey,
};

use anyhow::Result;
Expand Down
Loading

0 comments on commit 2e8eb04

Please sign in to comment.