cargo +nightly fix --features=bpf_c,cuda,erasure,chacha --edition-idioms
This commit is contained in:
parent
1c2394227e
commit
a8d6c75a24
|
@ -1,8 +1,8 @@
|
|||
#![feature(test)]
|
||||
extern crate bincode;
|
||||
extern crate rayon;
|
||||
extern crate solana;
|
||||
extern crate solana_sdk;
|
||||
|
||||
|
||||
|
||||
|
||||
extern crate test;
|
||||
|
||||
use solana::bank::*;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#![feature(test)]
|
||||
extern crate bincode;
|
||||
extern crate rand;
|
||||
extern crate rayon;
|
||||
extern crate solana;
|
||||
extern crate solana_sdk;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern crate test;
|
||||
|
||||
use rand::{thread_rng, Rng};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#![feature(test)]
|
||||
extern crate rand;
|
||||
extern crate rocksdb;
|
||||
extern crate solana;
|
||||
use rand;
|
||||
|
||||
|
||||
extern crate test;
|
||||
|
||||
use rand::seq::SliceRandom;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#![feature(test)]
|
||||
extern crate solana;
|
||||
extern crate solana_sdk;
|
||||
|
||||
|
||||
extern crate test;
|
||||
|
||||
use solana::entry::reconstruct_entries_from_blobs;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#![feature(test)]
|
||||
extern crate solana;
|
||||
extern crate solana_sdk;
|
||||
|
||||
|
||||
extern crate test;
|
||||
|
||||
use solana::signature::GenKeys;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#![feature(test)]
|
||||
extern crate bincode;
|
||||
extern crate rayon;
|
||||
extern crate solana;
|
||||
|
||||
|
||||
|
||||
extern crate test;
|
||||
|
||||
use solana::packet::to_packets;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
extern crate clap;
|
||||
extern crate solana;
|
||||
|
||||
|
||||
|
||||
use clap::{App, Arg};
|
||||
use solana::netutil::bind_to;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#[macro_use]
|
||||
extern crate clap;
|
||||
extern crate rayon;
|
||||
|
||||
#[macro_use]
|
||||
extern crate solana;
|
||||
extern crate solana_drone;
|
||||
extern crate solana_metrics;
|
||||
extern crate solana_sdk;
|
||||
|
||||
use solana_metrics;
|
||||
|
||||
|
||||
use clap::{App, Arg};
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#[macro_use]
|
||||
extern crate clap;
|
||||
extern crate dirs;
|
||||
extern crate ring;
|
||||
extern crate serde_json;
|
||||
extern crate solana;
|
||||
extern crate solana_sdk;
|
||||
use dirs;
|
||||
|
||||
use serde_json;
|
||||
|
||||
|
||||
|
||||
use clap::{App, Arg};
|
||||
use ring::rand::SystemRandom;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#[macro_use]
|
||||
extern crate clap;
|
||||
extern crate getopts;
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
extern crate serde_json;
|
||||
use serde_json;
|
||||
#[macro_use]
|
||||
extern crate solana;
|
||||
extern crate solana_metrics;
|
||||
extern crate solana_sdk;
|
||||
use solana_metrics;
|
||||
|
||||
|
||||
use clap::{App, Arg};
|
||||
use solana::client::mk_client;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
//! A command-line executable for generating the chain's genesis block.
|
||||
|
||||
extern crate atty;
|
||||
|
||||
#[macro_use]
|
||||
extern crate clap;
|
||||
extern crate serde_json;
|
||||
extern crate solana;
|
||||
extern crate solana_sdk;
|
||||
extern crate untrusted;
|
||||
use serde_json;
|
||||
|
||||
|
||||
|
||||
|
||||
use clap::{App, Arg};
|
||||
use solana::ledger::LedgerWriter;
|
||||
|
@ -23,7 +23,7 @@ use std::path::Path;
|
|||
*/
|
||||
pub const BOOTSTRAP_LEADER_TOKENS: u64 = 2;
|
||||
|
||||
fn main() -> Result<(), Box<error::Error>> {
|
||||
fn main() -> Result<(), Box<dyn error::Error>> {
|
||||
let matches = App::new("solana-genesis")
|
||||
.version(crate_version!())
|
||||
.arg(
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#[macro_use]
|
||||
extern crate clap;
|
||||
extern crate dirs;
|
||||
extern crate ring;
|
||||
extern crate serde_json;
|
||||
extern crate solana;
|
||||
use dirs;
|
||||
|
||||
|
||||
|
||||
|
||||
use clap::{App, Arg};
|
||||
use solana::wallet::gen_keypair_file;
|
||||
use std::error;
|
||||
|
||||
fn main() -> Result<(), Box<error::Error>> {
|
||||
fn main() -> Result<(), Box<dyn error::Error>> {
|
||||
let matches = App::new("solana-keygen")
|
||||
.version(crate_version!())
|
||||
.arg(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#[macro_use]
|
||||
extern crate clap;
|
||||
extern crate serde_json;
|
||||
extern crate solana;
|
||||
use serde_json;
|
||||
|
||||
|
||||
use clap::{App, Arg, SubCommand};
|
||||
use solana::bank::Bank;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#[macro_use]
|
||||
extern crate clap;
|
||||
extern crate getopts;
|
||||
extern crate serde_json;
|
||||
|
||||
use serde_json;
|
||||
#[macro_use]
|
||||
extern crate solana;
|
||||
extern crate solana_drone;
|
||||
extern crate solana_sdk;
|
||||
|
||||
|
||||
|
||||
use clap::{App, Arg};
|
||||
use solana::cluster_info::{Node, NodeInfo};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
extern crate serde_json;
|
||||
extern crate solana;
|
||||
extern crate solana_metrics;
|
||||
use serde_json;
|
||||
|
||||
use solana_metrics;
|
||||
|
||||
use serde_json::Value;
|
||||
use solana_metrics::influxdb;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#[macro_use]
|
||||
extern crate clap;
|
||||
extern crate dirs;
|
||||
use dirs;
|
||||
#[macro_use]
|
||||
extern crate solana;
|
||||
extern crate solana_sdk;
|
||||
|
||||
|
||||
use clap::{App, Arg, ArgMatches, SubCommand};
|
||||
use solana::logger;
|
||||
|
@ -12,7 +12,7 @@ use solana_sdk::signature::{read_keypair, KeypairUtil};
|
|||
use std::error;
|
||||
use std::net::SocketAddr;
|
||||
|
||||
pub fn parse_args(matches: &ArgMatches) -> Result<WalletConfig, Box<error::Error>> {
|
||||
pub fn parse_args(matches: &ArgMatches<'_>) -> Result<WalletConfig, Box<dyn error::Error>> {
|
||||
let network = if let Some(addr) = matches.value_of("network") {
|
||||
addr.parse().or_else(|_| {
|
||||
Err(WalletError::BadParameter(
|
||||
|
@ -61,7 +61,7 @@ pub fn parse_args(matches: &ArgMatches) -> Result<WalletConfig, Box<error::Error
|
|||
})
|
||||
}
|
||||
|
||||
fn main() -> Result<(), Box<error::Error>> {
|
||||
fn main() -> Result<(), Box<dyn error::Error>> {
|
||||
logger::setup();
|
||||
let matches = App::new("solana-wallet")
|
||||
.version(crate_version!())
|
||||
|
|
|
@ -83,7 +83,7 @@ fn broadcast(
|
|||
let chunking_elapsed = duration_as_ms(&blobs_chunking.elapsed());
|
||||
|
||||
let broadcast_start = Instant::now();
|
||||
for mut blobs in blobs_chunked {
|
||||
for blobs in blobs_chunked {
|
||||
let blobs_len = blobs.len();
|
||||
trace!("{}: broadcast blobs.len: {}", id, blobs_len);
|
||||
|
||||
|
|
|
@ -401,7 +401,7 @@ mod test {
|
|||
let network_values: Vec<Node> = network.values().cloned().collect();
|
||||
for t in start..end {
|
||||
let now = t as u64 * 100;
|
||||
let mut requests: Vec<_> = {
|
||||
let requests: Vec<_> = {
|
||||
network_values
|
||||
.par_iter()
|
||||
.filter_map(|from| from.lock().unwrap().new_pull_request(now).ok())
|
||||
|
|
|
@ -189,7 +189,7 @@ impl CrdsGossipPush {
|
|||
}
|
||||
}
|
||||
let size = cmp::max(CRDS_GOSSIP_BLOOM_SIZE, network_size);
|
||||
let mut bloom = Bloom::random(size, 0.1, 1024 * 8 * 4);
|
||||
let bloom = Bloom::random(size, 0.1, 1024 * 8 * 4);
|
||||
new_items.insert(val.0.pubkey(), bloom);
|
||||
if new_items.len() == need {
|
||||
break;
|
||||
|
|
|
@ -101,7 +101,7 @@ pub enum CrdsValueLabel {
|
|||
}
|
||||
|
||||
impl fmt::Display for CrdsValueLabel {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
CrdsValueLabel::ContactInfo(_) => write!(f, "ContactInfo({})", self.pubkey()),
|
||||
CrdsValueLabel::Vote(_) => write!(f, "Vote({})", self.pubkey()),
|
||||
|
|
|
@ -125,8 +125,8 @@ pub fn find_missing_indexes(
|
|||
slot: u64,
|
||||
start_index: u64,
|
||||
end_index: u64,
|
||||
key: &Fn(u64, u64) -> Vec<u8>,
|
||||
index_from_key: &Fn(&[u8]) -> Result<u64>,
|
||||
key: &dyn Fn(u64, u64) -> Vec<u8>,
|
||||
index_from_key: &dyn Fn(&[u8]) -> Result<u64>,
|
||||
max_missing: usize,
|
||||
) -> Vec<u64> {
|
||||
if start_index >= end_index || max_missing == 0 {
|
||||
|
@ -458,7 +458,7 @@ mod test {
|
|||
let t_responder = responder("streamer_send_test", Arc::new(send), r_responder);
|
||||
let mut msgs = Vec::new();
|
||||
for i in 0..10 {
|
||||
let mut b = SharedBlob::default();
|
||||
let b = SharedBlob::default();
|
||||
{
|
||||
let mut w = b.write().unwrap();
|
||||
w.data[0] = i as u8;
|
||||
|
|
|
@ -96,7 +96,7 @@ pub fn generate_coding_blocks(coding: &mut [&mut [u8]], data: &[&[u8]]) -> Resul
|
|||
data_arg.push(block.as_ptr());
|
||||
}
|
||||
let mut coding_arg = Vec::with_capacity(coding.len());
|
||||
for mut block in coding {
|
||||
for block in coding {
|
||||
if block_len != block.len() as i32 {
|
||||
error!(
|
||||
"coding block size incorrect {} expected {}",
|
||||
|
|
78
src/lib.rs
78
src/lib.rs
|
@ -74,59 +74,59 @@ pub mod vote_stage;
|
|||
pub mod wallet;
|
||||
pub mod window;
|
||||
pub mod window_service;
|
||||
extern crate bincode;
|
||||
extern crate bs58;
|
||||
extern crate bv;
|
||||
extern crate byteorder;
|
||||
extern crate bytes;
|
||||
extern crate chrono;
|
||||
extern crate clap;
|
||||
extern crate dirs;
|
||||
extern crate elf;
|
||||
extern crate generic_array;
|
||||
use bincode;
|
||||
use bs58;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
use elf;
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(any(feature = "chacha", feature = "cuda"))]
|
||||
#[macro_use]
|
||||
extern crate hex_literal;
|
||||
extern crate indexmap;
|
||||
extern crate ipnetwork;
|
||||
extern crate itertools;
|
||||
extern crate libc;
|
||||
|
||||
|
||||
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
extern crate nix;
|
||||
extern crate pnet_datalink;
|
||||
extern crate rayon;
|
||||
extern crate reqwest;
|
||||
extern crate ring;
|
||||
extern crate rocksdb;
|
||||
extern crate serde;
|
||||
|
||||
use pnet_datalink;
|
||||
|
||||
use reqwest;
|
||||
|
||||
use rocksdb;
|
||||
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
#[macro_use]
|
||||
extern crate serde_json;
|
||||
extern crate serde_cbor;
|
||||
extern crate sha2;
|
||||
extern crate socket2;
|
||||
extern crate solana_drone;
|
||||
extern crate solana_jsonrpc_core as jsonrpc_core;
|
||||
extern crate solana_jsonrpc_http_server as jsonrpc_http_server;
|
||||
extern crate solana_system_program;
|
||||
|
||||
|
||||
|
||||
|
||||
use solana_jsonrpc_core as jsonrpc_core;
|
||||
use solana_jsonrpc_http_server as jsonrpc_http_server;
|
||||
use solana_system_program;
|
||||
#[macro_use]
|
||||
extern crate solana_jsonrpc_macros as jsonrpc_macros;
|
||||
extern crate solana_jsonrpc_pubsub as jsonrpc_pubsub;
|
||||
extern crate solana_jsonrpc_ws_server as jsonrpc_ws_server;
|
||||
extern crate solana_metrics;
|
||||
extern crate solana_native_loader;
|
||||
extern crate solana_sdk;
|
||||
extern crate sys_info;
|
||||
extern crate tokio;
|
||||
extern crate tokio_codec;
|
||||
extern crate untrusted;
|
||||
use solana_jsonrpc_pubsub as jsonrpc_pubsub;
|
||||
use solana_jsonrpc_ws_server as jsonrpc_ws_server;
|
||||
use solana_metrics;
|
||||
use solana_native_loader;
|
||||
|
||||
|
||||
|
||||
|
||||
use untrusted;
|
||||
|
||||
#[cfg(test)]
|
||||
#[macro_use]
|
||||
extern crate matches;
|
||||
|
||||
extern crate rand;
|
||||
extern crate rand_chacha;
|
||||
use rand;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//! `setup()` may be called multiple times.
|
||||
|
||||
use std::sync::{Once, ONCE_INIT};
|
||||
extern crate env_logger;
|
||||
use env_logger;
|
||||
|
||||
static INIT: Once = ONCE_INIT;
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ pub struct Packet {
|
|||
}
|
||||
|
||||
impl fmt::Debug for Packet {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"Packet {{ size: {:?}, addr: {:?} }}",
|
||||
|
@ -135,7 +135,7 @@ impl PartialEq for Blob {
|
|||
}
|
||||
|
||||
impl fmt::Debug for Blob {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"Blob {{ size: {:?}, addr: {:?} }}",
|
||||
|
@ -217,7 +217,7 @@ impl Packets {
|
|||
pub fn to_packets_chunked<T: Serialize>(xs: &[T], chunks: usize) -> Vec<SharedPackets> {
|
||||
let mut out = vec![];
|
||||
for x in xs.chunks(chunks) {
|
||||
let mut p = SharedPackets::default();
|
||||
let p = SharedPackets::default();
|
||||
p.write()
|
||||
.unwrap()
|
||||
.packets
|
||||
|
|
|
@ -19,7 +19,7 @@ pub enum Error {
|
|||
IO(std::io::Error),
|
||||
JSON(serde_json::Error),
|
||||
AddrParse(std::net::AddrParseError),
|
||||
JoinError(Box<Any + Send + 'static>),
|
||||
JoinError(Box<dyn Any + Send + 'static>),
|
||||
RecvError(std::sync::mpsc::RecvError),
|
||||
RecvTimeoutError(std::sync::mpsc::RecvTimeoutError),
|
||||
Serialize(std::boxed::Box<bincode::ErrorKind>),
|
||||
|
@ -38,7 +38,7 @@ pub enum Error {
|
|||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
impl std::fmt::Display for Error {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "solana error")
|
||||
}
|
||||
}
|
||||
|
@ -76,8 +76,8 @@ impl<T> std::convert::From<std::sync::mpsc::SendError<T>> for Error {
|
|||
Error::SendError
|
||||
}
|
||||
}
|
||||
impl std::convert::From<Box<Any + Send + 'static>> for Error {
|
||||
fn from(e: Box<Any + Send + 'static>) -> Error {
|
||||
impl std::convert::From<Box<dyn Any + Send + 'static>> for Error {
|
||||
fn from(e: Box<dyn Any + Send + 'static>) -> Error {
|
||||
Error::JoinError(e)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ impl RpcRequest {
|
|||
client: &RpcClient,
|
||||
id: u64,
|
||||
params: Option<Value>,
|
||||
) -> Result<Value, Box<error::Error>> {
|
||||
) -> Result<Value, Box<dyn error::Error>> {
|
||||
let request = self.build_request_json(id, params);
|
||||
|
||||
let mut response = client
|
||||
|
@ -116,7 +116,7 @@ pub enum RpcError {
|
|||
}
|
||||
|
||||
impl fmt::Display for RpcError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "invalid")
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ impl error::Error for RpcError {
|
|||
"invalid"
|
||||
}
|
||||
|
||||
fn cause(&self) -> Option<&error::Error> {
|
||||
fn cause(&self) -> Option<&dyn error::Error> {
|
||||
// Generic error, underlying cause isn't tracked.
|
||||
None
|
||||
}
|
||||
|
|
|
@ -294,7 +294,7 @@ pub fn ed25519_verify(batches: &[SharedPackets]) -> Vec<Vec<u8>> {
|
|||
trace!("done verify");
|
||||
let mut num = 0;
|
||||
for (vs, sig_vs) in rvs.iter_mut().zip(sig_lens.iter()) {
|
||||
for (mut v, sig_v) in vs.iter_mut().zip(sig_vs.iter()) {
|
||||
for (v, sig_v) in vs.iter_mut().zip(sig_vs.iter()) {
|
||||
let mut vout = 1;
|
||||
for _ in 0..*sig_v {
|
||||
if 0 == out[num] {
|
||||
|
|
|
@ -179,7 +179,7 @@ mod test {
|
|||
let t_responder = responder("streamer_send_test", Arc::new(send), r_responder);
|
||||
let mut msgs = Vec::new();
|
||||
for i in 0..10 {
|
||||
let mut b = SharedBlob::default();
|
||||
let b = SharedBlob::default();
|
||||
{
|
||||
let mut w = b.write().unwrap();
|
||||
w.data[0] = i as u8;
|
||||
|
|
|
@ -313,7 +313,7 @@ pub mod tests {
|
|||
alice_ref_balance -= transfer_amount;
|
||||
|
||||
for entry in vec![entry0, entry_tick0, entry_tick1, entry1, entry_tick2] {
|
||||
let mut b = SharedBlob::default();
|
||||
let b = SharedBlob::default();
|
||||
{
|
||||
let mut w = b.write().unwrap();
|
||||
w.set_index(blob_idx).unwrap();
|
||||
|
|
|
@ -65,7 +65,7 @@ pub enum WalletError {
|
|||
}
|
||||
|
||||
impl fmt::Display for WalletError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "invalid")
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ impl error::Error for WalletError {
|
|||
"invalid"
|
||||
}
|
||||
|
||||
fn cause(&self) -> Option<&error::Error> {
|
||||
fn cause(&self) -> Option<&dyn error::Error> {
|
||||
// Generic error, underlying cause isn't tracked.
|
||||
None
|
||||
}
|
||||
|
@ -119,8 +119,8 @@ impl WalletConfig {
|
|||
|
||||
pub fn parse_command(
|
||||
pubkey: Pubkey,
|
||||
matches: &ArgMatches,
|
||||
) -> Result<WalletCommand, Box<error::Error>> {
|
||||
matches: &ArgMatches<'_>,
|
||||
) -> Result<WalletCommand, Box<dyn error::Error>> {
|
||||
let response = match matches.subcommand() {
|
||||
("address", Some(_address_matches)) => Ok(WalletCommand::Address),
|
||||
("airdrop", Some(airdrop_matches)) => {
|
||||
|
@ -308,7 +308,7 @@ pub fn parse_command(
|
|||
Ok(response)
|
||||
}
|
||||
|
||||
pub fn process_command(config: &WalletConfig) -> Result<String, Box<error::Error>> {
|
||||
pub fn process_command(config: &WalletConfig) -> Result<String, Box<dyn error::Error>> {
|
||||
if let WalletCommand::Address = config.command {
|
||||
// Get address of this client
|
||||
return Ok(format!("{}", config.id.pubkey()));
|
||||
|
@ -667,7 +667,7 @@ pub fn read_leader(path: &str) -> Result<Config, WalletError> {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn gen_keypair_file(outfile: String) -> Result<String, Box<error::Error>> {
|
||||
pub fn gen_keypair_file(outfile: String) -> Result<String, Box<dyn error::Error>> {
|
||||
let rnd = SystemRandom::new();
|
||||
let pkcs8_bytes = Ed25519KeyPair::generate_pkcs8(&rnd)?;
|
||||
let serialized = serde_json::to_string(&pkcs8_bytes.to_vec())?;
|
||||
|
@ -682,7 +682,7 @@ pub fn gen_keypair_file(outfile: String) -> Result<String, Box<error::Error>> {
|
|||
Ok(serialized)
|
||||
}
|
||||
|
||||
fn get_last_id(rpc_client: &RpcClient) -> Result<Hash, Box<error::Error>> {
|
||||
fn get_last_id(rpc_client: &RpcClient) -> Result<Hash, Box<dyn error::Error>> {
|
||||
let result = RpcRequest::GetLastId.make_rpc_request(rpc_client, 1, None)?;
|
||||
if result.as_str().is_none() {
|
||||
Err(WalletError::RpcRequestError(
|
||||
|
@ -696,7 +696,7 @@ fn get_last_id(rpc_client: &RpcClient) -> Result<Hash, Box<error::Error>> {
|
|||
Ok(Hash::new(&last_id_vec))
|
||||
}
|
||||
|
||||
fn send_tx(rpc_client: &RpcClient, tx: &Transaction) -> Result<String, Box<error::Error>> {
|
||||
fn send_tx(rpc_client: &RpcClient, tx: &Transaction) -> Result<String, Box<dyn error::Error>> {
|
||||
let serialized = serialize(tx).unwrap();
|
||||
let params = json!([serialized]);
|
||||
let signature = RpcRequest::SendTransaction.make_rpc_request(rpc_client, 2, Some(params))?;
|
||||
|
@ -711,7 +711,7 @@ fn send_tx(rpc_client: &RpcClient, tx: &Transaction) -> Result<String, Box<error
|
|||
fn confirm_tx(
|
||||
rpc_client: &RpcClient,
|
||||
signature: &str,
|
||||
) -> Result<RpcSignatureStatus, Box<error::Error>> {
|
||||
) -> Result<RpcSignatureStatus, Box<dyn error::Error>> {
|
||||
let params = json!([signature.to_string()]);
|
||||
let signature_status =
|
||||
RpcRequest::GetSignatureStatus.make_rpc_request(rpc_client, 1, Some(params))?;
|
||||
|
@ -727,7 +727,7 @@ fn confirm_tx(
|
|||
}
|
||||
}
|
||||
|
||||
fn send_and_confirm_tx(rpc_client: &RpcClient, tx: &Transaction) -> Result<(), Box<error::Error>> {
|
||||
fn send_and_confirm_tx(rpc_client: &RpcClient, tx: &Transaction) -> Result<(), Box<dyn error::Error>> {
|
||||
let mut send_retries = 3;
|
||||
while send_retries > 0 {
|
||||
let mut status_retries = 4;
|
||||
|
|
|
@ -448,7 +448,7 @@ mod test {
|
|||
let t_responder = responder("streamer_send_test", Arc::new(send), r_responder);
|
||||
let mut msgs = Vec::new();
|
||||
for i in 0..10 {
|
||||
let mut b = SharedBlob::default();
|
||||
let b = SharedBlob::default();
|
||||
{
|
||||
let mut w = b.write().unwrap();
|
||||
w.data[0] = i as u8;
|
||||
|
|
|
@ -298,7 +298,7 @@ mod test {
|
|||
tn.sockets.replicate.into_iter().map(Arc::new).collect();
|
||||
|
||||
let t_responder = responder("window_send_test", blob_sockets[0].clone(), r_responder);
|
||||
let mut num_blobs_to_make = 10;
|
||||
let num_blobs_to_make = 10;
|
||||
let gossip_address = &tn.info.gossip;
|
||||
let msgs = make_consecutive_blobs(
|
||||
me_id,
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#[macro_use]
|
||||
extern crate log;
|
||||
extern crate rayon;
|
||||
extern crate solana;
|
||||
extern crate solana_sdk;
|
||||
|
||||
|
||||
|
||||
|
||||
use rayon::iter::*;
|
||||
use solana::cluster_info::{ClusterInfo, Node};
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#[macro_use]
|
||||
extern crate log;
|
||||
extern crate bincode;
|
||||
extern crate chrono;
|
||||
extern crate serde_json;
|
||||
extern crate solana;
|
||||
extern crate solana_sdk;
|
||||
|
||||
|
||||
|
||||
use solana;
|
||||
|
||||
|
||||
use solana::blob_fetch_stage::BlobFetchStage;
|
||||
use solana::cluster_info::{ClusterInfo, Node, NodeInfo};
|
||||
|
@ -272,7 +272,7 @@ fn test_multi_node_validator_catchup_from_zero() -> result::Result<()> {
|
|||
.unwrap();
|
||||
info!("validator balance {}", validator_balance);
|
||||
|
||||
let mut val = Fullnode::new(
|
||||
let val = Fullnode::new(
|
||||
validator,
|
||||
&ledger_path,
|
||||
keypair,
|
||||
|
@ -871,7 +871,7 @@ fn test_leader_to_validator_transition() {
|
|||
let mut converged = false;
|
||||
for _ in 0..30 {
|
||||
let num = spy_node.read().unwrap().convergence();
|
||||
let mut v: Vec<NodeInfo> = spy_node.read().unwrap().rpc_peers();
|
||||
let v: Vec<NodeInfo> = spy_node.read().unwrap().rpc_peers();
|
||||
// There's only one person excluding the spy node (the leader) who should see
|
||||
// two nodes on the network
|
||||
if num >= 2 && v.len() >= 1 {
|
||||
|
@ -1605,7 +1605,7 @@ fn test_broadcast_last_tick() {
|
|||
// Check that the nodes got the last broadcasted blob
|
||||
for (_, receiver) in blob_fetch_stages.iter() {
|
||||
let mut last_tick_blob: SharedBlob = SharedBlob::default();
|
||||
while let Ok(mut new_blobs) = receiver.try_recv() {
|
||||
while let Ok(new_blobs) = receiver.try_recv() {
|
||||
let last_blob = new_blobs.into_iter().find(|b| {
|
||||
b.read().unwrap().index().expect("Expected index in blob")
|
||||
== last_tick_entry_height - 1
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
extern crate bincode;
|
||||
extern crate elf;
|
||||
extern crate serde_derive;
|
||||
extern crate solana;
|
||||
extern crate solana_native_loader;
|
||||
extern crate solana_sdk;
|
||||
|
||||
|
||||
|
||||
use solana;
|
||||
use solana_native_loader;
|
||||
|
||||
|
||||
use solana::bank::Bank;
|
||||
use solana::logger;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#[macro_use]
|
||||
extern crate log;
|
||||
extern crate solana;
|
||||
extern crate solana_sdk;
|
||||
|
||||
|
||||
|
||||
use solana::client::mk_client;
|
||||
use solana::cluster_info::{Node, NodeInfo};
|
||||
|
|
Loading…
Reference in New Issue