Cli: move airdrop to rpc requests (#16557)

* Add recent_blockhash to requestAirdrop

* Move tx confirmation to separate method

* Add RpcClient airdrop methods

* Request cli airdrop via RpcClient

* Pass optional faucet_addr into TestValidator and fix tests

* Update client/src/rpc_client.rs

Co-authored-by: Michael Vines <mvines@gmail.com>

Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
Tyera Eulberg
2021-04-15 00:25:23 -06:00
committed by GitHub
parent 76ce28c723
commit 7dfb51c0b4
16 changed files with 261 additions and 305 deletions

View File

@ -55,7 +55,7 @@ fn test_rpc_send_tx() {
solana_logger::setup();
let alice = Keypair::new();
let test_validator = TestValidator::with_no_fees(alice.pubkey());
let test_validator = TestValidator::with_no_fees(alice.pubkey(), None);
let rpc_url = test_validator.rpc_url();
let bob_pubkey = solana_sdk::pubkey::new_rand();
@ -119,7 +119,7 @@ fn test_rpc_invalid_requests() {
solana_logger::setup();
let alice = Keypair::new();
let test_validator = TestValidator::with_no_fees(alice.pubkey());
let test_validator = TestValidator::with_no_fees(alice.pubkey(), None);
let rpc_url = test_validator.rpc_url();
let bob_pubkey = solana_sdk::pubkey::new_rand();
@ -150,7 +150,7 @@ fn test_rpc_invalid_requests() {
fn test_rpc_slot_updates() {
solana_logger::setup();
let test_validator = TestValidator::with_no_fees(Pubkey::new_unique());
let test_validator = TestValidator::with_no_fees(Pubkey::new_unique(), None);
// Create the pub sub runtime
let rt = Runtime::new().unwrap();
@ -215,7 +215,7 @@ fn test_rpc_subscriptions() {
solana_logger::setup();
let alice = Keypair::new();
let test_validator = TestValidator::with_no_fees(alice.pubkey());
let test_validator = TestValidator::with_no_fees(alice.pubkey(), None);
let transactions_socket = UdpSocket::bind("0.0.0.0:0").unwrap();
transactions_socket.connect(test_validator.tpu()).unwrap();