Skip to content

Commit

Permalink
rename sidentity to stake_identity in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillLykov committed Jan 15, 2025
1 parent 95c5df7 commit 1db2845
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tpu-client-next/tests/connection_workers_scheduler_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ use {
tokio_util::sync::CancellationToken,
};

fn test_config(identity: Option<Keypair>) -> ConnectionWorkersSchedulerConfig {
fn test_config(stake_identity: Option<Keypair>) -> ConnectionWorkersSchedulerConfig {
ConnectionWorkersSchedulerConfig {
bind: SocketAddr::new(Ipv4Addr::new(127, 0, 0, 1).into(), 0),
stake_identity: identity,
stake_identity,
num_connections: 1,
skip_check_transaction_age: false,
// At the moment we have only one strategy to send transactions: we try
Expand All @@ -65,7 +65,7 @@ fn test_config(identity: Option<Keypair>) -> ConnectionWorkersSchedulerConfig {
async fn setup_connection_worker_scheduler(
tpu_address: SocketAddr,
transaction_receiver: Receiver<TransactionBatch>,
identity: Option<Keypair>,
stake_identity: Option<Keypair>,
) -> (
JoinHandle<Result<TransactionStatsAndReceiver, ConnectionWorkersSchedulerError>>,
CancellationToken,
Expand All @@ -84,7 +84,7 @@ async fn setup_connection_worker_scheduler(
.expect("Leader updates was successfully created");

let cancel = CancellationToken::new();
let config = test_config(identity);
let config = test_config(stake_identity);
let scheduler = tokio::spawn(ConnectionWorkersScheduler::run(
config,
leader_updater,
Expand Down Expand Up @@ -402,8 +402,8 @@ async fn test_connection_pruned_and_reopened() {
/// connection and verify that all the txs has been received.
#[tokio::test]
async fn test_staked_connection() {
let identity = Keypair::new();
let stakes = HashMap::from([(identity.pubkey(), 100_000)]);
let stake_identity = Keypair::new();
let stakes = HashMap::from([(stake_identity.pubkey(), 100_000)]);
let staked_nodes = StakedNodes::new(Arc::new(stakes), HashMap::<Pubkey, u64>::default());

let SpawnTestServerResult {
Expand Down Expand Up @@ -434,7 +434,7 @@ async fn test_staked_connection() {
} = spawn_tx_sender(tx_size, expected_num_txs, Duration::from_millis(100));

let (scheduler_handle, _scheduler_cancel) =
setup_connection_worker_scheduler(server_address, tx_receiver, Some(identity)).await;
setup_connection_worker_scheduler(server_address, tx_receiver, Some(stake_identity)).await;

// Check results
let actual_num_packets = count_received_packets_for(receiver, tx_size, TEST_MAX_TIME).await;
Expand Down

0 comments on commit 1db2845

Please sign in to comment.