diff --git a/src/bin/client-demo.rs b/src/bin/client-demo.rs index 04f810a04f..d9627031f4 100755 --- a/src/bin/client-demo.rs +++ b/src/bin/client-demo.rs @@ -415,7 +415,6 @@ fn request_airdrop( let req = DroneRequest::GetAirdrop { airdrop_request_amount: tokens, client_public_key: id.pubkey(), - tps_demo: true, }; let tx = serialize(&req).expect("serialize drone request"); stream.write_all(&tx).unwrap(); diff --git a/src/bin/wallet.rs b/src/bin/wallet.rs index 074d0ff9dd..1f93eba557 100644 --- a/src/bin/wallet.rs +++ b/src/bin/wallet.rs @@ -321,7 +321,6 @@ fn request_airdrop( let req = DroneRequest::GetAirdrop { airdrop_request_amount: tokens, client_public_key: id.pubkey(), - tps_demo: false, }; let tx = serialize(&req).expect("serialize drone request"); stream.write_all(&tx).unwrap(); diff --git a/src/drone.rs b/src/drone.rs index c0b052c648..2aab65dc68 100644 --- a/src/drone.rs +++ b/src/drone.rs @@ -13,14 +13,13 @@ use thin_client::ThinClient; use transaction::Transaction; pub const TIME_SLICE: u64 = 60; -pub const REQUEST_CAP: u64 = 150_000; +pub const REQUEST_CAP: u64 = 1_000_000; #[derive(Serialize, Deserialize, Debug)] pub enum DroneRequest { GetAirdrop { airdrop_request_amount: u64, client_public_key: PublicKey, - tps_demo: bool, }, } @@ -33,7 +32,6 @@ pub struct Drone { pub time_slice: Duration, request_cap: u64, pub request_current: u64, - pub tps_request_current: bool, } impl Drone { @@ -62,7 +60,6 @@ impl Drone { time_slice, request_cap, request_current: 0, - tps_request_current: false, } } @@ -72,7 +69,6 @@ impl Drone { pub fn clear_request_count(&mut self) { self.request_current = 0; - self.tps_request_current = false; } pub fn add_ip_to_cache(&mut self, ip: IpAddr) { @@ -108,13 +104,11 @@ impl Drone { transactions_socket, ); let last_id = client.get_last_id(); - let tps_check: bool; match req { DroneRequest::GetAirdrop { airdrop_request_amount, client_public_key, - tps_demo, } => { request_amount = airdrop_request_amount.clone(); tx = Transaction::new( @@ -123,15 +117,11 @@ impl Drone { airdrop_request_amount as i64, last_id, ); - tps_check = tps_demo; } } if self.check_request_limit(request_amount) { self.request_current += request_amount; client.transfer_signed(tx) - } else if tps_check && !self.tps_request_current { - self.tps_request_current = true; - client.transfer_signed(tx) } else { Err(Error::new(ErrorKind::Other, "token limit reached")) } @@ -284,7 +274,6 @@ mod tests { let bob_req = DroneRequest::GetAirdrop { airdrop_request_amount: 50, client_public_key: bob_pubkey, - tps_demo: false, }; let bob_result = drone.send_airdrop(bob_req).expect("send airdrop test"); assert!(bob_result > 0); @@ -292,7 +281,6 @@ mod tests { let carlos_req = DroneRequest::GetAirdrop { airdrop_request_amount: 5_000_000, client_public_key: carlos_pubkey, - tps_demo: true, }; let carlos_result = drone.send_airdrop(carlos_req).expect("send airdrop test"); assert!(carlos_result > 0);