Rust 2018 cleanup

This commit is contained in:
Michael Vines
2018-12-14 20:39:10 -08:00
committed by Grimes
parent aaa5cd4615
commit fd562cb9e2
59 changed files with 109 additions and 209 deletions

1
Cargo.lock generated
View File

@ -1778,6 +1778,7 @@ dependencies = [
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
"solana 0.11.0", "solana 0.11.0",
"solana-logger 0.11.0", "solana-logger 0.11.0",
"solana-netutil 0.11.0",
] ]
[[package]] [[package]]

View File

@ -2,7 +2,7 @@ use std::net::SocketAddr;
use std::process::exit; use std::process::exit;
use std::time::Duration; use std::time::Duration;
use clap::{App, Arg, ArgMatches}; use clap::{crate_version, App, Arg, ArgMatches};
use solana_drone::drone::DRONE_PORT; use solana_drone::drone::DRONE_PORT;
use solana_sdk::signature::{read_keypair, Keypair, KeypairUtil}; use solana_sdk::signature::{read_keypair, Keypair, KeypairUtil};

View File

@ -1,9 +1,3 @@
#[macro_use]
extern crate clap;
extern crate solana;
extern crate solana_sdk;
mod bench; mod bench;
mod cli; mod cli;

View File

@ -6,6 +6,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana" repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0" license = "Apache-2.0"
homepage = "https://solana.com/" homepage = "https://solana.com/"
edition = "2018"
[features] [features]
cuda = [] cuda = []

View File

@ -1,19 +1,8 @@
extern crate byteorder;
extern crate bytes;
#[macro_use]
extern crate clap;
extern crate log;
#[macro_use]
extern crate solana_drone;
extern crate solana_metrics;
extern crate solana_sdk;
extern crate tokio;
extern crate tokio_codec;
use byteorder::{ByteOrder, LittleEndian}; use byteorder::{ByteOrder, LittleEndian};
use bytes::Bytes; use bytes::Bytes;
use clap::{App, Arg}; use clap::{crate_version, App, Arg};
use solana_drone::drone::{Drone, DroneRequest, DRONE_PORT}; use solana_drone::drone::{Drone, DroneRequest, DRONE_PORT};
use solana_drone::socketaddr;
use solana_sdk::signature::read_keypair; use solana_sdk::signature::read_keypair;
use std::error; use std::error;
use std::io; use std::io;
@ -25,7 +14,6 @@ use tokio::prelude::*;
use tokio_codec::{BytesCodec, Decoder}; use tokio_codec::{BytesCodec, Decoder};
fn main() -> Result<(), Box<error::Error>> { fn main() -> Result<(), Box<error::Error>> {
//logger::setup();
solana_metrics::set_panic_hook("drone"); solana_metrics::set_panic_hook("drone");
let matches = App::new("drone") let matches = App::new("drone")
.version(crate_version!()) .version(crate_version!())

View File

@ -7,6 +7,8 @@
use bincode::{deserialize, serialize}; use bincode::{deserialize, serialize};
use byteorder::{ByteOrder, LittleEndian}; use byteorder::{ByteOrder, LittleEndian};
use bytes::Bytes; use bytes::Bytes;
use log::*;
use serde_derive::{Deserialize, Serialize};
use solana_metrics; use solana_metrics;
use solana_metrics::influxdb; use solana_metrics::influxdb;
use solana_sdk::hash::Hash; use solana_sdk::hash::Hash;

View File

@ -1,14 +1 @@
pub mod drone; pub mod drone;
extern crate bincode;
extern crate byteorder;
extern crate bytes;
#[macro_use]
extern crate log;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate solana_metrics;
extern crate solana_sdk;
extern crate tokio;
extern crate tokio_codec;

View File

@ -1,10 +1,7 @@
//! A command-line executable for generating the chain's genesis block. //! A command-line executable for generating the chain's genesis block.
#[macro_use] use clap::{crate_version, value_t_or_exit, App, Arg};
extern crate clap;
use serde_json; use serde_json;
use clap::{App, Arg};
use solana::db_ledger::genesis; use solana::db_ledger::genesis;
use solana::ledger::LedgerWriter; use solana::ledger::LedgerWriter;
use solana::mint::Mint; use solana::mint::Mint;

View File

@ -6,6 +6,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana" repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0" license = "Apache-2.0"
homepage = "https://solana.com/" homepage = "https://solana.com/"
edition = "2018"
[features] [features]
cuda = [] cuda = []

View File

@ -1,9 +1,4 @@
#[macro_use] use clap::{crate_version, App, Arg};
extern crate clap;
extern crate dirs;
extern crate solana_sdk;
use clap::{App, Arg};
use solana_sdk::signature::gen_keypair_file; use solana_sdk::signature::gen_keypair_file;
use std::error; use std::error;

View File

@ -1,11 +1,6 @@
#[macro_use] use clap::{crate_version, App, Arg, SubCommand};
extern crate clap;
use serde_json;
use clap::{App, Arg, SubCommand};
use solana::bank::Bank; use solana::bank::Bank;
use solana::ledger::{read_ledger, verify_ledger}; use solana::ledger::{read_ledger, verify_ledger};
use std::io::{stdout, Write}; use std::io::{stdout, Write};
use std::process::exit; use std::process::exit;

View File

@ -6,6 +6,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana" repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0" license = "Apache-2.0"
homepage = "https://solana.com/" homepage = "https://solana.com/"
edition = "2018"
[dependencies] [dependencies]
influx_db_client = "0.3.6" influx_db_client = "0.3.6"

View File

@ -1,16 +1,7 @@
pub extern crate influx_db_client;
#[macro_use]
extern crate lazy_static;
extern crate reqwest;
#[macro_use]
extern crate log;
extern crate solana_sdk;
extern crate sys_info;
mod metrics; mod metrics;
pub use metrics::flush;
pub use metrics::query;
pub use metrics::set_panic_hook;
pub use metrics::submit;
pub use crate::metrics::flush;
pub use crate::metrics::query;
pub use crate::metrics::set_panic_hook;
pub use crate::metrics::submit;
pub use influx_db_client as influxdb; pub use influx_db_client as influxdb;

View File

@ -1,8 +1,8 @@
//! The `metrics` module enables sending measurements to an InfluxDB instance //! The `metrics` module enables sending measurements to an InfluxDB instance
extern crate reqwest;
use influx_db_client as influxdb; use influx_db_client as influxdb;
use lazy_static::lazy_static;
use log::*;
use solana_sdk::hash::hash; use solana_sdk::hash::hash;
use solana_sdk::timing; use solana_sdk::timing;
use std::env; use std::env;
@ -267,8 +267,6 @@ pub fn set_panic_hook(program: &'static str) {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
extern crate rand;
use super::*; use super::*;
use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::atomic::{AtomicUsize, Ordering};

View File

@ -6,6 +6,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana" repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0" license = "Apache-2.0"
homepage = "https://solana.com/" homepage = "https://solana.com/"
edition = "2018"
[features] [features]
bpf_c = [] bpf_c = []

View File

@ -1,20 +1,14 @@
pub mod bpf_verifier; pub mod bpf_verifier;
extern crate byteorder;
#[macro_use]
extern crate log;
extern crate libc;
extern crate solana_rbpf;
#[macro_use]
extern crate solana_sdk;
use byteorder::{ByteOrder, LittleEndian, WriteBytesExt}; use byteorder::{ByteOrder, LittleEndian, WriteBytesExt};
use libc::c_char; use libc::c_char;
use log::*;
use solana_rbpf::EbpfVmRaw; use solana_rbpf::EbpfVmRaw;
use solana_sdk::account::KeyedAccount; use solana_sdk::account::KeyedAccount;
use solana_sdk::loader_instruction::LoaderInstruction; use solana_sdk::loader_instruction::LoaderInstruction;
use solana_sdk::native_program::ProgramError; use solana_sdk::native_program::ProgramError;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use solana_sdk::solana_entrypoint;
use std::ffi::CStr; use std::ffi::CStr;
use std::io::prelude::*; use std::io::prelude::*;
use std::io::{Error, ErrorKind}; use std::io::{Error, ErrorKind};

View File

@ -6,6 +6,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana" repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0" license = "Apache-2.0"
homepage = "https://solana.com/" homepage = "https://solana.com/"
edition = "2018"
[dependencies] [dependencies]
bincode = "1.0.0" bincode = "1.0.0"

View File

@ -1,6 +1,8 @@
//! budget program //! budget program
use bincode::{self, deserialize, serialize_into, serialized_size}; use bincode::{self, deserialize, serialize_into, serialized_size};
use chrono::prelude::{DateTime, Utc}; use chrono::prelude::{DateTime, Utc};
use log::*;
use serde_derive::{Deserialize, Serialize};
use solana_sdk::account::KeyedAccount; use solana_sdk::account::KeyedAccount;
use solana_sdk::budget_expr::BudgetExpr; use solana_sdk::budget_expr::BudgetExpr;
use solana_sdk::budget_instruction::Instruction; use solana_sdk::budget_instruction::Instruction;

View File

@ -1,19 +1,11 @@
extern crate bincode;
extern crate chrono;
#[macro_use]
extern crate log;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate solana_sdk;
mod budget_program; mod budget_program;
use crate::budget_program::process_instruction;
use log::*;
use solana_sdk::account::KeyedAccount; use solana_sdk::account::KeyedAccount;
use solana_sdk::native_program::ProgramError; use solana_sdk::native_program::ProgramError;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use solana_sdk::solana_entrypoint;
use budget_program::process_instruction;
solana_entrypoint!(entrypoint); solana_entrypoint!(entrypoint);
fn entrypoint( fn entrypoint(

View File

@ -6,6 +6,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana" repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0" license = "Apache-2.0"
homepage = "https://solana.com/" homepage = "https://solana.com/"
edition = "2018"
[dependencies] [dependencies]
bincode = "1.0.0" bincode = "1.0.0"

View File

@ -1,17 +1,10 @@
//! The `erc20` library implements a generic erc20-like token //! The `erc20` library implements a generic erc20-like token
extern crate bincode; use log::*;
#[macro_use]
extern crate log;
extern crate serde;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate solana_sdk;
use solana_sdk::account::KeyedAccount; use solana_sdk::account::KeyedAccount;
use solana_sdk::native_program::ProgramError; use solana_sdk::native_program::ProgramError;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use solana_sdk::solana_entrypoint;
mod token_program; mod token_program;

View File

@ -1,7 +1,8 @@
//! ERC20-like Token //! ERC20-like Token
use bincode; use bincode;
use log::*;
use serde_derive::{Deserialize, Serialize};
use solana_sdk::account::KeyedAccount; use solana_sdk::account::KeyedAccount;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use std; use std;

View File

@ -6,6 +6,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana" repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0" license = "Apache-2.0"
homepage = "https://solana.com/" homepage = "https://solana.com/"
edition = "2018"
[dependencies] [dependencies]
bincode = "1.0.0" bincode = "1.0.0"

View File

@ -1,14 +1,10 @@
#[macro_use] use log::*;
extern crate log;
extern crate rlua;
#[macro_use]
extern crate solana_sdk;
use rlua::{Lua, Table}; use rlua::{Lua, Table};
use solana_sdk::account::KeyedAccount; use solana_sdk::account::KeyedAccount;
use solana_sdk::loader_instruction::LoaderInstruction; use solana_sdk::loader_instruction::LoaderInstruction;
use solana_sdk::native_program::ProgramError; use solana_sdk::native_program::ProgramError;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use solana_sdk::solana_entrypoint;
use std::str; use std::str;
/// Make KeyAccount values available to Lua. /// Make KeyAccount values available to Lua.
@ -116,10 +112,8 @@ fn entrypoint(
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
extern crate bincode;
use self::bincode::serialize;
use super::*; use super::*;
use bincode::serialize;
use solana_sdk::account::{create_keyed_accounts, Account}; use solana_sdk::account::{create_keyed_accounts, Account};
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use std::fs::File; use std::fs::File;

View File

@ -6,6 +6,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana" repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0" license = "Apache-2.0"
homepage = "https://solana.com/" homepage = "https://solana.com/"
edition = "2018"
[dependencies] [dependencies]
bincode = "1.0.0" bincode = "1.0.0"

View File

@ -1,16 +1,10 @@
//! Native loader //! Native loader
extern crate bincode;
extern crate libc;
extern crate libloading;
#[macro_use]
extern crate log;
extern crate solana_sdk;
use bincode::deserialize; use bincode::deserialize;
#[cfg(unix)] #[cfg(unix)]
use libloading::os::unix::*; use libloading::os::unix::*;
#[cfg(windows)] #[cfg(windows)]
use libloading::os::windows::*; use libloading::os::windows::*;
use log::*;
use solana_sdk::account::KeyedAccount; use solana_sdk::account::KeyedAccount;
use solana_sdk::loader_instruction::LoaderInstruction; use solana_sdk::loader_instruction::LoaderInstruction;
pub use solana_sdk::native_loader::*; pub use solana_sdk::native_loader::*;

View File

@ -6,6 +6,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana" repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0" license = "Apache-2.0"
homepage = "https://solana.com/" homepage = "https://solana.com/"
edition = "2018"
[dependencies] [dependencies]
solana-sdk = { path = "../../../sdk", version = "0.11.0" } solana-sdk = { path = "../../../sdk", version = "0.11.0" }

View File

@ -1,9 +1,7 @@
#[macro_use]
extern crate solana_sdk;
use solana_sdk::account::KeyedAccount; use solana_sdk::account::KeyedAccount;
use solana_sdk::native_program::ProgramError; use solana_sdk::native_program::ProgramError;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use solana_sdk::solana_entrypoint;
solana_entrypoint!(entrypoint); solana_entrypoint!(entrypoint);
fn entrypoint( fn entrypoint(

View File

@ -6,6 +6,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana" repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0" license = "Apache-2.0"
homepage = "https://solana.com/" homepage = "https://solana.com/"
edition = "2018"
[dependencies] [dependencies]
bincode = "1.0.0" bincode = "1.0.0"

View File

@ -2,14 +2,11 @@
//! 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.
#[macro_use] use log::*;
extern crate log;
#[macro_use]
extern crate solana_sdk;
use solana_sdk::account::KeyedAccount; use solana_sdk::account::KeyedAccount;
use solana_sdk::native_program::ProgramError; use solana_sdk::native_program::ProgramError;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use solana_sdk::solana_entrypoint;
use solana_sdk::storage_program::*; use solana_sdk::storage_program::*;
solana_entrypoint!(entrypoint); solana_entrypoint!(entrypoint);

View File

@ -6,6 +6,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana" repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0" license = "Apache-2.0"
homepage = "https://solana.com/" homepage = "https://solana.com/"
edition = "2018"
[dependencies] [dependencies]
bincode = "1.0.0" bincode = "1.0.0"

View File

@ -1,11 +1,8 @@
#[macro_use] use log::*;
extern crate log;
#[macro_use]
extern crate solana_sdk;
use solana_sdk::account::KeyedAccount; use solana_sdk::account::KeyedAccount;
use solana_sdk::native_program::ProgramError; use solana_sdk::native_program::ProgramError;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use solana_sdk::solana_entrypoint;
use solana_sdk::system_instruction::SystemInstruction; use solana_sdk::system_instruction::SystemInstruction;
use solana_sdk::system_program; use solana_sdk::system_program;

View File

@ -6,6 +6,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana" repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0" license = "Apache-2.0"
homepage = "https://solana.com/" homepage = "https://solana.com/"
edition = "2018"
[dependencies] [dependencies]
bincode = "1.0.0" bincode = "1.0.0"

View File

@ -1,14 +1,11 @@
//! Vote program //! Vote program
//! Receive and processes votes from validators //! Receive and processes votes from validators
#[macro_use] use log::*;
extern crate log;
#[macro_use]
extern crate solana_sdk;
use solana_sdk::account::KeyedAccount; use solana_sdk::account::KeyedAccount;
use solana_sdk::native_program::ProgramError; use solana_sdk::native_program::ProgramError;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use solana_sdk::solana_entrypoint;
use solana_sdk::vote_program::*; use solana_sdk::vote_program::*;
use std::collections::VecDeque; use std::collections::VecDeque;
@ -39,7 +36,7 @@ fn entrypoint(
// TODO: a single validator could register multiple "vote accounts" // TODO: a single validator could register multiple "vote accounts"
// which would clutter the "accounts" structure. See github issue 1654. // which would clutter the "accounts" structure. See github issue 1654.
let mut vote_state = VoteProgram { let vote_state = VoteProgram {
votes: VecDeque::new(), votes: VecDeque::new(),
node_id: *keyed_accounts[0].signer_key().unwrap(), node_id: *keyed_accounts[0].signer_key().unwrap(),
}; };

View File

@ -6,6 +6,7 @@ authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana" repository = "https://github.com/solana-labs/solana"
homepage = "https://solana.com/" homepage = "https://solana.com/"
license = "Apache-2.0" license = "Apache-2.0"
edition = "2018"
[dependencies] [dependencies]
bincode = "1.0.0" bincode = "1.0.0"

View File

@ -1,4 +1,4 @@
use pubkey::Pubkey; use crate::pubkey::Pubkey;
/// An Account with userdata that is stored on chain /// An Account with userdata that is stored on chain
#[repr(C)] #[repr(C)]

View File

@ -1,4 +1,4 @@
use pubkey::Pubkey; use crate::pubkey::Pubkey;
pub const BPF_LOADER_PROGRAM_ID: [u8; 32] = [ pub const BPF_LOADER_PROGRAM_ID: [u8; 32] = [
128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

View File

@ -3,9 +3,9 @@
//! which it uses to reduce the payment plan. When the budget is reduced to a //! which it uses to reduce the payment plan. When the budget is reduced to a
//! `Payment`, the payment is executed. //! `Payment`, the payment is executed.
use crate::payment_plan::{Payment, Witness};
use crate::pubkey::Pubkey;
use chrono::prelude::*; use chrono::prelude::*;
use payment_plan::{Payment, Witness};
use 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.
@ -141,7 +141,7 @@ impl BudgetExpr {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use signature::{Keypair, KeypairUtil}; use crate::signature::{Keypair, KeypairUtil};
#[test] #[test]
fn test_signature_satisfied() { fn test_signature_satisfied() {

View File

@ -1,4 +1,4 @@
use budget_expr::BudgetExpr; use crate::budget_expr::BudgetExpr;
use chrono::prelude::{DateTime, Utc}; use chrono::prelude::{DateTime, Utc};
/// A smart contract. /// A smart contract.

View File

@ -1,4 +1,4 @@
use pubkey::Pubkey; use crate::pubkey::Pubkey;
pub const BUDGET_PROGRAM_ID: [u8; 32] = [ pub const BUDGET_PROGRAM_ID: [u8; 32] = [
129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

View File

@ -1,17 +1,17 @@
//! The `budget_transaction` module provides functionality for creating Budget transactions. //! The `budget_transaction` module provides functionality for creating Budget transactions.
use crate::budget_expr::{BudgetExpr, Condition};
use crate::budget_instruction::Instruction;
use crate::budget_program;
use crate::hash::Hash;
use crate::payment_plan::Payment;
use crate::pubkey::Pubkey;
use crate::signature::{Keypair, KeypairUtil};
use crate::system_instruction::SystemInstruction;
use crate::system_program;
use crate::transaction::{self, Transaction};
use bincode::deserialize; use bincode::deserialize;
use budget_expr::{BudgetExpr, Condition};
use budget_instruction::Instruction;
use budget_program;
use chrono::prelude::*; use chrono::prelude::*;
use hash::Hash;
use payment_plan::Payment;
use pubkey::Pubkey;
use signature::{Keypair, KeypairUtil};
use system_instruction::SystemInstruction;
use system_program;
use transaction::{self, Transaction};
pub trait BudgetTransaction { pub trait BudgetTransaction {
fn budget_new_taxed( fn budget_new_taxed(

View File

@ -23,16 +23,5 @@ pub mod transaction;
pub mod vote_program; pub mod vote_program;
pub mod vote_transaction; pub mod vote_transaction;
extern crate bincode;
extern crate bs58;
extern crate byteorder;
extern crate chrono;
extern crate generic_array;
extern crate log;
extern crate ring;
extern crate serde;
#[macro_use] #[macro_use]
extern crate serde_derive; extern crate serde_derive;
extern crate serde_json;
extern crate sha2;
extern crate untrusted;

View File

@ -1,10 +1,10 @@
//! The `loader_transaction` module provides functionality for loading and calling a program //! The `loader_transaction` module provides functionality for loading and calling a program
use hash::Hash; use crate::hash::Hash;
use loader_instruction::LoaderInstruction; use crate::loader_instruction::LoaderInstruction;
use pubkey::Pubkey; use crate::pubkey::Pubkey;
use signature::Keypair; use crate::signature::Keypair;
use transaction::Transaction; use crate::transaction::Transaction;
pub trait LoaderTransaction { pub trait LoaderTransaction {
fn loader_write( fn loader_write(

View File

@ -1,4 +1,4 @@
use pubkey::Pubkey; use crate::pubkey::Pubkey;
pub const NATIVE_LOADER_PROGRAM_ID: [u8; 32] = [ pub const NATIVE_LOADER_PROGRAM_ID: [u8; 32] = [
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

View File

@ -1,5 +1,5 @@
use account::KeyedAccount; use crate::account::KeyedAccount;
use pubkey::Pubkey; use crate::pubkey::Pubkey;
use std; use std;
/// Reasons a program might have rejected an instruction. /// Reasons a program might have rejected an instruction.

View File

@ -3,8 +3,8 @@
//! which it uses to reduce the payment plan. When the plan is reduced to a //! which it uses to reduce the payment plan. When the plan is reduced to a
//! `Payment`, the payment is executed. //! `Payment`, the payment is executed.
use crate::pubkey::Pubkey;
use chrono::prelude::*; use chrono::prelude::*;
use 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)]

View File

@ -1,9 +1,9 @@
//! The `signature` module provides functionality for public, and private keys. //! The `signature` module provides functionality for public, and private keys.
use crate::pubkey::Pubkey;
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 ring::signature::Ed25519KeyPair; use ring::signature::Ed25519KeyPair;
use ring::{rand, signature}; use ring::{rand, signature};
use serde_json; use serde_json;

View File

@ -1,7 +1,7 @@
use hash::Hash; use crate::hash::Hash;
use pubkey::Pubkey; use crate::pubkey::Pubkey;
use signature::{Keypair, KeypairUtil}; use crate::signature::{Keypair, KeypairUtil};
use transaction::Transaction; use crate::transaction::Transaction;
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
pub enum StorageProgram { pub enum StorageProgram {

View File

@ -1,4 +1,4 @@
use pubkey::Pubkey; use crate::pubkey::Pubkey;
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
pub enum SystemInstruction { pub enum SystemInstruction {

View File

@ -1,4 +1,4 @@
use pubkey::Pubkey; use crate::pubkey::Pubkey;
pub const SYSTEM_PROGRAM_ID: [u8; 32] = [0u8; 32]; pub const SYSTEM_PROGRAM_ID: [u8; 32] = [0u8; 32];

View File

@ -1,11 +1,11 @@
//! The `system_transaction` module provides functionality for creating system transactions. //! The `system_transaction` module provides functionality for creating system transactions.
use hash::Hash; use crate::hash::Hash;
use pubkey::Pubkey; use crate::pubkey::Pubkey;
use signature::Keypair; use crate::signature::Keypair;
use system_instruction::SystemInstruction; use crate::system_instruction::SystemInstruction;
use system_program; use crate::system_program;
use transaction::{Instruction, Transaction}; use crate::transaction::{Instruction, Transaction};
pub trait SystemTransaction { pub trait SystemTransaction {
fn system_create( fn system_create(
@ -137,7 +137,7 @@ impl SystemTransaction for Transaction {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use signature::KeypairUtil; use crate::signature::KeypairUtil;
#[test] #[test]
fn test_move_many() { fn test_move_many() {

View File

@ -1,5 +1,5 @@
//! An ERC20-like Token //! An ERC20-like Token
use pubkey::Pubkey; use crate::pubkey::Pubkey;
const TOKEN_PROGRAM_ID: [u8; 32] = [ const TOKEN_PROGRAM_ID: [u8; 32] = [
131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

View File

@ -1,10 +1,10 @@
//! The `transaction` module provides functionality for creating log transactions. //! The `transaction` module provides functionality for creating log transactions.
use crate::hash::{Hash, Hasher};
use crate::pubkey::Pubkey;
use crate::signature::{Keypair, KeypairUtil, Signature};
use bincode::serialize; use bincode::serialize;
use hash::{Hash, Hasher};
use pubkey::Pubkey;
use serde::Serialize; use serde::Serialize;
use signature::{Keypair, KeypairUtil, Signature};
use std::mem::size_of; use std::mem::size_of;
pub const SIG_OFFSET: usize = size_of::<u64>(); pub const SIG_OFFSET: usize = size_of::<u64>();

View File

@ -1,10 +1,10 @@
//! Vote program //! Vote program
//! Receive and processes votes from validators //! Receive and processes votes from validators
use crate::native_program::ProgramError;
use crate::pubkey::Pubkey;
use bincode::{deserialize, serialize}; use bincode::{deserialize, serialize};
use byteorder::{ByteOrder, LittleEndian}; use byteorder::{ByteOrder, LittleEndian};
use native_program::ProgramError;
use pubkey::Pubkey;
use std::collections::VecDeque; use std::collections::VecDeque;
use std::mem; use std::mem;

View File

@ -1,13 +1,13 @@
//! The `vote_transaction` module provides functionality for creating vote transactions. //! The `vote_transaction` module provides functionality for creating vote transactions.
use crate::hash::Hash;
use crate::pubkey::Pubkey;
use crate::signature::Keypair;
use crate::system_instruction::SystemInstruction;
use crate::system_program;
use crate::transaction::{Instruction, Transaction};
use crate::vote_program::{self, Vote, VoteInstruction};
use bincode::deserialize; use bincode::deserialize;
use hash::Hash;
use pubkey::Pubkey;
use signature::Keypair;
use system_instruction::SystemInstruction;
use system_program;
use transaction::{Instruction, Transaction};
use vote_program::{self, Vote, VoteInstruction};
pub trait VoteTransaction { pub trait VoteTransaction {
fn vote_new(vote_account: &Keypair, vote: Vote, last_id: Hash, fee: u64) -> Self; fn vote_new(vote_account: &Keypair, vote: Vote, last_id: Hash, fee: u64) -> Self;

View File

@ -76,7 +76,6 @@ pub mod window_service;
#[cfg(any(feature = "chacha", feature = "cuda"))] #[cfg(any(feature = "chacha", feature = "cuda"))]
#[macro_use] #[macro_use]
extern crate hex_literal; extern crate hex_literal;
extern crate hashbrown;
#[macro_use] #[macro_use]
extern crate log; extern crate log;

View File

@ -1,8 +1,6 @@
use serde_json; use serde_json;
use solana_metrics;
use serde_json::Value; use serde_json::Value;
use solana_metrics;
use solana_metrics::influxdb; use solana_metrics::influxdb;
use std::collections::HashMap; use std::collections::HashMap;
use std::env; use std::env;

View File

@ -1,16 +1,8 @@
#[macro_use]
extern crate clap;
use dirs;
#[macro_use]
extern crate solana;
#[macro_use]
extern crate serde_json;
mod wallet; mod wallet;
use crate::wallet::{parse_command, process_command, WalletConfig, WalletError}; use crate::wallet::{parse_command, process_command, WalletConfig, WalletError};
use clap::{App, Arg, ArgMatches, SubCommand}; use clap::{crate_version, App, Arg, ArgMatches, SubCommand};
use solana::socketaddr;
use solana_sdk::signature::{gen_keypair_file, read_keypair, KeypairUtil}; use solana_sdk::signature::{gen_keypair_file, read_keypair, KeypairUtil};
use std::error; use std::error;
use std::net::SocketAddr; use std::net::SocketAddr;

View File

@ -3,8 +3,10 @@ use bs58;
use chrono::prelude::*; use chrono::prelude::*;
use clap::ArgMatches; use clap::ArgMatches;
use serde_json; use serde_json;
use serde_json::json;
use solana::rpc::RpcSignatureStatus; use solana::rpc::RpcSignatureStatus;
use solana::rpc_request::{get_rpc_request_str, RpcClient, RpcRequest}; use solana::rpc_request::{get_rpc_request_str, RpcClient, RpcRequest};
use solana::socketaddr;
use solana::thin_client::poll_gossip_for_leader; use solana::thin_client::poll_gossip_for_leader;
use solana_drone::drone::{request_airdrop_transaction, DRONE_PORT}; use solana_drone::drone::{request_airdrop_transaction, DRONE_PORT};
use solana_sdk::bpf_loader; use solana_sdk::bpf_loader;