diff --git a/Cargo.toml b/Cargo.toml index c6b5a3f96..a91b9ea9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -105,6 +105,7 @@ serde_cbor = "0.9.0" serde_derive = "1.0.27" serde_json = "1.0.10" socket2 = "0.3.8" +solana_program_interface = { path = "common" } sys-info = "0.5.6" tokio = "0.1" tokio-codec = "0.1" @@ -133,12 +134,14 @@ name = "sigverify" [workspace] members = [ ".", + "common", "programs/noop", "programs/print", "programs/move_funds", ] default-members = [ ".", + "common", "programs/noop", "programs/print", "programs/move_funds", diff --git a/common/Cargo.toml b/common/Cargo.toml new file mode 100644 index 000000000..e85f51617 --- /dev/null +++ b/common/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "solana_program_interface" +version = "0.1.0" +authors = [ + "Anatoly Yakovenko ", + "Greg Fitzgerald ", + "Stephen Akridge ", + "Michael Vines ", + "Rob Walker ", + "Pankaj Garg ", + "Tyera Eulberg ", + "Jack May ", +] + +[dependencies] +bincode = "1.0.0" +bs58 = "0.2.0" +generic-array = { version = "0.12.0", default-features = false, features = ["serde"] } +serde = "1.0.27" +serde_derive = "1.0.27" + + diff --git a/src/account.rs b/common/src/account.rs similarity index 100% rename from src/account.rs rename to common/src/account.rs diff --git a/common/src/lib.rs b/common/src/lib.rs new file mode 100644 index 000000000..444fd3c47 --- /dev/null +++ b/common/src/lib.rs @@ -0,0 +1,7 @@ +pub mod account; +pub mod pubkey; +extern crate bincode; +extern crate bs58; +extern crate generic_array; +#[macro_use] +extern crate serde_derive; diff --git a/src/pubkey.rs b/common/src/pubkey.rs similarity index 100% rename from src/pubkey.rs rename to common/src/pubkey.rs diff --git a/programs/move_funds/Cargo.toml b/programs/move_funds/Cargo.toml index fd66239e0..a0b472c41 100644 --- a/programs/move_funds/Cargo.toml +++ b/programs/move_funds/Cargo.toml @@ -15,8 +15,7 @@ authors = [ [dependencies] bincode = "1.0.0" generic-array = { version = "0.12.0", default-features = false, features = ["serde"] } -libloading = "0.5.0" -solana = { path = "../.." } +solana_program_interface = { path = "../../common" } [lib] name = "move_funds" diff --git a/programs/move_funds/src/lib.rs b/programs/move_funds/src/lib.rs index 209fe5d28..9f66f24fc 100644 --- a/programs/move_funds/src/lib.rs +++ b/programs/move_funds/src/lib.rs @@ -1,8 +1,8 @@ extern crate bincode; -extern crate solana; +extern crate solana_program_interface; use bincode::deserialize; -use solana::account::KeyedAccount; +use solana_program_interface::account::KeyedAccount; #[no_mangle] pub extern "C" fn process(infos: &mut Vec, data: &[u8]) { @@ -22,8 +22,8 @@ pub extern "C" fn process(infos: &mut Vec, data: &[u8]) { mod tests { use super::*; use bincode::serialize; - use solana::account::Account; - use solana::pubkey::Pubkey; + use solana_program_interface::account::Account; + use solana_program_interface::pubkey::Pubkey; #[test] fn test_move_funds() { diff --git a/programs/noop/Cargo.toml b/programs/noop/Cargo.toml index 2cc53a8b3..fb2ebc479 100644 --- a/programs/noop/Cargo.toml +++ b/programs/noop/Cargo.toml @@ -13,8 +13,7 @@ authors = [ ] [dependencies] -libloading = "0.5.0" -solana = { path = "../.." } +solana_program_interface = { path = "../../common" } [lib] name = "noop" diff --git a/programs/noop/src/lib.rs b/programs/noop/src/lib.rs index 59ba23d01..e69f6f846 100644 --- a/programs/noop/src/lib.rs +++ b/programs/noop/src/lib.rs @@ -1,6 +1,6 @@ -extern crate solana; +extern crate solana_program_interface; -use solana::account::KeyedAccount; +use solana_program_interface::account::KeyedAccount; #[no_mangle] pub extern "C" fn process(_infos: &mut Vec, _data: &[u8]) {} diff --git a/programs/print/Cargo.toml b/programs/print/Cargo.toml index 25322b1c5..15fa4dec1 100644 --- a/programs/print/Cargo.toml +++ b/programs/print/Cargo.toml @@ -13,8 +13,7 @@ authors = [ ] [dependencies] -libloading = "0.5.0" -solana = { path = "../.." } +solana_program_interface = { path = "../../common" } [lib] name = "print" diff --git a/programs/print/src/lib.rs b/programs/print/src/lib.rs index 8947553e0..2a4cb81fb 100644 --- a/programs/print/src/lib.rs +++ b/programs/print/src/lib.rs @@ -1,6 +1,6 @@ -extern crate solana; +extern crate solana_program_interface; -use solana::account::KeyedAccount; +use solana_program_interface::account::KeyedAccount; #[no_mangle] pub extern "C" fn process(infos: &mut Vec, _data: &[u8]) { diff --git a/src/bank.rs b/src/bank.rs index 1c4288f9b..7ac52675b 100644 --- a/src/bank.rs +++ b/src/bank.rs @@ -3,7 +3,6 @@ //! on behalf of the caller, and a low-level API for when they have //! already been signed and verified. -use account::{Account, KeyedAccount}; use bincode::deserialize; use bincode::serialize; use budget_program::BudgetState; @@ -17,8 +16,9 @@ use ledger::Block; use log::Level; use mint::Mint; use payment_plan::Payment; -use pubkey::Pubkey; use signature::{Keypair, Signature}; +use solana_program_interface::account::{Account, KeyedAccount}; +use solana_program_interface::pubkey::Pubkey; use std; use std::collections::{BTreeMap, HashMap, VecDeque}; use std::result; diff --git a/src/broadcast_stage.rs b/src/broadcast_stage.rs index 36538925a..7220ab218 100644 --- a/src/broadcast_stage.rs +++ b/src/broadcast_stage.rs @@ -283,9 +283,9 @@ mod tests { use entry::Entry; use ledger::next_entries_mut; use mint::Mint; - use pubkey::Pubkey; use service::Service; use signature::{Keypair, KeypairUtil}; + use solana_program_interface::pubkey::Pubkey; use std::cmp; use std::sync::atomic::AtomicBool; use std::sync::mpsc::{channel, Sender}; diff --git a/src/budget.rs b/src/budget.rs index 4cbb0439b..0f316547e 100644 --- a/src/budget.rs +++ b/src/budget.rs @@ -5,7 +5,7 @@ use chrono::prelude::*; use payment_plan::{Payment, Witness}; -use pubkey::Pubkey; +use solana_program_interface::pubkey::Pubkey; use std::mem; /// A data type representing a `Witness` that the payment plan is waiting on. diff --git a/src/budget_program.rs b/src/budget_program.rs index 1c937d322..19718ec47 100644 --- a/src/budget_program.rs +++ b/src/budget_program.rs @@ -1,11 +1,11 @@ //! budget program -use account::Account; use bincode::{self, deserialize, serialize_into, serialized_size}; use budget::Budget; use budget_instruction::Instruction; use chrono::prelude::{DateTime, Utc}; use payment_plan::Witness; -use pubkey::Pubkey; +use solana_program_interface::account::Account; +use solana_program_interface::pubkey::Pubkey; use std::io; use transaction::Transaction; @@ -265,14 +265,14 @@ impl BudgetState { } #[cfg(test)] mod test { - use account::Account; use bincode::serialize; use budget_program::{BudgetError, BudgetState}; use budget_transaction::BudgetTransaction; use chrono::prelude::{DateTime, NaiveDate, Utc}; use hash::Hash; - use pubkey::Pubkey; use signature::{GenKeys, Keypair, KeypairUtil}; + use solana_program_interface::account::Account; + use solana_program_interface::pubkey::Pubkey; use transaction::Transaction; #[test] diff --git a/src/budget_transaction.rs b/src/budget_transaction.rs index 090fcd983..b097a3761 100644 --- a/src/budget_transaction.rs +++ b/src/budget_transaction.rs @@ -7,8 +7,8 @@ use budget_program::BudgetState; use chrono::prelude::*; use hash::Hash; use payment_plan::Payment; -use pubkey::Pubkey; use signature::Keypair; +use solana_program_interface::pubkey::Pubkey; use transaction::Transaction; pub trait BudgetTransaction { diff --git a/src/choose_gossip_peer_strategy.rs b/src/choose_gossip_peer_strategy.rs index 3cad2348a..16c4226e4 100644 --- a/src/choose_gossip_peer_strategy.rs +++ b/src/choose_gossip_peer_strategy.rs @@ -1,8 +1,8 @@ use crdt::{CrdtError, NodeInfo}; -use pubkey::Pubkey; use rand::distributions::{Distribution, Weighted, WeightedChoice}; use rand::thread_rng; use result::Result; +use solana_program_interface::pubkey::Pubkey; use std; use std::collections::HashMap; @@ -192,8 +192,8 @@ impl<'a> ChooseGossipPeerStrategy for ChooseWeightedPeerStrategy<'a> { mod tests { use choose_gossip_peer_strategy::{ChooseWeightedPeerStrategy, DEFAULT_WEIGHT}; use logger; - use pubkey::Pubkey; use signature::{Keypair, KeypairUtil}; + use solana_program_interface::pubkey::Pubkey; use std; use std::collections::HashMap; diff --git a/src/crdt.rs b/src/crdt.rs index a68e2e243..a798806cb 100644 --- a/src/crdt.rs +++ b/src/crdt.rs @@ -21,11 +21,11 @@ use ledger::LedgerWindow; use log::Level; use netutil::{bind_in_range, bind_to, multi_bind_in_range}; use packet::{to_blob, Blob, BlobRecycler, SharedBlob, BLOB_SIZE}; -use pubkey::Pubkey; use rand::{thread_rng, Rng}; use rayon::prelude::*; use result::{Error, Result}; use signature::{Keypair, KeypairUtil}; +use solana_program_interface::pubkey::Pubkey; use std; use std::collections::HashMap; use std::net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket}; @@ -1409,9 +1409,9 @@ mod tests { use ledger::{LedgerWindow, LedgerWriter}; use logger; use packet::BlobRecycler; - use pubkey::Pubkey; use result::Error; use signature::{Keypair, KeypairUtil}; + use solana_program_interface::pubkey::Pubkey; use std::fs::remove_dir_all; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::sync::atomic::{AtomicBool, Ordering}; diff --git a/src/drone.rs b/src/drone.rs index afc508eb3..66b3fea0d 100644 --- a/src/drone.rs +++ b/src/drone.rs @@ -8,8 +8,8 @@ use bincode::{deserialize, serialize}; use bytes::Bytes; use influx_db_client as influxdb; use metrics; -use pubkey::Pubkey; use signature::{Keypair, Signature}; +use solana_program_interface::pubkey::Pubkey; use std::io; use std::io::{Error, ErrorKind}; use std::net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket}; diff --git a/src/dynamic_program.rs b/src/dynamic_program.rs index f8d20b2ad..0367e04fe 100644 --- a/src/dynamic_program.rs +++ b/src/dynamic_program.rs @@ -1,9 +1,9 @@ extern crate bincode; extern crate generic_array; -use account::KeyedAccount; use libc; use libloading; +use solana_program_interface::account::KeyedAccount; use std::path::PathBuf; #[cfg(debug_assertions)] @@ -98,9 +98,9 @@ impl DynamicProgram { #[cfg(test)] mod tests { use super::*; - use account::Account; use bincode::serialize; - use pubkey::Pubkey; + use solana_program_interface::account::Account; + use solana_program_interface::pubkey::Pubkey; use std::path::Path; use std::thread; diff --git a/src/entry.rs b/src/entry.rs index e011bd034..7f07aea81 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -7,8 +7,8 @@ use budget_transaction::BudgetTransaction; use hash::Hash; use packet::{BlobRecycler, SharedBlob, BLOB_DATA_SIZE}; use poh::Poh; -use pubkey::Pubkey; use rayon::prelude::*; +use solana_program_interface::pubkey::Pubkey; use std::io::Cursor; use std::net::SocketAddr; use std::sync::mpsc::{Receiver, Sender}; diff --git a/src/erasure.rs b/src/erasure.rs index bfde1b780..52a2322ab 100644 --- a/src/erasure.rs +++ b/src/erasure.rs @@ -1,6 +1,6 @@ // Support erasure coding use packet::{BlobRecycler, SharedBlob, BLOB_DATA_SIZE, BLOB_HEADER_SIZE}; -use pubkey::Pubkey; +use solana_program_interface::pubkey::Pubkey; use std::cmp; use std::mem; use std::result; @@ -603,9 +603,9 @@ mod test { use erasure; use logger; use packet::{BlobRecycler, BLOB_DATA_SIZE, BLOB_HEADER_SIZE, BLOB_SIZE}; - use pubkey::Pubkey; use rand::{thread_rng, Rng}; use signature::{Keypair, KeypairUtil}; + use solana_program_interface::pubkey::Pubkey; // use std::sync::{Arc, RwLock}; use window::{index_blobs, WindowSlot}; diff --git a/src/fullnode.rs b/src/fullnode.rs index f3a0d5284..f701761a4 100644 --- a/src/fullnode.rs +++ b/src/fullnode.rs @@ -7,11 +7,11 @@ use drone::DRONE_PORT; use entry::Entry; use ledger::read_ledger; use ncp::Ncp; -use pubkey::Pubkey; use rpc::{JsonRpcService, RPC_PORT}; use rpu::Rpu; use service::Service; use signature::{Keypair, KeypairUtil}; +use solana_program_interface::pubkey::Pubkey; use std::net::UdpSocket; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::sync::atomic::{AtomicBool, Ordering}; diff --git a/src/ledger.rs b/src/ledger.rs index 586558cc4..0267711db 100644 --- a/src/ledger.rs +++ b/src/ledger.rs @@ -11,11 +11,11 @@ use log::Level::Trace; #[cfg(test)] use mint::Mint; use packet::{self, SharedBlob, BLOB_DATA_SIZE}; -use pubkey::Pubkey; use rayon::prelude::*; use result::{Error, Result}; #[cfg(test)] use signature::{Keypair, KeypairUtil}; +use solana_program_interface::pubkey::Pubkey; use std::fs::{create_dir_all, remove_dir_all, File, OpenOptions}; use std::io::prelude::*; use std::io::{self, BufReader, BufWriter, Seek, SeekFrom}; diff --git a/src/lib.rs b/src/lib.rs index 2bc77e716..5994c4e4b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,6 @@ #![cfg_attr(feature = "unstable", feature(test))] #[macro_use] pub mod counter; -pub mod account; pub mod bank; pub mod banking_stage; pub mod blob_fetch_stage; @@ -41,7 +40,6 @@ pub mod packet; pub mod payment_plan; pub mod poh; pub mod poh_recorder; -pub mod pubkey; pub mod recvmmsg; pub mod recycler; pub mod replicate_stage; @@ -84,6 +82,7 @@ extern crate generic_array; extern crate ipnetwork; extern crate itertools; extern crate jsonrpc_core; +extern crate solana_program_interface; #[macro_use] extern crate jsonrpc_macros; extern crate jsonrpc_http_server; diff --git a/src/mint.rs b/src/mint.rs index cad2ee235..9eb198222 100644 --- a/src/mint.rs +++ b/src/mint.rs @@ -2,9 +2,9 @@ use entry::Entry; use hash::{hash, Hash}; -use pubkey::Pubkey; use ring::rand::SystemRandom; use signature::{Keypair, KeypairUtil}; +use solana_program_interface::pubkey::Pubkey; use system_transaction::SystemTransaction; use transaction::Transaction; use untrusted::Input; diff --git a/src/packet.rs b/src/packet.rs index 6843de621..6e8a828a8 100644 --- a/src/packet.rs +++ b/src/packet.rs @@ -7,11 +7,11 @@ use hash::Hash; #[cfg(test)] use ledger::{next_entries_mut, Block}; use log::Level; -use pubkey::Pubkey; use recvmmsg::{recv_mmsg, NUM_RCVMMSGS}; use recycler; use result::{Error, Result}; use serde::Serialize; +use solana_program_interface::pubkey::Pubkey; use std::fmt; use std::io; use std::mem::size_of; diff --git a/src/payment_plan.rs b/src/payment_plan.rs index 7ee69612b..62c89ca9f 100644 --- a/src/payment_plan.rs +++ b/src/payment_plan.rs @@ -4,7 +4,7 @@ //! `Payment`, the payment is executed. use chrono::prelude::*; -use pubkey::Pubkey; +use solana_program_interface::pubkey::Pubkey; /// The types of events a payment plan can process. #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] diff --git a/src/request.rs b/src/request.rs index 5eafb1389..ec96d7a0e 100644 --- a/src/request.rs +++ b/src/request.rs @@ -1,9 +1,9 @@ //! The `request` module defines the messages for the thin client. -use account::Account; use hash::Hash; -use pubkey::Pubkey; use signature::Signature; +use solana_program_interface::account::Account; +use solana_program_interface::pubkey::Pubkey; #[cfg_attr(feature = "cargo-clippy", allow(large_enum_variant))] #[derive(Serialize, Deserialize, Debug, Clone, Copy)] diff --git a/src/rpc.rs b/src/rpc.rs index 4a13989a8..271ebda91 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -1,14 +1,14 @@ //! The `rpc` module implements the Solana RPC interface. -use account::Account; use bank::{Bank, BankError}; use bincode::deserialize; use bs58; use jsonrpc_core::*; use jsonrpc_http_server::*; -use pubkey::Pubkey; use service::Service; use signature::Signature; +use solana_program_interface::account::Account; +use solana_program_interface::pubkey::Pubkey; use std::mem; use std::net::{SocketAddr, UdpSocket}; use std::result; diff --git a/src/signature.rs b/src/signature.rs index 33a8e6d03..b67d38dd3 100644 --- a/src/signature.rs +++ b/src/signature.rs @@ -3,12 +3,12 @@ use bs58; use generic_array::typenum::U64; use generic_array::GenericArray; -use pubkey::Pubkey; use rand::{ChaChaRng, Rng, SeedableRng}; use rayon::prelude::*; use ring::signature::Ed25519KeyPair; use ring::{rand, signature}; use serde_json; +use solana_program_interface::pubkey::Pubkey; use std::error; use std::fmt; use std::fs::File; diff --git a/src/sigverify.rs b/src/sigverify.rs index 181c01e46..28bc0376c 100644 --- a/src/sigverify.rs +++ b/src/sigverify.rs @@ -43,9 +43,9 @@ pub fn init() { } fn verify_packet(packet: &Packet) -> u8 { - use pubkey::Pubkey; use ring::signature; use signature::Signature; + use solana_program_interface::pubkey::Pubkey; use untrusted; let msg_start = TX_OFFSET + SIGNED_DATA_OFFSET; diff --git a/src/storage_program.rs b/src/storage_program.rs index 22e87bab9..09c0aa43a 100644 --- a/src/storage_program.rs +++ b/src/storage_program.rs @@ -2,9 +2,9 @@ //! Receive mining proofs from miners, validate the answers //! and give reward for good proofs. -use account::Account; use bincode::deserialize; -use pubkey::Pubkey; +use solana_program_interface::account::Account; +use solana_program_interface::pubkey::Pubkey; use transaction::Transaction; #[derive(Serialize, Deserialize, Debug, Clone)] diff --git a/src/system_program.rs b/src/system_program.rs index 4ca41f43e..e2d225f22 100644 --- a/src/system_program.rs +++ b/src/system_program.rs @@ -1,9 +1,9 @@ //! system program -use account::Account; use bincode::deserialize; use dynamic_program::DynamicProgram; -use pubkey::Pubkey; +use solana_program_interface::account::Account; +use solana_program_interface::pubkey::Pubkey; use std::collections::HashMap; use std::sync::RwLock; use transaction::Transaction; @@ -97,11 +97,11 @@ impl SystemProgram { } #[cfg(test)] mod test { - use account::{Account, KeyedAccount}; use bincode::serialize; use hash::Hash; - use pubkey::Pubkey; use signature::{Keypair, KeypairUtil}; + use solana_program_interface::account::{Account, KeyedAccount}; + use solana_program_interface::pubkey::Pubkey; use std::collections::HashMap; use std::sync::RwLock; use std::thread; diff --git a/src/system_transaction.rs b/src/system_transaction.rs index 6cc171068..54dd97854 100644 --- a/src/system_transaction.rs +++ b/src/system_transaction.rs @@ -2,8 +2,8 @@ use bincode::serialize; use hash::Hash; -use pubkey::Pubkey; use signature::{Keypair, KeypairUtil}; +use solana_program_interface::pubkey::Pubkey; use system_program::SystemProgram; use transaction::Transaction; diff --git a/src/thin_client.rs b/src/thin_client.rs index 25027d5ec..78708f429 100644 --- a/src/thin_client.rs +++ b/src/thin_client.rs @@ -3,17 +3,17 @@ //! messages to the network directly. The binary encoding of its messages are //! unstable and may change in future releases. -use account::Account; use bank::Bank; use bincode::{deserialize, serialize}; use crdt::{Crdt, CrdtError, NodeInfo}; use hash::Hash; use log::Level; use ncp::Ncp; -use pubkey::Pubkey; use request::{Request, Response}; use result::{Error, Result}; use signature::{Keypair, Signature}; +use solana_program_interface::account::Account; +use solana_program_interface::pubkey::Pubkey; use std; use std::collections::HashMap; use std::io; diff --git a/src/tictactoe_program.rs b/src/tictactoe_program.rs index f08a7b655..de951aac0 100644 --- a/src/tictactoe_program.rs +++ b/src/tictactoe_program.rs @@ -1,8 +1,8 @@ //! tic-tac-toe program -use account::Account; -use pubkey::Pubkey; use serde_cbor; +use solana_program_interface::account::Account; +use solana_program_interface::pubkey::Pubkey; use std; use transaction::Transaction; diff --git a/src/transaction.rs b/src/transaction.rs index aaee37c2b..64c710836 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -2,8 +2,8 @@ use bincode::serialize; use hash::{Hash, Hasher}; -use pubkey::Pubkey; use signature::{Keypair, KeypairUtil, Signature}; +use solana_program_interface::pubkey::Pubkey; use std::mem::size_of; pub const SIGNED_DATA_OFFSET: usize = size_of::(); diff --git a/src/vote_stage.rs b/src/vote_stage.rs index 9894e0849..504b68067 100644 --- a/src/vote_stage.rs +++ b/src/vote_stage.rs @@ -10,9 +10,9 @@ use influx_db_client as influxdb; use log::Level; use metrics; use packet::{BlobRecycler, SharedBlob}; -use pubkey::Pubkey; use result::Result; use signature::Keypair; +use solana_program_interface::pubkey::Pubkey; use std::result; use std::sync::atomic::AtomicUsize; use std::sync::{Arc, RwLock}; diff --git a/src/wallet.rs b/src/wallet.rs index 52ff1f884..1bb5de83b 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -8,13 +8,13 @@ use crdt::NodeInfo; use drone::DroneRequest; use fullnode::Config; use hash::Hash; -use pubkey::Pubkey; use reqwest; use reqwest::header::CONTENT_TYPE; use ring::rand::SystemRandom; use ring::signature::Ed25519KeyPair; use serde_json::{self, Value}; use signature::{Keypair, KeypairUtil, Signature}; +use solana_program_interface::pubkey::Pubkey; use std::fs::{self, File}; use std::io::prelude::*; use std::io::{Error, ErrorKind, Write}; diff --git a/src/window.rs b/src/window.rs index 4d51c0896..339a0a53c 100644 --- a/src/window.rs +++ b/src/window.rs @@ -8,8 +8,8 @@ use erasure; use ledger::{reconstruct_entries_from_blobs, Block}; use log::Level; use packet::{BlobRecycler, SharedBlob}; -use pubkey::Pubkey; use result::Result; +use solana_program_interface::pubkey::Pubkey; use std::cmp; use std::mem; use std::net::SocketAddr; @@ -450,7 +450,7 @@ pub fn new_window_from_entries( #[cfg(test)] mod test { use packet::{Blob, BlobRecycler, Packet, Packets, PACKET_DATA_SIZE}; - use pubkey::Pubkey; + use solana_program_interface::pubkey::Pubkey; use std::io; use std::io::Write; use std::net::UdpSocket; diff --git a/src/window_service.rs b/src/window_service.rs index 36c07c814..74f418b73 100644 --- a/src/window_service.rs +++ b/src/window_service.rs @@ -5,9 +5,9 @@ use crdt::{Crdt, NodeInfo}; use entry::EntrySender; use log::Level; use packet::{BlobRecycler, SharedBlob}; -use pubkey::Pubkey; use rand::{thread_rng, Rng}; use result::{Error, Result}; +use solana_program_interface::pubkey::Pubkey; use std::net::UdpSocket; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::sync::mpsc::RecvTimeoutError; diff --git a/src/write_stage.rs b/src/write_stage.rs index 577b04bd1..d4474dd11 100644 --- a/src/write_stage.rs +++ b/src/write_stage.rs @@ -299,9 +299,9 @@ mod tests { use entry::Entry; use hash::Hash; use ledger::{genesis, next_entries_mut, read_ledger}; - use pubkey::Pubkey; use service::Service; use signature::{Keypair, KeypairUtil}; + use solana_program_interface::pubkey::Pubkey; use std::fs::remove_dir_all; use std::sync::mpsc::{channel, Receiver, Sender}; use std::sync::{Arc, RwLock}; diff --git a/tests/multinode.rs b/tests/multinode.rs index 052ed5af7..57cee633c 100644 --- a/tests/multinode.rs +++ b/tests/multinode.rs @@ -4,6 +4,7 @@ extern crate bincode; extern crate chrono; extern crate serde_json; extern crate solana; +extern crate solana_program_interface; use solana::crdt::{Crdt, Node, NodeInfo}; use solana::entry::Entry; @@ -13,13 +14,13 @@ use solana::ledger::{read_ledger, LedgerWriter}; use solana::logger; use solana::mint::Mint; use solana::ncp::Ncp; -use solana::pubkey::Pubkey; use solana::result; use solana::service::Service; use solana::signature::{Keypair, KeypairUtil}; use solana::thin_client::ThinClient; use solana::timing::{duration_as_ms, duration_as_s}; use solana::window::{default_window, WINDOW_SIZE}; +use solana_program_interface::pubkey::Pubkey; use std::env; use std::fs::{copy, create_dir_all, remove_dir_all}; use std::net::UdpSocket;