Fix Nightly Clippy Warnings (backport #18065) (#18070)

* chore: cargo +nightly clippy --fix -Z unstable-options

(cherry picked from commit 6514096a67)

# Conflicts:
#	core/src/banking_stage.rs
#	core/src/cost_model.rs
#	core/src/cost_tracker.rs
#	core/src/execute_cost_table.rs
#	core/src/replay_stage.rs
#	core/src/tvu.rs
#	ledger-tool/src/main.rs
#	programs/bpf_loader/build.rs
#	rbpf-cli/src/main.rs
#	sdk/cargo-build-bpf/src/main.rs
#	sdk/cargo-test-bpf/src/main.rs
#	sdk/src/secp256k1_instruction.rs

* chore: cargo fmt

(cherry picked from commit 789f33e8db)

* Updates BPF program assert_instruction_count tests.

(cherry picked from commit c1e03f3410)

# Conflicts:
#	programs/bpf/tests/programs.rs

* Resolve conflicts

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
mergify[bot]
2021-06-18 20:02:48 +00:00
committed by GitHub
parent c330016109
commit 0e7512a225
173 changed files with 1250 additions and 1056 deletions

View File

@@ -1000,7 +1000,7 @@ fn process_airdrop(
let result = request_and_confirm_airdrop(rpc_client, config, &pubkey, lamports);
if let Ok(signature) = result {
let signature_cli_message = log_instruction_custom_error::<SystemError>(result, &config)?;
let signature_cli_message = log_instruction_custom_error::<SystemError>(result, config)?;
println!("{}", signature_cli_message);
let current_balance = rpc_client.get_balance(&pubkey)?;
@@ -1013,7 +1013,7 @@ fn process_airdrop(
Ok(build_balance_message(current_balance, false, true))
}
} else {
log_instruction_custom_error::<SystemError>(result, &config)
log_instruction_custom_error::<SystemError>(result, config)
}
}
@@ -1098,7 +1098,7 @@ fn process_confirm(
#[allow(clippy::unnecessary_wraps)]
fn process_decode_transaction(config: &CliConfig, transaction: &Transaction) -> ProcessResult {
let sigverify_status = CliSignatureVerificationStatus::verify_transaction(&transaction);
let sigverify_status = CliSignatureVerificationStatus::verify_transaction(transaction);
let decode_transaction = CliTransaction {
decoded_transaction: transaction.clone(),
transaction: EncodedTransaction::encode(transaction.clone(), UiTransactionEncoding::Json),
@@ -1269,7 +1269,7 @@ fn process_transfer(
} else {
rpc_client.send_and_confirm_transaction_with_spinner(&tx)
};
log_instruction_custom_error::<SystemError>(result, &config)
log_instruction_custom_error::<SystemError>(result, config)
}
}
@@ -1324,7 +1324,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
from_pubkey,
seed,
program_id,
} => process_create_address_with_seed(config, from_pubkey.as_ref(), &seed, &program_id),
} => process_create_address_with_seed(config, from_pubkey.as_ref(), seed, program_id),
CliCommand::Fees { ref blockhash } => process_fees(&rpc_client, config, blockhash.as_ref()),
CliCommand::Feature(feature_subcommand) => {
process_feature_subcommand(&rpc_client, config, feature_subcommand)
@@ -1347,8 +1347,8 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
CliCommand::LeaderSchedule { epoch } => {
process_leader_schedule(&rpc_client, config, *epoch)
}
CliCommand::LiveSlots => process_live_slots(&config),
CliCommand::Logs { filter } => process_logs(&config, filter),
CliCommand::LiveSlots => process_live_slots(config),
CliCommand::Logs { filter } => process_logs(config, filter),
CliCommand::Ping {
lamports,
interval,
@@ -1453,7 +1453,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
),
// Get the current nonce
CliCommand::GetNonce(nonce_account_pubkey) => {
process_get_nonce(&rpc_client, config, &nonce_account_pubkey)
process_get_nonce(&rpc_client, config, nonce_account_pubkey)
}
// Get a new nonce
CliCommand::NewNonce {
@@ -1474,7 +1474,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_show_nonce_account(
&rpc_client,
config,
&nonce_account_pubkey,
nonce_account_pubkey,
*use_lamports_unit,
),
// Withdraw lamports from a nonce account
@@ -1487,10 +1487,10 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_withdraw_from_nonce_account(
&rpc_client,
config,
&nonce_account,
nonce_account,
*nonce_authority,
memo.as_ref(),
&destination_account_pubkey,
destination_account_pubkey,
*lamports,
),
@@ -1564,7 +1564,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_deactivate_stake_account(
&rpc_client,
config,
&stake_account_pubkey,
stake_account_pubkey,
*stake_authority,
*sign_only,
*dump_transaction_message,
@@ -1590,8 +1590,8 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_delegate_stake(
&rpc_client,
config,
&stake_account_pubkey,
&vote_account_pubkey,
stake_account_pubkey,
vote_account_pubkey,
*stake_authority,
*force,
*sign_only,
@@ -1618,7 +1618,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_split_stake(
&rpc_client,
config,
&stake_account_pubkey,
stake_account_pubkey,
*stake_authority,
*sign_only,
*dump_transaction_message,
@@ -1645,8 +1645,8 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_merge_stake(
&rpc_client,
config,
&stake_account_pubkey,
&source_stake_account_pubkey,
stake_account_pubkey,
source_stake_account_pubkey,
*stake_authority,
*sign_only,
*dump_transaction_message,
@@ -1663,7 +1663,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_show_stake_account(
&rpc_client,
config,
&stake_account_pubkey,
stake_account_pubkey,
*use_lamports_unit,
*with_rewards,
),
@@ -1686,7 +1686,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_stake_authorize(
&rpc_client,
config,
&stake_account_pubkey,
stake_account_pubkey,
new_authorizations,
*custodian,
*sign_only,
@@ -1712,7 +1712,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_stake_set_lockup(
&rpc_client,
config,
&stake_account_pubkey,
stake_account_pubkey,
&mut lockup,
*custodian,
*sign_only,
@@ -1740,8 +1740,8 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_withdraw_stake(
&rpc_client,
config,
&stake_account_pubkey,
&destination_account_pubkey,
stake_account_pubkey,
destination_account_pubkey,
*amount,
*withdraw_authority,
*custodian,
@@ -1769,7 +1769,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_set_validator_info(
&rpc_client,
config,
&validator_info,
validator_info,
*force_keybase,
*info_pubkey,
),
@@ -1803,7 +1803,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_show_vote_account(
&rpc_client,
config,
&vote_account_pubkey,
vote_account_pubkey,
*use_lamports_unit,
*with_rewards,
),
@@ -1830,8 +1830,8 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_vote_authorize(
&rpc_client,
config,
&vote_account_pubkey,
&new_authorized_pubkey,
vote_account_pubkey,
new_authorized_pubkey,
*vote_authorize,
memo.as_ref(),
),
@@ -1843,7 +1843,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_vote_update_validator(
&rpc_client,
config,
&vote_account_pubkey,
vote_account_pubkey,
*new_identity_account,
*withdraw_authority,
memo.as_ref(),
@@ -1856,7 +1856,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
} => process_vote_update_commission(
&rpc_client,
config,
&vote_account_pubkey,
vote_account_pubkey,
*commission,
*withdraw_authority,
memo.as_ref(),
@@ -1872,7 +1872,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
CliCommand::Balance {
pubkey,
use_lamports_unit,
} => process_balance(&rpc_client, config, &pubkey, *use_lamports_unit),
} => process_balance(&rpc_client, config, pubkey, *use_lamports_unit),
// Confirm the last client transaction by signature
CliCommand::Confirm(signature) => process_confirm(&rpc_client, config, signature),
CliCommand::DecodeTransaction(transaction) => {
@@ -1889,13 +1889,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
pubkey,
output_file,
use_lamports_unit,
} => process_show_account(
&rpc_client,
config,
&pubkey,
&output_file,
*use_lamports_unit,
),
} => process_show_account(&rpc_client, config, pubkey, output_file, *use_lamports_unit),
CliCommand::Transfer {
amount,
to,