Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bench-tps/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,7 @@ fn compute_and_report_stats(
);
}

#[allow(clippy::result_large_err)]
pub fn generate_and_fund_keypairs<T: 'static + TpsClient + Send + Sync + ?Sized>(
client: Arc<T>,
funding_key: &Keypair,
Expand Down Expand Up @@ -1140,6 +1141,7 @@ pub fn generate_and_fund_keypairs<T: 'static + TpsClient + Send + Sync + ?Sized>
Ok(keypairs)
}

#[allow(clippy::result_large_err)]
pub fn fund_keypairs<T: 'static + TpsClient + Send + Sync + ?Sized>(
client: Arc<T>,
funding_key: &Keypair,
Expand Down
3 changes: 3 additions & 0 deletions bench-tps/src/rpc_with_retry_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use {
const NUM_RETRY: u64 = 5;
const RETRY_EVERY_MS: u64 = 4 * DEFAULT_MS_PER_SLOT;

#[allow(clippy::result_large_err)]
fn call_rpc_with_retry<Func, Data>(f: Func, retry_warning: &str) -> TpsClientResult<Data>
where
Func: Fn() -> TpsClientResult<Data>,
Expand All @@ -32,6 +33,7 @@ where
}
}

#[allow(clippy::result_large_err)]
pub(crate) fn get_slot_with_retry<Client>(
client: &Arc<Client>,
commitment: CommitmentConfig,
Expand All @@ -45,6 +47,7 @@ where
)
}

#[allow(clippy::result_large_err)]
pub(crate) fn get_blocks_with_retry<Client>(
client: &Arc<Client>,
start_slot: Slot,
Expand Down
1 change: 1 addition & 0 deletions cli/src/address_lookup_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ impl AddressLookupTableSubCommands for App<'_, '_> {
}
}

#[allow(clippy::result_large_err)]
pub fn parse_address_lookup_table_subcommand(
matches: &ArgMatches<'_>,
default_signer: &DefaultSigner,
Expand Down
10 changes: 10 additions & 0 deletions cli/src/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use {
solana_rpc_client_api::client_error::Result as ClientResult,
};

#[allow(clippy::result_large_err)]
pub fn check_account_for_fee(
rpc_client: &RpcClient,
account_pubkey: &Pubkey,
Expand All @@ -13,6 +14,7 @@ pub fn check_account_for_fee(
check_account_for_multiple_fees(rpc_client, account_pubkey, &[message])
}

#[allow(clippy::result_large_err)]
pub fn check_account_for_fee_with_commitment(
rpc_client: &RpcClient,
account_pubkey: &Pubkey,
Expand All @@ -27,6 +29,7 @@ pub fn check_account_for_fee_with_commitment(
)
}

#[allow(clippy::result_large_err)]
pub fn check_account_for_multiple_fees(
rpc_client: &RpcClient,
account_pubkey: &Pubkey,
Expand All @@ -40,6 +43,7 @@ pub fn check_account_for_multiple_fees(
)
}

#[allow(clippy::result_large_err)]
pub fn check_account_for_multiple_fees_with_commitment(
rpc_client: &RpcClient,
account_pubkey: &Pubkey,
Expand All @@ -55,6 +59,7 @@ pub fn check_account_for_multiple_fees_with_commitment(
)
}

#[allow(clippy::result_large_err)]
pub fn check_account_for_spend_multiple_fees_with_commitment(
rpc_client: &RpcClient,
account_pubkey: &Pubkey,
Expand All @@ -72,6 +77,7 @@ pub fn check_account_for_spend_multiple_fees_with_commitment(
)
}

#[allow(clippy::result_large_err)]
pub fn check_account_for_spend_and_fee_with_commitment(
rpc_client: &RpcClient,
account_pubkey: &Pubkey,
Expand Down Expand Up @@ -110,6 +116,7 @@ pub fn check_account_for_spend_and_fee_with_commitment(
Ok(())
}

#[allow(clippy::result_large_err)]
pub fn get_fee_for_messages(
rpc_client: &RpcClient,
messages: &[&Message],
Expand All @@ -122,6 +129,7 @@ pub fn get_fee_for_messages(
.sum())
}

#[allow(clippy::result_large_err)]
pub fn check_account_for_balance(
rpc_client: &RpcClient,
account_pubkey: &Pubkey,
Expand All @@ -135,6 +143,7 @@ pub fn check_account_for_balance(
)
}

#[allow(clippy::result_large_err)]
pub fn check_account_for_balance_with_commitment(
rpc_client: &RpcClient,
account_pubkey: &Pubkey,
Expand All @@ -150,6 +159,7 @@ pub fn check_account_for_balance_with_commitment(
Ok(false)
}

#[allow(clippy::result_large_err)]
pub fn check_unique_pubkeys(
pubkey0: (&Pubkey, String),
pubkey1: (&Pubkey, String),
Expand Down
1 change: 1 addition & 0 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1718,6 +1718,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
}
}

#[allow(clippy::result_large_err)]
pub fn request_and_confirm_airdrop(
rpc_client: &RpcClient,
config: &CliConfig,
Expand Down
19 changes: 19 additions & 0 deletions cli/src/cluster_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ impl ClusterQuerySubCommands for App<'_, '_> {
}
}

#[allow(clippy::result_large_err)]
pub fn parse_catchup(
matches: &ArgMatches<'_>,
wallet_manager: &mut Option<Rc<RemoteWalletManager>>,
Expand Down Expand Up @@ -542,6 +543,7 @@ pub fn parse_catchup(
}))
}

#[allow(clippy::result_large_err)]
pub fn parse_cluster_ping(
matches: &ArgMatches<'_>,
default_signer: &DefaultSigner,
Expand Down Expand Up @@ -570,13 +572,15 @@ pub fn parse_cluster_ping(
})
}

#[allow(clippy::result_large_err)]
pub fn parse_get_block(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
let slot = value_of(matches, "slot");
Ok(CliCommandInfo::without_signers(CliCommand::GetBlock {
slot,
}))
}

#[allow(clippy::result_large_err)]
pub fn parse_get_recent_prioritization_fees(
matches: &ArgMatches<'_>,
) -> Result<CliCommandInfo, CliError> {
Expand All @@ -590,29 +594,35 @@ pub fn parse_get_recent_prioritization_fees(
))
}

#[allow(clippy::result_large_err)]
pub fn parse_get_block_time(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
let slot = value_of(matches, "slot");
Ok(CliCommandInfo::without_signers(CliCommand::GetBlockTime {
slot,
}))
}

#[allow(clippy::result_large_err)]
pub fn parse_get_epoch(_matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
Ok(CliCommandInfo::without_signers(CliCommand::GetEpoch))
}

#[allow(clippy::result_large_err)]
pub fn parse_get_epoch_info(_matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
Ok(CliCommandInfo::without_signers(CliCommand::GetEpochInfo))
}

#[allow(clippy::result_large_err)]
pub fn parse_get_slot(_matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
Ok(CliCommandInfo::without_signers(CliCommand::GetSlot))
}

#[allow(clippy::result_large_err)]
pub fn parse_get_block_height(_matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
Ok(CliCommandInfo::without_signers(CliCommand::GetBlockHeight))
}

#[allow(clippy::result_large_err)]
pub fn parse_largest_accounts(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
let filter = if matches.is_present("circulating") {
Some(RpcLargestAccountsFilter::Circulating)
Expand All @@ -626,23 +636,27 @@ pub fn parse_largest_accounts(matches: &ArgMatches<'_>) -> Result<CliCommandInfo
))
}

#[allow(clippy::result_large_err)]
pub fn parse_supply(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
let print_accounts = matches.is_present("print_accounts");
Ok(CliCommandInfo::without_signers(CliCommand::Supply {
print_accounts,
}))
}

#[allow(clippy::result_large_err)]
pub fn parse_total_supply(_matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
Ok(CliCommandInfo::without_signers(CliCommand::TotalSupply))
}

#[allow(clippy::result_large_err)]
pub fn parse_get_transaction_count(_matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
Ok(CliCommandInfo::without_signers(
CliCommand::GetTransactionCount,
))
}

#[allow(clippy::result_large_err)]
pub fn parse_show_stakes(
matches: &ArgMatches<'_>,
wallet_manager: &mut Option<Rc<RemoteWalletManager>>,
Expand All @@ -658,6 +672,7 @@ pub fn parse_show_stakes(
}))
}

#[allow(clippy::result_large_err)]
pub fn parse_show_validators(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
let use_lamports_unit = matches.is_present("lamports");
let number_validators = matches.is_present("number");
Expand Down Expand Up @@ -691,6 +706,7 @@ pub fn parse_show_validators(matches: &ArgMatches<'_>) -> Result<CliCommandInfo,
))
}

#[allow(clippy::result_large_err)]
pub fn parse_transaction_history(
matches: &ArgMatches<'_>,
wallet_manager: &mut Option<Rc<RemoteWalletManager>>,
Expand Down Expand Up @@ -972,6 +988,7 @@ pub fn process_first_available_block(rpc_client: &RpcClient) -> ProcessResult {
Ok(format!("{first_available_block}"))
}

#[allow(clippy::result_large_err)]
pub fn parse_leader_schedule(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
let epoch = value_of(matches, "epoch");
Ok(CliCommandInfo::without_signers(
Expand Down Expand Up @@ -1195,6 +1212,7 @@ pub fn process_get_block_height(rpc_client: &RpcClient, _config: &CliConfig) ->
Ok(block_height.to_string())
}

#[allow(clippy::result_large_err)]
pub fn parse_show_block_production(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
let epoch = value_t!(matches, "epoch", Epoch).ok();
let slot_limit = value_t!(matches, "slot_limit", u64).ok();
Expand Down Expand Up @@ -1643,6 +1661,7 @@ pub fn process_ping(
Ok(config.output_format.formatted_string(&cli_ping))
}

#[allow(clippy::result_large_err)]
pub fn parse_logs(
matches: &ArgMatches<'_>,
wallet_manager: &mut Option<Rc<RemoteWalletManager>>,
Expand Down
5 changes: 5 additions & 0 deletions cli/src/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ impl FeatureSubCommands for App<'_, '_> {
}
}

#[allow(clippy::result_large_err)]
fn known_feature(feature: &Pubkey) -> Result<(), CliError> {
if FEATURE_NAMES.contains_key(feature) {
Ok(())
Expand All @@ -522,6 +523,7 @@ fn known_feature(feature: &Pubkey) -> Result<(), CliError> {
}
}

#[allow(clippy::result_large_err)]
pub fn parse_feature_subcommand(
matches: &ArgMatches<'_>,
default_signer: &DefaultSigner,
Expand Down Expand Up @@ -678,6 +680,7 @@ impl ClusterInfoStats {
}
}

#[allow(clippy::result_large_err)]
fn cluster_info_stats(rpc_client: &RpcClient) -> Result<ClusterInfoStats, ClientError> {
#[derive(Default)]
struct StatsEntry {
Expand Down Expand Up @@ -776,6 +779,7 @@ fn cluster_info_stats(rpc_client: &RpcClient) -> Result<ClusterInfoStats, Client
}

// Feature activation is only allowed when 95% of the active stake is on the current feature set
#[allow(clippy::result_large_err)]
fn feature_activation_allowed(
rpc_client: &RpcClient,
quiet: bool,
Expand Down Expand Up @@ -901,6 +905,7 @@ pub fn get_feature_is_active(
.map(|status| matches!(status, Some(CliFeatureStatus::Active(_))))
}

#[allow(clippy::result_large_err)]
pub fn get_feature_activation_epoch(
rpc_client: &RpcClient,
feature_id: &Pubkey,
Expand Down
1 change: 1 addition & 0 deletions cli/src/inflation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ impl InflationSubCommands for App<'_, '_> {
}
}

#[allow(clippy::result_large_err)]
pub fn parse_inflation_subcommand(
matches: &ArgMatches<'_>,
_default_signer: &DefaultSigner,
Expand Down
8 changes: 8 additions & 0 deletions cli/src/nonce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ impl NonceSubCommands for App<'_, '_> {
}
}

#[allow(clippy::result_large_err)]
pub fn parse_authorize_nonce_account(
matches: &ArgMatches<'_>,
default_signer: &DefaultSigner,
Expand Down Expand Up @@ -235,6 +236,7 @@ pub fn parse_authorize_nonce_account(
})
}

#[allow(clippy::result_large_err)]
pub fn parse_nonce_create_account(
matches: &ArgMatches<'_>,
default_signer: &DefaultSigner,
Expand Down Expand Up @@ -268,6 +270,7 @@ pub fn parse_nonce_create_account(
})
}

#[allow(clippy::result_large_err)]
pub fn parse_get_nonce(
matches: &ArgMatches<'_>,
wallet_manager: &mut Option<Rc<RemoteWalletManager>>,
Expand All @@ -280,6 +283,7 @@ pub fn parse_get_nonce(
)))
}

#[allow(clippy::result_large_err)]
pub fn parse_new_nonce(
matches: &ArgMatches<'_>,
default_signer: &DefaultSigner,
Expand Down Expand Up @@ -309,6 +313,7 @@ pub fn parse_new_nonce(
})
}

#[allow(clippy::result_large_err)]
pub fn parse_show_nonce_account(
matches: &ArgMatches<'_>,
wallet_manager: &mut Option<Rc<RemoteWalletManager>>,
Expand All @@ -325,6 +330,7 @@ pub fn parse_show_nonce_account(
))
}

#[allow(clippy::result_large_err)]
pub fn parse_withdraw_from_nonce_account(
matches: &ArgMatches<'_>,
default_signer: &DefaultSigner,
Expand Down Expand Up @@ -359,6 +365,7 @@ pub fn parse_withdraw_from_nonce_account(
})
}

#[allow(clippy::result_large_err)]
pub(crate) fn parse_upgrade_nonce_account(
matches: &ArgMatches<'_>,
) -> Result<CliCommandInfo, CliError> {
Expand All @@ -376,6 +383,7 @@ pub(crate) fn parse_upgrade_nonce_account(
}

/// Check if a nonce account is initialized with the given authority and hash
#[allow(clippy::result_large_err)]
pub fn check_nonce_account(
nonce_account: &Account,
nonce_authority: &Pubkey,
Expand Down
1 change: 1 addition & 0 deletions cli/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ impl ProgramSubCommands for App<'_, '_> {
}
}

#[allow(clippy::result_large_err)]
pub fn parse_program_subcommand(
matches: &ArgMatches<'_>,
default_signer: &DefaultSigner,
Expand Down
1 change: 1 addition & 0 deletions cli/src/program_v4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ impl ProgramV4SubCommands for App<'_, '_> {
}
}

#[allow(clippy::result_large_err)]
pub fn parse_program_v4_subcommand(
matches: &ArgMatches<'_>,
default_signer: &DefaultSigner,
Expand Down
Loading
Loading