cargo +nightly fmt
This commit is contained in:
parent
785e971698
commit
1dca17fdb4
|
@ -10,9 +10,9 @@ use futures::Future;
|
|||
use getopts::Options;
|
||||
use isatty::stdin_isatty;
|
||||
use rayon::prelude::*;
|
||||
use solana::thin_client::ThinClient;
|
||||
use solana::mint::MintDemo;
|
||||
use solana::signature::{KeyPair, KeyPairUtil};
|
||||
use solana::thin_client::ThinClient;
|
||||
use solana::transaction::Transaction;
|
||||
use std::env;
|
||||
use std::io::{stdin, Read};
|
||||
|
|
|
@ -7,12 +7,12 @@ extern crate solana;
|
|||
use getopts::Options;
|
||||
use isatty::stdin_isatty;
|
||||
use solana::accountant::Accountant;
|
||||
use solana::tpu::Tpu;
|
||||
use solana::crdt::ReplicatedData;
|
||||
use solana::entry::Entry;
|
||||
use solana::event::Event;
|
||||
use solana::historian::Historian;
|
||||
use solana::signature::{KeyPair, KeyPairUtil};
|
||||
use solana::tpu::Tpu;
|
||||
use std::env;
|
||||
use std::io::{stdin, stdout, Read};
|
||||
use std::net::UdpSocket;
|
||||
|
|
|
@ -130,11 +130,11 @@ pub fn ed25519_verify(batches: &Vec<SharedPackets>) -> Vec<Vec<u8>> {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use tpu::Request;
|
||||
use bincode::serialize;
|
||||
use ecdsa;
|
||||
use packet::{Packet, Packets, SharedPackets};
|
||||
use std::sync::RwLock;
|
||||
use tpu::Request;
|
||||
use transaction::test_tx;
|
||||
use transaction::Transaction;
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ pub mod signature;
|
|||
pub mod streamer;
|
||||
pub mod thin_client;
|
||||
pub mod timing;
|
||||
pub mod transaction;
|
||||
pub mod tpu;
|
||||
pub mod transaction;
|
||||
extern crate bincode;
|
||||
extern crate byteorder;
|
||||
extern crate chrono;
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
//! messages to the network directly. The binary encoding of its messages are
|
||||
//! unstable and may change in future releases.
|
||||
|
||||
use tpu::{Request, Response, Subscription};
|
||||
use bincode::{deserialize, serialize};
|
||||
use futures::future::{ok, FutureResult};
|
||||
use hash::Hash;
|
||||
|
@ -11,6 +10,7 @@ use signature::{KeyPair, PublicKey, Signature};
|
|||
use std::collections::HashMap;
|
||||
use std::io;
|
||||
use std::net::{SocketAddr, UdpSocket};
|
||||
use tpu::{Request, Response, Subscription};
|
||||
use transaction::Transaction;
|
||||
|
||||
pub struct ThinClient {
|
||||
|
@ -148,7 +148,6 @@ impl ThinClient {
|
|||
mod tests {
|
||||
use super::*;
|
||||
use accountant::Accountant;
|
||||
use tpu::Tpu;
|
||||
use crdt::{Crdt, ReplicatedData};
|
||||
use futures::Future;
|
||||
use historian::Historian;
|
||||
|
@ -162,6 +161,7 @@ mod tests {
|
|||
use std::thread::sleep;
|
||||
use std::time::Duration;
|
||||
use std::time::Instant;
|
||||
use tpu::Tpu;
|
||||
|
||||
// TODO: Figure out why this test sometimes hangs on TravisCI.
|
||||
#[test]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
use std::time::Duration;
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
pub fn duration_as_ms(d: &Duration) -> u64 {
|
||||
return (d.as_secs() * 1000) + (d.subsec_nanos() as u64 / 1_000_000);
|
||||
|
|
16
src/tpu.rs
16
src/tpu.rs
|
@ -11,6 +11,7 @@ use hash::Hash;
|
|||
use historian::Historian;
|
||||
use packet;
|
||||
use packet::{SharedBlob, SharedPackets, BLOB_SIZE};
|
||||
use rand::{thread_rng, Rng};
|
||||
use rayon::prelude::*;
|
||||
use recorder::Signal;
|
||||
use result::Result;
|
||||
|
@ -26,11 +27,10 @@ use std::sync::mpsc::{channel, Receiver, Sender, SyncSender};
|
|||
use std::sync::{Arc, Mutex, RwLock};
|
||||
use std::thread::{spawn, JoinHandle};
|
||||
use std::time::Duration;
|
||||
use streamer;
|
||||
use transaction::Transaction;
|
||||
use timing;
|
||||
use std::time::Instant;
|
||||
use rand::{thread_rng, Rng};
|
||||
use streamer;
|
||||
use timing;
|
||||
use transaction::Transaction;
|
||||
|
||||
pub struct Tpu {
|
||||
acc: Mutex<Accountant>,
|
||||
|
@ -785,15 +785,13 @@ pub fn to_packets(r: &packet::PacketRecycler, reqs: Vec<Request>) -> Vec<SharedP
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use tpu::{to_packets, Request};
|
||||
use bincode::serialize;
|
||||
use ecdsa;
|
||||
use packet::{BlobRecycler, PacketRecycler, BLOB_SIZE, NUM_PACKETS};
|
||||
use tpu::{to_packets, Request};
|
||||
use transaction::{memfind, test_tx};
|
||||
|
||||
use accountant::Accountant;
|
||||
use tpu::Tpu;
|
||||
use thin_client::ThinClient;
|
||||
use chrono::prelude::*;
|
||||
use crdt::Crdt;
|
||||
use crdt::ReplicatedData;
|
||||
|
@ -818,6 +816,8 @@ mod tests {
|
|||
use std::thread::sleep;
|
||||
use std::time::Duration;
|
||||
use streamer;
|
||||
use thin_client::ThinClient;
|
||||
use tpu::Tpu;
|
||||
use transaction::Transaction;
|
||||
|
||||
#[test]
|
||||
|
@ -1126,7 +1126,6 @@ mod bench {
|
|||
extern crate test;
|
||||
use self::test::Bencher;
|
||||
use accountant::{Accountant, MAX_ENTRY_IDS};
|
||||
use tpu::*;
|
||||
use bincode::serialize;
|
||||
use hash::hash;
|
||||
use mint::Mint;
|
||||
|
@ -1134,6 +1133,7 @@ mod bench {
|
|||
use std::collections::HashSet;
|
||||
use std::sync::mpsc::sync_channel;
|
||||
use std::time::Instant;
|
||||
use tpu::*;
|
||||
use transaction::Transaction;
|
||||
|
||||
#[bench]
|
||||
|
|
Loading…
Reference in New Issue