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

@@ -972,7 +972,7 @@ pub fn process_create_stake_account(
) -> ProcessResult {
let stake_account = config.signers[stake_account];
let stake_account_address = if let Some(seed) = seed {
Pubkey::create_with_seed(&stake_account.pubkey(), &seed, &stake::program::id())?
Pubkey::create_with_seed(&stake_account.pubkey(), seed, &stake::program::id())?
} else {
stake_account.pubkey()
};
@@ -1085,7 +1085,7 @@ pub fn process_create_stake_account(
} else {
tx.try_sign(&config.signers, recent_blockhash)?;
let result = rpc_client.send_and_confirm_transaction_with_spinner(&tx);
log_instruction_custom_error::<SystemError>(result, &config)
log_instruction_custom_error::<SystemError>(result, config)
}
}
@@ -1172,7 +1172,7 @@ pub fn process_stake_authorize(
} else {
rpc_client.send_and_confirm_transaction_with_spinner(&tx)
};
log_instruction_custom_error::<StakeError>(result, &config)
log_instruction_custom_error::<StakeError>(result, config)
}
}
@@ -1196,7 +1196,7 @@ pub fn process_deactivate_stake_account(
let stake_authority = config.signers[stake_authority];
let stake_account_address = if let Some(seed) = seed {
Pubkey::create_with_seed(&stake_account_pubkey, seed, &stake::program::id())?
Pubkey::create_with_seed(stake_account_pubkey, seed, &stake::program::id())?
} else {
*stake_account_pubkey
};
@@ -1248,7 +1248,7 @@ pub fn process_deactivate_stake_account(
config.commitment,
)?;
let result = rpc_client.send_and_confirm_transaction_with_spinner(&tx);
log_instruction_custom_error::<StakeError>(result, &config)
log_instruction_custom_error::<StakeError>(result, config)
}
}
@@ -1274,7 +1274,7 @@ pub fn process_withdraw_stake(
let custodian = custodian.map(|index| config.signers[index]);
let stake_account_address = if let Some(seed) = seed {
Pubkey::create_with_seed(&stake_account_pubkey, seed, &stake::program::id())?
Pubkey::create_with_seed(stake_account_pubkey, seed, &stake::program::id())?
} else {
*stake_account_pubkey
};
@@ -1347,7 +1347,7 @@ pub fn process_withdraw_stake(
config.commitment,
)?;
let result = rpc_client.send_and_confirm_transaction_with_spinner(&tx);
log_instruction_custom_error::<SystemError>(result, &config)
log_instruction_custom_error::<SystemError>(result, config)
}
}
@@ -1382,10 +1382,10 @@ pub fn process_split_stake(
}
check_unique_pubkeys(
(&fee_payer.pubkey(), "fee-payer keypair".to_string()),
(&stake_account_pubkey, "stake_account".to_string()),
(stake_account_pubkey, "stake_account".to_string()),
)?;
check_unique_pubkeys(
(&stake_account_pubkey, "stake_account".to_string()),
(stake_account_pubkey, "stake_account".to_string()),
(
&split_stake_account.pubkey(),
"split_stake_account".to_string(),
@@ -1395,7 +1395,7 @@ pub fn process_split_stake(
let stake_authority = config.signers[stake_authority];
let split_stake_account_address = if let Some(seed) = split_stake_account_seed {
Pubkey::create_with_seed(&split_stake_account.pubkey(), &seed, &stake::program::id())?
Pubkey::create_with_seed(&split_stake_account.pubkey(), seed, &stake::program::id())?
} else {
split_stake_account.pubkey()
};
@@ -1433,7 +1433,7 @@ pub fn process_split_stake(
let ixs = if let Some(seed) = split_stake_account_seed {
stake_instruction::split_with_seed(
&stake_account_pubkey,
stake_account_pubkey,
&stake_authority.pubkey(),
lamports,
&split_stake_account_address,
@@ -1443,7 +1443,7 @@ pub fn process_split_stake(
.with_memo(memo)
} else {
stake_instruction::split(
&stake_account_pubkey,
stake_account_pubkey,
&stake_authority.pubkey(),
lamports,
&split_stake_account_address,
@@ -1492,7 +1492,7 @@ pub fn process_split_stake(
config.commitment,
)?;
let result = rpc_client.send_and_confirm_transaction_with_spinner(&tx);
log_instruction_custom_error::<StakeError>(result, &config)
log_instruction_custom_error::<StakeError>(result, config)
}
}
@@ -1515,19 +1515,19 @@ pub fn process_merge_stake(
check_unique_pubkeys(
(&fee_payer.pubkey(), "fee-payer keypair".to_string()),
(&stake_account_pubkey, "stake_account".to_string()),
(stake_account_pubkey, "stake_account".to_string()),
)?;
check_unique_pubkeys(
(&fee_payer.pubkey(), "fee-payer keypair".to_string()),
(
&source_stake_account_pubkey,
source_stake_account_pubkey,
"source_stake_account".to_string(),
),
)?;
check_unique_pubkeys(
(&stake_account_pubkey, "stake_account".to_string()),
(stake_account_pubkey, "stake_account".to_string()),
(
&source_stake_account_pubkey,
source_stake_account_pubkey,
"source_stake_account".to_string(),
),
)?;
@@ -1552,8 +1552,8 @@ pub fn process_merge_stake(
blockhash_query.get_blockhash_and_fee_calculator(rpc_client, config.commitment)?;
let ixs = stake_instruction::merge(
&stake_account_pubkey,
&source_stake_account_pubkey,
stake_account_pubkey,
source_stake_account_pubkey,
&stake_authority.pubkey(),
)
.with_memo(memo);
@@ -1603,7 +1603,7 @@ pub fn process_merge_stake(
config.commitment,
config.send_transaction_config,
);
log_instruction_custom_error::<StakeError>(result, &config)
log_instruction_custom_error::<StakeError>(result, config)
}
}
@@ -1674,7 +1674,7 @@ pub fn process_stake_set_lockup(
config.commitment,
)?;
let result = rpc_client.send_and_confirm_transaction_with_spinner(&tx);
log_instruction_custom_error::<StakeError>(result, &config)
log_instruction_custom_error::<StakeError>(result, config)
}
}
@@ -2076,7 +2076,7 @@ pub fn process_delegate_stake(
config.commitment,
)?;
let result = rpc_client.send_and_confirm_transaction_with_spinner(&tx);
log_instruction_custom_error::<StakeError>(result, &config)
log_instruction_custom_error::<StakeError>(result, config)
}
}