Fixed workers test. connect to Write Address for lite_client

This commit is contained in:
Aniket Prajapati 2022-12-27 16:40:05 +05:30
parent 15b8780422
commit 02ef2996b1
2 changed files with 7 additions and 3 deletions

View File

@ -1,3 +1,4 @@
use anyhow::Context;
use lite_client::LiteClient;
use log::info;
use solana_client::nonblocking::rpc_client::RpcClient;
@ -15,7 +16,10 @@ pub async fn new_funded_payer(lite_client: &LiteClient, amount: u64) -> anyhow::
let payer_pubkey = payer.pubkey().to_string();
// request airdrop to payer
let airdrop_sig = lite_client.request_airdrop(&payer.pubkey(), amount).await?;
let airdrop_sig = lite_client
.request_airdrop(&payer.pubkey(), amount)
.await
.context("requesting air drop")?;
info!("Air Dropping {payer_pubkey} with {amount}L");

View File

@ -7,7 +7,7 @@ use lite_client::LiteClient;
use lite_rpc::{
encoding::BinaryEncoding,
workers::{BlockListener, TxSender},
DEFAULT_RPC_ADDR, DEFAULT_WS_ADDR,
DEFAULT_RPC_ADDR, DEFAULT_WS_ADDR, DEFAULT_LITE_RPC_ADDR,
};
use solana_client::nonblocking::{rpc_client::RpcClient, tpu_client::TpuClient};
@ -16,7 +16,7 @@ use solana_sdk::{commitment_config::CommitmentConfig, native_token::LAMPORTS_PER
#[tokio::test]
async fn send_and_confirm_txs() {
let rpc_client = Arc::new(RpcClient::new(DEFAULT_RPC_ADDR.to_string()));
let lite_client = LiteClient(RpcClient::new(DEFAULT_RPC_ADDR.to_string()));
let lite_client = LiteClient(RpcClient::new(DEFAULT_LITE_RPC_ADDR.to_string()));
let tpu_client = Arc::new(
TpuClient::new(rpc_client.clone(), DEFAULT_WS_ADDR, Default::default())