Clean up `use` to keep rust 1.43.0 from complaining (#9740)
This commit is contained in:
parent
2f705b5b55
commit
c11abf88b7
|
@ -1,4 +1,3 @@
|
||||||
use serde_json;
|
|
||||||
use solana_client::client_error;
|
use solana_client::client_error;
|
||||||
use solana_ledger::blockstore;
|
use solana_ledger::blockstore;
|
||||||
use solana_sdk::transport;
|
use solana_sdk::transport;
|
||||||
|
|
|
@ -14,7 +14,6 @@ use crate::crds::Crds;
|
||||||
use crate::crds_gossip::{get_stake, get_weight, CRDS_GOSSIP_DEFAULT_BLOOM_ITEMS};
|
use crate::crds_gossip::{get_stake, get_weight, CRDS_GOSSIP_DEFAULT_BLOOM_ITEMS};
|
||||||
use crate::crds_gossip_error::CrdsGossipError;
|
use crate::crds_gossip_error::CrdsGossipError;
|
||||||
use crate::crds_value::{CrdsValue, CrdsValueLabel};
|
use crate::crds_value::{CrdsValue, CrdsValueLabel};
|
||||||
use rand;
|
|
||||||
use rand::distributions::{Distribution, WeightedIndex};
|
use rand::distributions::{Distribution, WeightedIndex};
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
use solana_runtime::bloom::Bloom;
|
use solana_runtime::bloom::Bloom;
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
//! The `poh_service` module implements a service that records the passing of
|
//! The `poh_service` module implements a service that records the passing of
|
||||||
//! "ticks", a measure of time in the PoH stream
|
//! "ticks", a measure of time in the PoH stream
|
||||||
use crate::poh_recorder::PohRecorder;
|
use crate::poh_recorder::PohRecorder;
|
||||||
use core_affinity;
|
|
||||||
use solana_sdk::clock::DEFAULT_TICKS_PER_SLOT;
|
use solana_sdk::clock::DEFAULT_TICKS_PER_SLOT;
|
||||||
use solana_sdk::poh_config::PohConfig;
|
use solana_sdk::poh_config::PohConfig;
|
||||||
use solana_sys_tuner;
|
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::thread::{self, sleep, Builder, JoinHandle};
|
use std::thread::{self, sleep, Builder, JoinHandle};
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use atty;
|
|
||||||
use std::process::exit;
|
use std::process::exit;
|
||||||
|
|
||||||
fn press_enter() {
|
fn press_enter() {
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
use bip39::{Language, Mnemonic, MnemonicType, Seed};
|
use bip39::{Language, Mnemonic, MnemonicType, Seed};
|
||||||
use bs58;
|
|
||||||
use clap::{
|
use clap::{
|
||||||
crate_description, crate_name, value_t, values_t_or_exit, App, AppSettings, Arg, ArgMatches,
|
crate_description, crate_name, value_t, values_t_or_exit, App, AppSettings, Arg, ArgMatches,
|
||||||
SubCommand,
|
SubCommand,
|
||||||
};
|
};
|
||||||
use num_cpus;
|
|
||||||
use solana_clap_utils::{
|
use solana_clap_utils::{
|
||||||
keypair::{
|
keypair::{
|
||||||
keypair_from_seed_phrase, prompt_passphrase, signer_from_path,
|
keypair_from_seed_phrase, prompt_passphrase, signer_from_path,
|
||||||
|
|
|
@ -2,7 +2,6 @@ use clap::{
|
||||||
crate_description, crate_name, value_t, value_t_or_exit, values_t_or_exit, App, Arg,
|
crate_description, crate_name, value_t, value_t_or_exit, values_t_or_exit, App, Arg,
|
||||||
ArgMatches, SubCommand,
|
ArgMatches, SubCommand,
|
||||||
};
|
};
|
||||||
use histogram;
|
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use solana_clap_utils::input_validators::is_slot;
|
use solana_clap_utils::input_validators::is_slot;
|
||||||
use solana_ledger::bank_forks::CompressionType;
|
use solana_ledger::bank_forks::CompressionType;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use crate::blockstore_meta;
|
use crate::blockstore_meta;
|
||||||
use bincode::{deserialize, serialize};
|
use bincode::{deserialize, serialize};
|
||||||
use byteorder::{BigEndian, ByteOrder};
|
use byteorder::{BigEndian, ByteOrder};
|
||||||
use fs_extra;
|
|
||||||
use log::*;
|
use log::*;
|
||||||
pub use rocksdb::Direction as IteratorDirection;
|
pub use rocksdb::Direction as IteratorDirection;
|
||||||
use rocksdb::{
|
use rocksdb::{
|
||||||
|
|
|
@ -26,7 +26,6 @@ use std::{
|
||||||
use tar::Archive;
|
use tar::Archive;
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
use zstd;
|
|
||||||
|
|
||||||
pub const SNAPSHOT_STATUS_CACHE_FILE_NAME: &str = "status_cache";
|
pub const SNAPSHOT_STATUS_CACHE_FILE_NAME: &str = "status_cache";
|
||||||
pub const TAR_SNAPSHOTS_DIR: &str = "snapshots";
|
pub const TAR_SNAPSHOTS_DIR: &str = "snapshots";
|
||||||
|
|
|
@ -1,14 +1,8 @@
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use log::*;
|
use log::*;
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
use std::io;
|
use std::{io, net::SocketAddr, time::Duration};
|
||||||
use std::net::SocketAddr;
|
use tokio::{net::TcpListener, prelude::*, reactor::Handle, runtime::Runtime};
|
||||||
use std::time::Duration;
|
|
||||||
use tokio;
|
|
||||||
use tokio::net::TcpListener;
|
|
||||||
use tokio::prelude::*;
|
|
||||||
use tokio::reactor::Handle;
|
|
||||||
use tokio::runtime::Runtime;
|
|
||||||
use tokio_codec::{BytesCodec, Decoder};
|
use tokio_codec::{BytesCodec, Decoder};
|
||||||
|
|
||||||
pub type IpEchoServer = Runtime;
|
pub type IpEchoServer = Runtime;
|
||||||
|
|
|
@ -4,7 +4,6 @@ use crate::spv_instruction::*;
|
||||||
use crate::spv_state::*;
|
use crate::spv_state::*;
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
use crate::utils::*;
|
use crate::utils::*;
|
||||||
use hex;
|
|
||||||
use log::*;
|
use log::*;
|
||||||
use solana_sdk::account::KeyedAccount;
|
use solana_sdk::account::KeyedAccount;
|
||||||
use solana_sdk::instruction::InstructionError;
|
use solana_sdk::instruction::InstructionError;
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
use clap;
|
|
||||||
use clap::{App, Arg};
|
use clap::{App, Arg};
|
||||||
use hex;
|
|
||||||
use reqwest;
|
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
use clap;
|
|
||||||
use clap::{App, Arg};
|
use clap::{App, Arg};
|
||||||
use reqwest;
|
|
||||||
use serde_derive::Deserialize;
|
use serde_derive::Deserialize;
|
||||||
|
|
||||||
// pub type blockHash = [u8; 32];
|
// pub type blockHash = [u8; 32];
|
||||||
|
|
|
@ -11,33 +11,33 @@ pub trait Signers {
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! default_keypairs_impl {
|
macro_rules! default_keypairs_impl {
|
||||||
() => (
|
() => {
|
||||||
fn pubkeys(&self) -> Vec<Pubkey> {
|
fn pubkeys(&self) -> Vec<Pubkey> {
|
||||||
self.iter().map(|keypair| keypair.pubkey()).collect()
|
self.iter().map(|keypair| keypair.pubkey()).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn try_pubkeys(&self) -> Result<Vec<Pubkey>, SignerError> {
|
fn try_pubkeys(&self) -> Result<Vec<Pubkey>, SignerError> {
|
||||||
let mut pubkeys = Vec::new();
|
let mut pubkeys = Vec::new();
|
||||||
for keypair in self.iter() {
|
for keypair in self.iter() {
|
||||||
pubkeys.push(keypair.try_pubkey()?);
|
pubkeys.push(keypair.try_pubkey()?);
|
||||||
}
|
|
||||||
Ok(pubkeys)
|
|
||||||
}
|
}
|
||||||
|
Ok(pubkeys)
|
||||||
|
}
|
||||||
|
|
||||||
fn sign_message(&self, message: &[u8]) -> Vec<Signature> {
|
fn sign_message(&self, message: &[u8]) -> Vec<Signature> {
|
||||||
self.iter()
|
self.iter()
|
||||||
.map(|keypair| keypair.sign_message(message))
|
.map(|keypair| keypair.sign_message(message))
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn try_sign_message(&self, message: &[u8]) -> Result<Vec<Signature>, SignerError> {
|
fn try_sign_message(&self, message: &[u8]) -> Result<Vec<Signature>, SignerError> {
|
||||||
let mut signatures = Vec::new();
|
let mut signatures = Vec::new();
|
||||||
for keypair in self.iter() {
|
for keypair in self.iter() {
|
||||||
signatures.push(keypair.try_sign_message(message)?);
|
signatures.push(keypair.try_sign_message(message)?);
|
||||||
}
|
|
||||||
Ok(signatures)
|
|
||||||
}
|
}
|
||||||
);
|
Ok(signatures)
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: Signer> Signers for [&T] {
|
impl<T: Signer> Signers for [&T] {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
|
||||||
use bincode;
|
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
clock::Slot,
|
clock::Slot,
|
||||||
commitment_config::CommitmentConfig,
|
commitment_config::CommitmentConfig,
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use serde_json;
|
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
Loading…
Reference in New Issue