break dependency of programs on solana core (#1371)
* break dependency of programs on Solana core
This commit is contained in:
parent
874addc51a
commit
9c47e022dc
|
@ -105,6 +105,7 @@ serde_cbor = "0.9.0"
|
||||||
serde_derive = "1.0.27"
|
serde_derive = "1.0.27"
|
||||||
serde_json = "1.0.10"
|
serde_json = "1.0.10"
|
||||||
socket2 = "0.3.8"
|
socket2 = "0.3.8"
|
||||||
|
solana_program_interface = { path = "common" }
|
||||||
sys-info = "0.5.6"
|
sys-info = "0.5.6"
|
||||||
tokio = "0.1"
|
tokio = "0.1"
|
||||||
tokio-codec = "0.1"
|
tokio-codec = "0.1"
|
||||||
|
@ -133,12 +134,14 @@ name = "sigverify"
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
".",
|
".",
|
||||||
|
"common",
|
||||||
"programs/noop",
|
"programs/noop",
|
||||||
"programs/print",
|
"programs/print",
|
||||||
"programs/move_funds",
|
"programs/move_funds",
|
||||||
]
|
]
|
||||||
default-members = [
|
default-members = [
|
||||||
".",
|
".",
|
||||||
|
"common",
|
||||||
"programs/noop",
|
"programs/noop",
|
||||||
"programs/print",
|
"programs/print",
|
||||||
"programs/move_funds",
|
"programs/move_funds",
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
[package]
|
||||||
|
name = "solana_program_interface"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = [
|
||||||
|
"Anatoly Yakovenko <anatoly@solana.com>",
|
||||||
|
"Greg Fitzgerald <greg@solana.com>",
|
||||||
|
"Stephen Akridge <stephen@solana.com>",
|
||||||
|
"Michael Vines <mvines@solana.com>",
|
||||||
|
"Rob Walker <rob@solana.com>",
|
||||||
|
"Pankaj Garg <pankaj@solana.com>",
|
||||||
|
"Tyera Eulberg <tyera@solana.com>",
|
||||||
|
"Jack May <jack@solana.com>",
|
||||||
|
]
|
||||||
|
|
||||||
|
[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"
|
||||||
|
|
||||||
|
|
|
@ -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;
|
|
@ -15,8 +15,7 @@ authors = [
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bincode = "1.0.0"
|
bincode = "1.0.0"
|
||||||
generic-array = { version = "0.12.0", default-features = false, features = ["serde"] }
|
generic-array = { version = "0.12.0", default-features = false, features = ["serde"] }
|
||||||
libloading = "0.5.0"
|
solana_program_interface = { path = "../../common" }
|
||||||
solana = { path = "../.." }
|
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "move_funds"
|
name = "move_funds"
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
extern crate bincode;
|
extern crate bincode;
|
||||||
extern crate solana;
|
extern crate solana_program_interface;
|
||||||
|
|
||||||
use bincode::deserialize;
|
use bincode::deserialize;
|
||||||
use solana::account::KeyedAccount;
|
use solana_program_interface::account::KeyedAccount;
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn process(infos: &mut Vec<KeyedAccount>, data: &[u8]) {
|
pub extern "C" fn process(infos: &mut Vec<KeyedAccount>, data: &[u8]) {
|
||||||
|
@ -22,8 +22,8 @@ pub extern "C" fn process(infos: &mut Vec<KeyedAccount>, data: &[u8]) {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use bincode::serialize;
|
use bincode::serialize;
|
||||||
use solana::account::Account;
|
use solana_program_interface::account::Account;
|
||||||
use solana::pubkey::Pubkey;
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_move_funds() {
|
fn test_move_funds() {
|
||||||
|
|
|
@ -13,8 +13,7 @@ authors = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libloading = "0.5.0"
|
solana_program_interface = { path = "../../common" }
|
||||||
solana = { path = "../.." }
|
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "noop"
|
name = "noop"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
extern crate solana;
|
extern crate solana_program_interface;
|
||||||
|
|
||||||
use solana::account::KeyedAccount;
|
use solana_program_interface::account::KeyedAccount;
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn process(_infos: &mut Vec<KeyedAccount>, _data: &[u8]) {}
|
pub extern "C" fn process(_infos: &mut Vec<KeyedAccount>, _data: &[u8]) {}
|
||||||
|
|
|
@ -13,8 +13,7 @@ authors = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libloading = "0.5.0"
|
solana_program_interface = { path = "../../common" }
|
||||||
solana = { path = "../.." }
|
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "print"
|
name = "print"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
extern crate solana;
|
extern crate solana_program_interface;
|
||||||
|
|
||||||
use solana::account::KeyedAccount;
|
use solana_program_interface::account::KeyedAccount;
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn process(infos: &mut Vec<KeyedAccount>, _data: &[u8]) {
|
pub extern "C" fn process(infos: &mut Vec<KeyedAccount>, _data: &[u8]) {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
//! on behalf of the caller, and a low-level API for when they have
|
//! on behalf of the caller, and a low-level API for when they have
|
||||||
//! already been signed and verified.
|
//! already been signed and verified.
|
||||||
|
|
||||||
use account::{Account, KeyedAccount};
|
|
||||||
use bincode::deserialize;
|
use bincode::deserialize;
|
||||||
use bincode::serialize;
|
use bincode::serialize;
|
||||||
use budget_program::BudgetState;
|
use budget_program::BudgetState;
|
||||||
|
@ -17,8 +16,9 @@ use ledger::Block;
|
||||||
use log::Level;
|
use log::Level;
|
||||||
use mint::Mint;
|
use mint::Mint;
|
||||||
use payment_plan::Payment;
|
use payment_plan::Payment;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use signature::{Keypair, Signature};
|
use signature::{Keypair, Signature};
|
||||||
|
use solana_program_interface::account::{Account, KeyedAccount};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std;
|
use std;
|
||||||
use std::collections::{BTreeMap, HashMap, VecDeque};
|
use std::collections::{BTreeMap, HashMap, VecDeque};
|
||||||
use std::result;
|
use std::result;
|
||||||
|
|
|
@ -283,9 +283,9 @@ mod tests {
|
||||||
use entry::Entry;
|
use entry::Entry;
|
||||||
use ledger::next_entries_mut;
|
use ledger::next_entries_mut;
|
||||||
use mint::Mint;
|
use mint::Mint;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use service::Service;
|
use service::Service;
|
||||||
use signature::{Keypair, KeypairUtil};
|
use signature::{Keypair, KeypairUtil};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
use std::sync::atomic::AtomicBool;
|
use std::sync::atomic::AtomicBool;
|
||||||
use std::sync::mpsc::{channel, Sender};
|
use std::sync::mpsc::{channel, Sender};
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
use chrono::prelude::*;
|
use chrono::prelude::*;
|
||||||
use payment_plan::{Payment, Witness};
|
use payment_plan::{Payment, Witness};
|
||||||
use pubkey::Pubkey;
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
||||||
/// A data type representing a `Witness` that the payment plan is waiting on.
|
/// A data type representing a `Witness` that the payment plan is waiting on.
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
//! budget program
|
//! budget program
|
||||||
use account::Account;
|
|
||||||
use bincode::{self, deserialize, serialize_into, serialized_size};
|
use bincode::{self, deserialize, serialize_into, serialized_size};
|
||||||
use budget::Budget;
|
use budget::Budget;
|
||||||
use budget_instruction::Instruction;
|
use budget_instruction::Instruction;
|
||||||
use chrono::prelude::{DateTime, Utc};
|
use chrono::prelude::{DateTime, Utc};
|
||||||
use payment_plan::Witness;
|
use payment_plan::Witness;
|
||||||
use pubkey::Pubkey;
|
use solana_program_interface::account::Account;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::io;
|
use std::io;
|
||||||
use transaction::Transaction;
|
use transaction::Transaction;
|
||||||
|
|
||||||
|
@ -265,14 +265,14 @@ impl BudgetState {
|
||||||
}
|
}
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use account::Account;
|
|
||||||
use bincode::serialize;
|
use bincode::serialize;
|
||||||
use budget_program::{BudgetError, BudgetState};
|
use budget_program::{BudgetError, BudgetState};
|
||||||
use budget_transaction::BudgetTransaction;
|
use budget_transaction::BudgetTransaction;
|
||||||
use chrono::prelude::{DateTime, NaiveDate, Utc};
|
use chrono::prelude::{DateTime, NaiveDate, Utc};
|
||||||
use hash::Hash;
|
use hash::Hash;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use signature::{GenKeys, Keypair, KeypairUtil};
|
use signature::{GenKeys, Keypair, KeypairUtil};
|
||||||
|
use solana_program_interface::account::Account;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use transaction::Transaction;
|
use transaction::Transaction;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -7,8 +7,8 @@ use budget_program::BudgetState;
|
||||||
use chrono::prelude::*;
|
use chrono::prelude::*;
|
||||||
use hash::Hash;
|
use hash::Hash;
|
||||||
use payment_plan::Payment;
|
use payment_plan::Payment;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use signature::Keypair;
|
use signature::Keypair;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use transaction::Transaction;
|
use transaction::Transaction;
|
||||||
|
|
||||||
pub trait BudgetTransaction {
|
pub trait BudgetTransaction {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use crdt::{CrdtError, NodeInfo};
|
use crdt::{CrdtError, NodeInfo};
|
||||||
use pubkey::Pubkey;
|
|
||||||
use rand::distributions::{Distribution, Weighted, WeightedChoice};
|
use rand::distributions::{Distribution, Weighted, WeightedChoice};
|
||||||
use rand::thread_rng;
|
use rand::thread_rng;
|
||||||
use result::Result;
|
use result::Result;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std;
|
use std;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
@ -192,8 +192,8 @@ impl<'a> ChooseGossipPeerStrategy for ChooseWeightedPeerStrategy<'a> {
|
||||||
mod tests {
|
mod tests {
|
||||||
use choose_gossip_peer_strategy::{ChooseWeightedPeerStrategy, DEFAULT_WEIGHT};
|
use choose_gossip_peer_strategy::{ChooseWeightedPeerStrategy, DEFAULT_WEIGHT};
|
||||||
use logger;
|
use logger;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use signature::{Keypair, KeypairUtil};
|
use signature::{Keypair, KeypairUtil};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std;
|
use std;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,11 @@ use ledger::LedgerWindow;
|
||||||
use log::Level;
|
use log::Level;
|
||||||
use netutil::{bind_in_range, bind_to, multi_bind_in_range};
|
use netutil::{bind_in_range, bind_to, multi_bind_in_range};
|
||||||
use packet::{to_blob, Blob, BlobRecycler, SharedBlob, BLOB_SIZE};
|
use packet::{to_blob, Blob, BlobRecycler, SharedBlob, BLOB_SIZE};
|
||||||
use pubkey::Pubkey;
|
|
||||||
use rand::{thread_rng, Rng};
|
use rand::{thread_rng, Rng};
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use result::{Error, Result};
|
use result::{Error, Result};
|
||||||
use signature::{Keypair, KeypairUtil};
|
use signature::{Keypair, KeypairUtil};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std;
|
use std;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket};
|
use std::net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket};
|
||||||
|
@ -1409,9 +1409,9 @@ mod tests {
|
||||||
use ledger::{LedgerWindow, LedgerWriter};
|
use ledger::{LedgerWindow, LedgerWriter};
|
||||||
use logger;
|
use logger;
|
||||||
use packet::BlobRecycler;
|
use packet::BlobRecycler;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use result::Error;
|
use result::Error;
|
||||||
use signature::{Keypair, KeypairUtil};
|
use signature::{Keypair, KeypairUtil};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::fs::remove_dir_all;
|
use std::fs::remove_dir_all;
|
||||||
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
|
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
|
|
|
@ -8,8 +8,8 @@ use bincode::{deserialize, serialize};
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use influx_db_client as influxdb;
|
use influx_db_client as influxdb;
|
||||||
use metrics;
|
use metrics;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use signature::{Keypair, Signature};
|
use signature::{Keypair, Signature};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::io::{Error, ErrorKind};
|
use std::io::{Error, ErrorKind};
|
||||||
use std::net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket};
|
use std::net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket};
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
extern crate bincode;
|
extern crate bincode;
|
||||||
extern crate generic_array;
|
extern crate generic_array;
|
||||||
|
|
||||||
use account::KeyedAccount;
|
|
||||||
use libc;
|
use libc;
|
||||||
use libloading;
|
use libloading;
|
||||||
|
use solana_program_interface::account::KeyedAccount;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
|
@ -98,9 +98,9 @@ impl DynamicProgram {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use account::Account;
|
|
||||||
use bincode::serialize;
|
use bincode::serialize;
|
||||||
use pubkey::Pubkey;
|
use solana_program_interface::account::Account;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@ use budget_transaction::BudgetTransaction;
|
||||||
use hash::Hash;
|
use hash::Hash;
|
||||||
use packet::{BlobRecycler, SharedBlob, BLOB_DATA_SIZE};
|
use packet::{BlobRecycler, SharedBlob, BLOB_DATA_SIZE};
|
||||||
use poh::Poh;
|
use poh::Poh;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::io::Cursor;
|
use std::io::Cursor;
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use std::sync::mpsc::{Receiver, Sender};
|
use std::sync::mpsc::{Receiver, Sender};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Support erasure coding
|
// Support erasure coding
|
||||||
use packet::{BlobRecycler, SharedBlob, BLOB_DATA_SIZE, BLOB_HEADER_SIZE};
|
use packet::{BlobRecycler, SharedBlob, BLOB_DATA_SIZE, BLOB_HEADER_SIZE};
|
||||||
use pubkey::Pubkey;
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::result;
|
use std::result;
|
||||||
|
@ -603,9 +603,9 @@ mod test {
|
||||||
use erasure;
|
use erasure;
|
||||||
use logger;
|
use logger;
|
||||||
use packet::{BlobRecycler, BLOB_DATA_SIZE, BLOB_HEADER_SIZE, BLOB_SIZE};
|
use packet::{BlobRecycler, BLOB_DATA_SIZE, BLOB_HEADER_SIZE, BLOB_SIZE};
|
||||||
use pubkey::Pubkey;
|
|
||||||
use rand::{thread_rng, Rng};
|
use rand::{thread_rng, Rng};
|
||||||
use signature::{Keypair, KeypairUtil};
|
use signature::{Keypair, KeypairUtil};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
// use std::sync::{Arc, RwLock};
|
// use std::sync::{Arc, RwLock};
|
||||||
use window::{index_blobs, WindowSlot};
|
use window::{index_blobs, WindowSlot};
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,11 @@ use drone::DRONE_PORT;
|
||||||
use entry::Entry;
|
use entry::Entry;
|
||||||
use ledger::read_ledger;
|
use ledger::read_ledger;
|
||||||
use ncp::Ncp;
|
use ncp::Ncp;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use rpc::{JsonRpcService, RPC_PORT};
|
use rpc::{JsonRpcService, RPC_PORT};
|
||||||
use rpu::Rpu;
|
use rpu::Rpu;
|
||||||
use service::Service;
|
use service::Service;
|
||||||
use signature::{Keypair, KeypairUtil};
|
use signature::{Keypair, KeypairUtil};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
|
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
|
|
|
@ -11,11 +11,11 @@ use log::Level::Trace;
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
use mint::Mint;
|
use mint::Mint;
|
||||||
use packet::{self, SharedBlob, BLOB_DATA_SIZE};
|
use packet::{self, SharedBlob, BLOB_DATA_SIZE};
|
||||||
use pubkey::Pubkey;
|
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use result::{Error, Result};
|
use result::{Error, Result};
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
use signature::{Keypair, KeypairUtil};
|
use signature::{Keypair, KeypairUtil};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::fs::{create_dir_all, remove_dir_all, File, OpenOptions};
|
use std::fs::{create_dir_all, remove_dir_all, File, OpenOptions};
|
||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
use std::io::{self, BufReader, BufWriter, Seek, SeekFrom};
|
use std::io::{self, BufReader, BufWriter, Seek, SeekFrom};
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
#![cfg_attr(feature = "unstable", feature(test))]
|
#![cfg_attr(feature = "unstable", feature(test))]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
pub mod counter;
|
pub mod counter;
|
||||||
pub mod account;
|
|
||||||
pub mod bank;
|
pub mod bank;
|
||||||
pub mod banking_stage;
|
pub mod banking_stage;
|
||||||
pub mod blob_fetch_stage;
|
pub mod blob_fetch_stage;
|
||||||
|
@ -41,7 +40,6 @@ pub mod packet;
|
||||||
pub mod payment_plan;
|
pub mod payment_plan;
|
||||||
pub mod poh;
|
pub mod poh;
|
||||||
pub mod poh_recorder;
|
pub mod poh_recorder;
|
||||||
pub mod pubkey;
|
|
||||||
pub mod recvmmsg;
|
pub mod recvmmsg;
|
||||||
pub mod recycler;
|
pub mod recycler;
|
||||||
pub mod replicate_stage;
|
pub mod replicate_stage;
|
||||||
|
@ -84,6 +82,7 @@ extern crate generic_array;
|
||||||
extern crate ipnetwork;
|
extern crate ipnetwork;
|
||||||
extern crate itertools;
|
extern crate itertools;
|
||||||
extern crate jsonrpc_core;
|
extern crate jsonrpc_core;
|
||||||
|
extern crate solana_program_interface;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate jsonrpc_macros;
|
extern crate jsonrpc_macros;
|
||||||
extern crate jsonrpc_http_server;
|
extern crate jsonrpc_http_server;
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
use entry::Entry;
|
use entry::Entry;
|
||||||
use hash::{hash, Hash};
|
use hash::{hash, Hash};
|
||||||
use pubkey::Pubkey;
|
|
||||||
use ring::rand::SystemRandom;
|
use ring::rand::SystemRandom;
|
||||||
use signature::{Keypair, KeypairUtil};
|
use signature::{Keypair, KeypairUtil};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use system_transaction::SystemTransaction;
|
use system_transaction::SystemTransaction;
|
||||||
use transaction::Transaction;
|
use transaction::Transaction;
|
||||||
use untrusted::Input;
|
use untrusted::Input;
|
||||||
|
|
|
@ -7,11 +7,11 @@ use hash::Hash;
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
use ledger::{next_entries_mut, Block};
|
use ledger::{next_entries_mut, Block};
|
||||||
use log::Level;
|
use log::Level;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use recvmmsg::{recv_mmsg, NUM_RCVMMSGS};
|
use recvmmsg::{recv_mmsg, NUM_RCVMMSGS};
|
||||||
use recycler;
|
use recycler;
|
||||||
use result::{Error, Result};
|
use result::{Error, Result};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::mem::size_of;
|
use std::mem::size_of;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
//! `Payment`, the payment is executed.
|
//! `Payment`, the payment is executed.
|
||||||
|
|
||||||
use chrono::prelude::*;
|
use chrono::prelude::*;
|
||||||
use pubkey::Pubkey;
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
|
|
||||||
/// The types of events a payment plan can process.
|
/// The types of events a payment plan can process.
|
||||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
|
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
//! The `request` module defines the messages for the thin client.
|
//! The `request` module defines the messages for the thin client.
|
||||||
|
|
||||||
use account::Account;
|
|
||||||
use hash::Hash;
|
use hash::Hash;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use signature::Signature;
|
use signature::Signature;
|
||||||
|
use solana_program_interface::account::Account;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
|
|
||||||
#[cfg_attr(feature = "cargo-clippy", allow(large_enum_variant))]
|
#[cfg_attr(feature = "cargo-clippy", allow(large_enum_variant))]
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy)]
|
#[derive(Serialize, Deserialize, Debug, Clone, Copy)]
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
//! The `rpc` module implements the Solana RPC interface.
|
//! The `rpc` module implements the Solana RPC interface.
|
||||||
|
|
||||||
use account::Account;
|
|
||||||
use bank::{Bank, BankError};
|
use bank::{Bank, BankError};
|
||||||
use bincode::deserialize;
|
use bincode::deserialize;
|
||||||
use bs58;
|
use bs58;
|
||||||
use jsonrpc_core::*;
|
use jsonrpc_core::*;
|
||||||
use jsonrpc_http_server::*;
|
use jsonrpc_http_server::*;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use service::Service;
|
use service::Service;
|
||||||
use signature::Signature;
|
use signature::Signature;
|
||||||
|
use solana_program_interface::account::Account;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::net::{SocketAddr, UdpSocket};
|
use std::net::{SocketAddr, UdpSocket};
|
||||||
use std::result;
|
use std::result;
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
use bs58;
|
use bs58;
|
||||||
use generic_array::typenum::U64;
|
use generic_array::typenum::U64;
|
||||||
use generic_array::GenericArray;
|
use generic_array::GenericArray;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use rand::{ChaChaRng, Rng, SeedableRng};
|
use rand::{ChaChaRng, Rng, SeedableRng};
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use ring::signature::Ed25519KeyPair;
|
use ring::signature::Ed25519KeyPair;
|
||||||
use ring::{rand, signature};
|
use ring::{rand, signature};
|
||||||
use serde_json;
|
use serde_json;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::error;
|
use std::error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
|
|
|
@ -43,9 +43,9 @@ pub fn init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn verify_packet(packet: &Packet) -> u8 {
|
fn verify_packet(packet: &Packet) -> u8 {
|
||||||
use pubkey::Pubkey;
|
|
||||||
use ring::signature;
|
use ring::signature;
|
||||||
use signature::Signature;
|
use signature::Signature;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use untrusted;
|
use untrusted;
|
||||||
|
|
||||||
let msg_start = TX_OFFSET + SIGNED_DATA_OFFSET;
|
let msg_start = TX_OFFSET + SIGNED_DATA_OFFSET;
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
//! Receive mining proofs from miners, validate the answers
|
//! Receive mining proofs from miners, validate the answers
|
||||||
//! and give reward for good proofs.
|
//! and give reward for good proofs.
|
||||||
|
|
||||||
use account::Account;
|
|
||||||
use bincode::deserialize;
|
use bincode::deserialize;
|
||||||
use pubkey::Pubkey;
|
use solana_program_interface::account::Account;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use transaction::Transaction;
|
use transaction::Transaction;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
//! system program
|
//! system program
|
||||||
|
|
||||||
use account::Account;
|
|
||||||
use bincode::deserialize;
|
use bincode::deserialize;
|
||||||
use dynamic_program::DynamicProgram;
|
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::collections::HashMap;
|
||||||
use std::sync::RwLock;
|
use std::sync::RwLock;
|
||||||
use transaction::Transaction;
|
use transaction::Transaction;
|
||||||
|
@ -97,11 +97,11 @@ impl SystemProgram {
|
||||||
}
|
}
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use account::{Account, KeyedAccount};
|
|
||||||
use bincode::serialize;
|
use bincode::serialize;
|
||||||
use hash::Hash;
|
use hash::Hash;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use signature::{Keypair, KeypairUtil};
|
use signature::{Keypair, KeypairUtil};
|
||||||
|
use solana_program_interface::account::{Account, KeyedAccount};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::sync::RwLock;
|
use std::sync::RwLock;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
use bincode::serialize;
|
use bincode::serialize;
|
||||||
use hash::Hash;
|
use hash::Hash;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use signature::{Keypair, KeypairUtil};
|
use signature::{Keypair, KeypairUtil};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use system_program::SystemProgram;
|
use system_program::SystemProgram;
|
||||||
use transaction::Transaction;
|
use transaction::Transaction;
|
||||||
|
|
||||||
|
|
|
@ -3,17 +3,17 @@
|
||||||
//! messages to the network directly. The binary encoding of its messages are
|
//! messages to the network directly. The binary encoding of its messages are
|
||||||
//! unstable and may change in future releases.
|
//! unstable and may change in future releases.
|
||||||
|
|
||||||
use account::Account;
|
|
||||||
use bank::Bank;
|
use bank::Bank;
|
||||||
use bincode::{deserialize, serialize};
|
use bincode::{deserialize, serialize};
|
||||||
use crdt::{Crdt, CrdtError, NodeInfo};
|
use crdt::{Crdt, CrdtError, NodeInfo};
|
||||||
use hash::Hash;
|
use hash::Hash;
|
||||||
use log::Level;
|
use log::Level;
|
||||||
use ncp::Ncp;
|
use ncp::Ncp;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use request::{Request, Response};
|
use request::{Request, Response};
|
||||||
use result::{Error, Result};
|
use result::{Error, Result};
|
||||||
use signature::{Keypair, Signature};
|
use signature::{Keypair, Signature};
|
||||||
|
use solana_program_interface::account::Account;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std;
|
use std;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
//! tic-tac-toe program
|
//! tic-tac-toe program
|
||||||
|
|
||||||
use account::Account;
|
|
||||||
use pubkey::Pubkey;
|
|
||||||
use serde_cbor;
|
use serde_cbor;
|
||||||
|
use solana_program_interface::account::Account;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std;
|
use std;
|
||||||
use transaction::Transaction;
|
use transaction::Transaction;
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
use bincode::serialize;
|
use bincode::serialize;
|
||||||
use hash::{Hash, Hasher};
|
use hash::{Hash, Hasher};
|
||||||
use pubkey::Pubkey;
|
|
||||||
use signature::{Keypair, KeypairUtil, Signature};
|
use signature::{Keypair, KeypairUtil, Signature};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::mem::size_of;
|
use std::mem::size_of;
|
||||||
|
|
||||||
pub const SIGNED_DATA_OFFSET: usize = size_of::<Signature>();
|
pub const SIGNED_DATA_OFFSET: usize = size_of::<Signature>();
|
||||||
|
|
|
@ -10,9 +10,9 @@ use influx_db_client as influxdb;
|
||||||
use log::Level;
|
use log::Level;
|
||||||
use metrics;
|
use metrics;
|
||||||
use packet::{BlobRecycler, SharedBlob};
|
use packet::{BlobRecycler, SharedBlob};
|
||||||
use pubkey::Pubkey;
|
|
||||||
use result::Result;
|
use result::Result;
|
||||||
use signature::Keypair;
|
use signature::Keypair;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::result;
|
use std::result;
|
||||||
use std::sync::atomic::AtomicUsize;
|
use std::sync::atomic::AtomicUsize;
|
||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
|
|
|
@ -8,13 +8,13 @@ use crdt::NodeInfo;
|
||||||
use drone::DroneRequest;
|
use drone::DroneRequest;
|
||||||
use fullnode::Config;
|
use fullnode::Config;
|
||||||
use hash::Hash;
|
use hash::Hash;
|
||||||
use pubkey::Pubkey;
|
|
||||||
use reqwest;
|
use reqwest;
|
||||||
use reqwest::header::CONTENT_TYPE;
|
use reqwest::header::CONTENT_TYPE;
|
||||||
use ring::rand::SystemRandom;
|
use ring::rand::SystemRandom;
|
||||||
use ring::signature::Ed25519KeyPair;
|
use ring::signature::Ed25519KeyPair;
|
||||||
use serde_json::{self, Value};
|
use serde_json::{self, Value};
|
||||||
use signature::{Keypair, KeypairUtil, Signature};
|
use signature::{Keypair, KeypairUtil, Signature};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::fs::{self, File};
|
use std::fs::{self, File};
|
||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
use std::io::{Error, ErrorKind, Write};
|
use std::io::{Error, ErrorKind, Write};
|
||||||
|
|
|
@ -8,8 +8,8 @@ use erasure;
|
||||||
use ledger::{reconstruct_entries_from_blobs, Block};
|
use ledger::{reconstruct_entries_from_blobs, Block};
|
||||||
use log::Level;
|
use log::Level;
|
||||||
use packet::{BlobRecycler, SharedBlob};
|
use packet::{BlobRecycler, SharedBlob};
|
||||||
use pubkey::Pubkey;
|
|
||||||
use result::Result;
|
use result::Result;
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
|
@ -450,7 +450,7 @@ pub fn new_window_from_entries(
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use packet::{Blob, BlobRecycler, Packet, Packets, PACKET_DATA_SIZE};
|
use packet::{Blob, BlobRecycler, Packet, Packets, PACKET_DATA_SIZE};
|
||||||
use pubkey::Pubkey;
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
|
|
|
@ -5,9 +5,9 @@ use crdt::{Crdt, NodeInfo};
|
||||||
use entry::EntrySender;
|
use entry::EntrySender;
|
||||||
use log::Level;
|
use log::Level;
|
||||||
use packet::{BlobRecycler, SharedBlob};
|
use packet::{BlobRecycler, SharedBlob};
|
||||||
use pubkey::Pubkey;
|
|
||||||
use rand::{thread_rng, Rng};
|
use rand::{thread_rng, Rng};
|
||||||
use result::{Error, Result};
|
use result::{Error, Result};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
|
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
|
||||||
use std::sync::mpsc::RecvTimeoutError;
|
use std::sync::mpsc::RecvTimeoutError;
|
||||||
|
|
|
@ -299,9 +299,9 @@ mod tests {
|
||||||
use entry::Entry;
|
use entry::Entry;
|
||||||
use hash::Hash;
|
use hash::Hash;
|
||||||
use ledger::{genesis, next_entries_mut, read_ledger};
|
use ledger::{genesis, next_entries_mut, read_ledger};
|
||||||
use pubkey::Pubkey;
|
|
||||||
use service::Service;
|
use service::Service;
|
||||||
use signature::{Keypair, KeypairUtil};
|
use signature::{Keypair, KeypairUtil};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::fs::remove_dir_all;
|
use std::fs::remove_dir_all;
|
||||||
use std::sync::mpsc::{channel, Receiver, Sender};
|
use std::sync::mpsc::{channel, Receiver, Sender};
|
||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
|
|
|
@ -4,6 +4,7 @@ extern crate bincode;
|
||||||
extern crate chrono;
|
extern crate chrono;
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
extern crate solana;
|
extern crate solana;
|
||||||
|
extern crate solana_program_interface;
|
||||||
|
|
||||||
use solana::crdt::{Crdt, Node, NodeInfo};
|
use solana::crdt::{Crdt, Node, NodeInfo};
|
||||||
use solana::entry::Entry;
|
use solana::entry::Entry;
|
||||||
|
@ -13,13 +14,13 @@ use solana::ledger::{read_ledger, LedgerWriter};
|
||||||
use solana::logger;
|
use solana::logger;
|
||||||
use solana::mint::Mint;
|
use solana::mint::Mint;
|
||||||
use solana::ncp::Ncp;
|
use solana::ncp::Ncp;
|
||||||
use solana::pubkey::Pubkey;
|
|
||||||
use solana::result;
|
use solana::result;
|
||||||
use solana::service::Service;
|
use solana::service::Service;
|
||||||
use solana::signature::{Keypair, KeypairUtil};
|
use solana::signature::{Keypair, KeypairUtil};
|
||||||
use solana::thin_client::ThinClient;
|
use solana::thin_client::ThinClient;
|
||||||
use solana::timing::{duration_as_ms, duration_as_s};
|
use solana::timing::{duration_as_ms, duration_as_s};
|
||||||
use solana::window::{default_window, WINDOW_SIZE};
|
use solana::window::{default_window, WINDOW_SIZE};
|
||||||
|
use solana_program_interface::pubkey::Pubkey;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fs::{copy, create_dir_all, remove_dir_all};
|
use std::fs::{copy, create_dir_all, remove_dir_all};
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
|
|
Loading…
Reference in New Issue