diff --git a/Cargo.toml b/Cargo.toml index cda99ce34..6073503f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,6 +63,5 @@ byteorder = "^1.2.1" libc = "^0.2.1" getopts = "^0.2" isatty = "0.1" -futures = "0.1" rand = "0.4.2" pnet = "^0.21.0" diff --git a/src/bin/client-demo.rs b/src/bin/client-demo.rs index de51a382f..9ad769069 100644 --- a/src/bin/client-demo.rs +++ b/src/bin/client-demo.rs @@ -1,4 +1,3 @@ -extern crate futures; extern crate getopts; extern crate isatty; extern crate pnet; @@ -6,7 +5,6 @@ extern crate rayon; extern crate serde_json; extern crate solana; -use futures::Future; use getopts::Options; use isatty::stdin_isatty; use pnet::datalink; @@ -128,7 +126,7 @@ fn main() { let mut client = mk_client(&client_addr, &leader); println!("Get last ID..."); - let last_id = client.get_last_id().wait().unwrap(); + let last_id = client.get_last_id(); println!("Got last ID {:?}", last_id); let rnd = GenKeys::new(demo.mint.keypair().public_key_bytes()); diff --git a/src/lib.rs b/src/lib.rs index dcd26f385..110dd1558 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,8 +50,6 @@ extern crate serde_json; extern crate sha2; extern crate untrusted; -extern crate futures; - #[cfg(test)] #[macro_use] extern crate matches; diff --git a/src/thin_client.rs b/src/thin_client.rs index b1efb5801..3b40ca047 100644 --- a/src/thin_client.rs +++ b/src/thin_client.rs @@ -4,7 +4,6 @@ //! unstable and may change in future releases. use bincode::{deserialize, serialize}; -use futures::future::{ok, FutureResult}; use hash::Hash; use request::{Request, Response}; use signature::{KeyPair, PublicKey, Signature}; @@ -138,7 +137,7 @@ impl ThinClient { /// Request the last Entry ID from the server. This method blocks /// until the server sends a response. - pub fn get_last_id(&mut self) -> FutureResult { + pub fn get_last_id(&mut self) -> Hash { info!("get_last_id"); let req = Request::GetLastId; let data = serialize(&req).expect("serialize GetLastId in pub fn get_last_id"); @@ -153,7 +152,7 @@ impl ThinClient { } self.process_response(resp); } - ok(self.last_id.expect("some last_id")) + self.last_id.expect("some last_id") } pub fn poll_get_balance(&mut self, pubkey: &PublicKey) -> io::Result { @@ -178,7 +177,6 @@ mod tests { use bank::Bank; use budget::Budget; use crdt::TestNode; - use futures::Future; use logger; use mint::Mint; use server::Server; @@ -223,7 +221,7 @@ mod tests { leader.data.transactions_addr, transactions_socket, ); - let last_id = client.get_last_id().wait().unwrap(); + let last_id = client.get_last_id(); let _sig = client .transfer(500, &alice.keypair(), bob_pubkey, &last_id) .unwrap(); @@ -269,13 +267,13 @@ mod tests { leader.data.transactions_addr, transactions_socket, ); - let last_id = client.get_last_id().wait().unwrap(); + let last_id = client.get_last_id(); let tx = Transaction::new(&alice.keypair(), bob_pubkey, 500, last_id); let _sig = client.transfer_signed(tx).unwrap(); - let last_id = client.get_last_id().wait().unwrap(); + let last_id = client.get_last_id(); let mut tr2 = Transaction::new(&alice.keypair(), bob_pubkey, 501, last_id); if let Instruction::NewContract(contract) = &mut tr2.instruction { diff --git a/tests/multinode.rs b/tests/multinode.rs index cdb6c86ef..bf53fa734 100644 --- a/tests/multinode.rs +++ b/tests/multinode.rs @@ -1,10 +1,8 @@ #[macro_use] extern crate log; extern crate bincode; -extern crate futures; extern crate solana; -use futures::Future; use solana::bank::Bank; use solana::crdt::TestNode; use solana::crdt::{Crdt, ReplicatedData}; @@ -167,7 +165,7 @@ fn tx_and_retry_get_balance( ) -> io::Result { let mut client = mk_client(leader); trace!("getting leader last_id"); - let last_id = client.get_last_id().wait().unwrap(); + let last_id = client.get_last_id(); info!("executing leader transer"); let _sig = client .transfer(500, &alice.keypair(), *bob_pubkey, &last_id)