Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
add Eq to bench_tps::cli::Congig
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Lykov committed Feb 24, 2023
1 parent fcad6aa commit 3688604
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions bench-tps/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use {

const NUM_LAMPORTS_PER_ACCOUNT_DEFAULT: u64 = solana_sdk::native_token::LAMPORTS_PER_SOL;

#[derive(PartialEq, Debug)]
#[derive(Eq, PartialEq, Debug)]
pub enum ExternalClientType {
// Submits transactions to an Rpc node using an RpcClient
RpcClient,
Expand All @@ -35,7 +35,7 @@ impl Default for ExternalClientType {
}
}

#[derive(PartialEq, Debug)]
#[derive(Eq, PartialEq, Debug)]
pub struct InstructionPaddingConfig {
pub program_id: Pubkey,
pub data_size: u32,
Expand Down Expand Up @@ -74,6 +74,8 @@ pub struct Config {
pub client_node_id: Option<Keypair>,
}

impl Eq for Config {}

impl Default for Config {
fn default() -> Config {
Config {
Expand Down Expand Up @@ -426,7 +428,7 @@ pub fn parse_args(matches: &ArgMatches) -> Result<Config, &'static str> {
args.tpu_connection_pool_size = v
.to_string()
.parse::<usize>()
.map_err(|_| "can't parse tpu_connection_pool_size")?;
.map_err(|_| "can't parse tpu-connection-pool-size")?;
}

if let Some(addr) = matches.value_of("entrypoint") {
Expand Down Expand Up @@ -485,8 +487,10 @@ pub fn parse_args(matches: &ArgMatches) -> Result<Config, &'static str> {
}

if let Some(v) = matches.value_of("target_lamports_per_signature") {
args.target_lamports_per_signature =
v.to_string().parse().map_err(|_| "can't parse lamports")?;
args.target_lamports_per_signature = v
.to_string()
.parse()
.map_err(|_| "can't parse target-lamports-per-signature")?;
}

args.multi_client = !matches.is_present("no-multi-client");
Expand Down Expand Up @@ -552,7 +556,7 @@ pub fn parse_args(matches: &ArgMatches) -> Result<Config, &'static str> {
#[cfg(test)]
mod tests {
use {
crate::cli::{build_args, parse_args, Config, ExternalClientType},
super::*,
solana_sdk::signature::{read_keypair_file, write_keypair_file, Keypair, Signer},
std::{
net::{IpAddr, Ipv4Addr, SocketAddr},
Expand Down

0 comments on commit 3688604

Please sign in to comment.