commit
740f6d2258
|
@ -309,16 +309,16 @@ mod tests {
|
||||||
mod bench {
|
mod bench {
|
||||||
extern crate test;
|
extern crate test;
|
||||||
use self::test::Bencher;
|
use self::test::Bencher;
|
||||||
use accountant_skel::*;
|
|
||||||
use accountant::{Accountant, MAX_ENTRY_IDS};
|
use accountant::{Accountant, MAX_ENTRY_IDS};
|
||||||
use signature::{KeyPair, KeyPairUtil};
|
use accountant_skel::*;
|
||||||
|
use bincode::serialize;
|
||||||
|
use hash::hash;
|
||||||
use mint::Mint;
|
use mint::Mint;
|
||||||
use transaction::Transaction;
|
use signature::{KeyPair, KeyPairUtil};
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::io::sink;
|
use std::io::sink;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
use bincode::serialize;
|
use transaction::Transaction;
|
||||||
use hash::hash;
|
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
fn process_packets_bench(_bencher: &mut Bencher) {
|
fn process_packets_bench(_bencher: &mut Bencher) {
|
||||||
|
|
|
@ -3,17 +3,17 @@ extern crate rayon;
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
extern crate solana;
|
extern crate solana;
|
||||||
|
|
||||||
|
use getopts::Options;
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use solana::accountant_stub::AccountantStub;
|
use solana::accountant_stub::AccountantStub;
|
||||||
use solana::mint::Mint;
|
use solana::mint::Mint;
|
||||||
use solana::signature::{KeyPair, KeyPairUtil};
|
use solana::signature::{KeyPair, KeyPairUtil};
|
||||||
use solana::transaction::Transaction;
|
use solana::transaction::Transaction;
|
||||||
|
use std::env;
|
||||||
use std::io::stdin;
|
use std::io::stdin;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
use std::thread::sleep;
|
use std::thread::sleep;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
use std::env;
|
|
||||||
use getopts::Options;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut threads = 4usize;
|
let mut threads = 4usize;
|
||||||
|
|
|
@ -3,16 +3,16 @@ extern crate getopts;
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
extern crate solana;
|
extern crate solana;
|
||||||
|
|
||||||
|
use getopts::Options;
|
||||||
use solana::accountant::Accountant;
|
use solana::accountant::Accountant;
|
||||||
use solana::accountant_skel::AccountantSkel;
|
use solana::accountant_skel::AccountantSkel;
|
||||||
use solana::entry::Entry;
|
use solana::entry::Entry;
|
||||||
use solana::event::Event;
|
use solana::event::Event;
|
||||||
use solana::historian::Historian;
|
use solana::historian::Historian;
|
||||||
|
use std::env;
|
||||||
use std::io::{self, stdout, BufRead};
|
use std::io::{self, stdout, BufRead};
|
||||||
use std::sync::atomic::AtomicBool;
|
use std::sync::atomic::AtomicBool;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::env;
|
|
||||||
use getopts::Options;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
env_logger::init().unwrap();
|
env_logger::init().unwrap();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use packet::{Packet, SharedPackets};
|
use packet::{Packet, SharedPackets};
|
||||||
use transaction::{PUB_KEY_OFFSET, SIGNED_DATA_OFFSET, SIG_OFFSET};
|
|
||||||
use std::mem::size_of;
|
use std::mem::size_of;
|
||||||
|
use transaction::{PUB_KEY_OFFSET, SIGNED_DATA_OFFSET, SIG_OFFSET};
|
||||||
|
|
||||||
pub const TX_OFFSET: usize = 4;
|
pub const TX_OFFSET: usize = 4;
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@ extern "C" {
|
||||||
#[cfg(not(feature = "cuda"))]
|
#[cfg(not(feature = "cuda"))]
|
||||||
fn verify_packet(packet: &Packet) -> u8 {
|
fn verify_packet(packet: &Packet) -> u8 {
|
||||||
use ring::signature;
|
use ring::signature;
|
||||||
use untrusted;
|
|
||||||
use signature::{PublicKey, Signature};
|
use signature::{PublicKey, Signature};
|
||||||
|
use untrusted;
|
||||||
|
|
||||||
let msg_start = TX_OFFSET + SIGNED_DATA_OFFSET;
|
let msg_start = TX_OFFSET + SIGNED_DATA_OFFSET;
|
||||||
let sig_start = TX_OFFSET + SIG_OFFSET;
|
let sig_start = TX_OFFSET + SIG_OFFSET;
|
||||||
|
@ -130,12 +130,12 @@ pub fn ed25519_verify(batches: &Vec<SharedPackets>) -> Vec<Vec<u8>> {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use transaction::test_tx;
|
|
||||||
use accountant_skel::Request;
|
use accountant_skel::Request;
|
||||||
use bincode::serialize;
|
use bincode::serialize;
|
||||||
use ecdsa;
|
use ecdsa;
|
||||||
use std::sync::RwLock;
|
|
||||||
use packet::{Packet, Packets, SharedPackets};
|
use packet::{Packet, Packets, SharedPackets};
|
||||||
|
use std::sync::RwLock;
|
||||||
|
use transaction::test_tx;
|
||||||
use transaction::Transaction;
|
use transaction::Transaction;
|
||||||
|
|
||||||
fn make_packet_from_transaction(tr: Transaction) -> Packet {
|
fn make_packet_from_transaction(tr: Transaction) -> Packet {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! The `hash` module provides functions for creating SHA-256 hashes.
|
//! The `hash` module provides functions for creating SHA-256 hashes.
|
||||||
|
|
||||||
use generic_array::GenericArray;
|
|
||||||
use generic_array::typenum::U32;
|
use generic_array::typenum::U32;
|
||||||
|
use generic_array::GenericArray;
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
|
|
||||||
pub type Hash = GenericArray<u8, U32>;
|
pub type Hash = GenericArray<u8, U32>;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! The `mint` module is a library for generating the chain's genesis block.
|
//! The `mint` module is a library for generating the chain's genesis block.
|
||||||
|
|
||||||
use entry::Entry;
|
|
||||||
use entry::create_entry;
|
use entry::create_entry;
|
||||||
|
use entry::Entry;
|
||||||
use event::Event;
|
use event::Event;
|
||||||
use hash::{hash, Hash};
|
use hash::{hash, Hash};
|
||||||
use ring::rand::SystemRandom;
|
use ring::rand::SystemRandom;
|
||||||
|
|
|
@ -70,9 +70,9 @@ mod tests {
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
|
use std::sync::mpsc::channel;
|
||||||
use std::sync::mpsc::RecvError;
|
use std::sync::mpsc::RecvError;
|
||||||
use std::sync::mpsc::RecvTimeoutError;
|
use std::sync::mpsc::RecvTimeoutError;
|
||||||
use std::sync::mpsc::channel;
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
fn addr_parse_error() -> Result<SocketAddr> {
|
fn addr_parse_error() -> Result<SocketAddr> {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! The `signature` module provides functionality for public, and private keys.
|
//! The `signature` module provides functionality for public, and private keys.
|
||||||
|
|
||||||
use generic_array::GenericArray;
|
|
||||||
use generic_array::typenum::{U32, U64};
|
use generic_array::typenum::{U32, U64};
|
||||||
|
use generic_array::GenericArray;
|
||||||
use ring::signature::Ed25519KeyPair;
|
use ring::signature::Ed25519KeyPair;
|
||||||
use ring::{rand, signature};
|
use ring::{rand, signature};
|
||||||
use untrusted;
|
use untrusted;
|
||||||
|
|
|
@ -2,9 +2,9 @@ use packet::{Blob, BlobRecycler, PacketRecycler, SharedBlob, SharedPackets, NUM_
|
||||||
use result::Result;
|
use result::Result;
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
use std::sync::Arc;
|
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::sync::mpsc;
|
use std::sync::mpsc;
|
||||||
|
use std::sync::Arc;
|
||||||
use std::thread::{spawn, JoinHandle};
|
use std::thread::{spawn, JoinHandle};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
|
@ -246,9 +246,9 @@ mod test {
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
use std::sync::Arc;
|
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::sync::mpsc::channel;
|
use std::sync::mpsc::channel;
|
||||||
|
use std::sync::Arc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use streamer::{receiver, responder, window, BlobReceiver, PacketReceiver};
|
use streamer::{receiver, responder, window, BlobReceiver, PacketReceiver};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue