Move mock request_airdrop_transaction into drone/, closer to the real impl
This commit is contained in:
@@ -2,14 +2,8 @@
|
||||
|
||||
use crate::rpc_request::{RpcRequest, RpcRequestHandler};
|
||||
use serde_json::{json, Number, Value};
|
||||
use solana_sdk::hash::Hash;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use solana_sdk::signature::{Keypair, KeypairUtil};
|
||||
use solana_sdk::system_transaction::SystemTransaction;
|
||||
use solana_sdk::transaction::Transaction;
|
||||
use std::error;
|
||||
use std::io::{Error, ErrorKind};
|
||||
use std::net::SocketAddr;
|
||||
|
||||
pub const PUBKEY: &str = "7RoSF9fUmdphVCpabEoefH81WwrW7orsWonXWqTXkKV8";
|
||||
pub const SIGNATURE: &str =
|
||||
@@ -90,19 +84,3 @@ impl RpcRequestHandler for MockRpcClient {
|
||||
self.retry_make_rpc_request(&request, params, 0)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn request_airdrop_transaction(
|
||||
_drone_addr: &SocketAddr,
|
||||
_id: &Pubkey,
|
||||
lamports: u64,
|
||||
_blockhash: Hash,
|
||||
) -> Result<Transaction, Error> {
|
||||
if lamports == 0 {
|
||||
Err(Error::new(ErrorKind::Other, "Airdrop failed"))?
|
||||
}
|
||||
let key = Keypair::new();
|
||||
let to = Keypair::new().pubkey();
|
||||
let blockhash = Hash::default();
|
||||
let tx = SystemTransaction::new_account(&key, &to, lamports, blockhash, 0);
|
||||
Ok(tx)
|
||||
}
|
||||
|
Reference in New Issue
Block a user