Skip to content

Commit

Permalink
Migrate drone to poll_for_signature
Browse files Browse the repository at this point in the history
  • Loading branch information
garious committed Jul 21, 2018
1 parent 0e305bd commit 23428b0
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/drone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,20 +298,6 @@ mod tests {
Some(150_000),
);

let bob_req = DroneRequest::GetAirdrop {
airdrop_request_amount: 50,
client_public_key: bob_pubkey,
};
let bob_result = drone.send_airdrop(bob_req);
assert!(bob_result.is_ok());

let carlos_req = DroneRequest::GetAirdrop {
airdrop_request_amount: 5_000_000,
client_public_key: carlos_pubkey,
};
let carlos_result = drone.send_airdrop(carlos_req);
assert!(carlos_result.is_ok());

let requests_socket = UdpSocket::bind("0.0.0.0:0").expect("drone bind to requests socket");
let transactions_socket =
UdpSocket::bind("0.0.0.0:0").expect("drone bind to transactions socket");
Expand All @@ -323,11 +309,25 @@ mod tests {
transactions_socket,
);

let bob_balance = client.poll_get_balance(&bob_pubkey);
let bob_req = DroneRequest::GetAirdrop {
airdrop_request_amount: 50,
client_public_key: bob_pubkey,
};
let bob_sig = drone.send_airdrop(bob_req).unwrap();
assert!(client.poll_for_signature(&bob_sig).is_ok());

let carlos_req = DroneRequest::GetAirdrop {
airdrop_request_amount: 5_000_000,
client_public_key: carlos_pubkey,
};
let carlos_sig = drone.send_airdrop(carlos_req).unwrap();
assert!(client.poll_for_signature(&carlos_sig).is_ok());

let bob_balance = client.get_balance(&bob_pubkey);
info!("Small request balance: {:?}", bob_balance);
assert_eq!(bob_balance.unwrap(), SMALL_BATCH);

let carlos_balance = client.poll_get_balance(&carlos_pubkey);
let carlos_balance = client.get_balance(&carlos_pubkey);
info!("TPS request balance: {:?}", carlos_balance);
assert_eq!(carlos_balance.unwrap(), TPS_BATCH);

Expand Down

0 comments on commit 23428b0

Please sign in to comment.