Cleanup use (#16327)

This commit is contained in:
Jack May
2021-04-02 08:54:09 -07:00
committed by GitHub
parent 9784bbb802
commit dee655df35
8 changed files with 46 additions and 79 deletions

View File

@ -1,11 +1,11 @@
use {
solana_banks_client::BanksClient,
solana_program::{
account_info::AccountInfo, entrypoint::ProgramResult, hash::Hash, instruction::Instruction,
msg, pubkey::Pubkey, rent::Rent, system_instruction,
},
solana_program_test::{processor, ProgramTest},
solana_sdk::{signature::Keypair, signature::Signer, transaction::Transaction},
solana_sdk::{
account_info::AccountInfo, entrypoint::ProgramResult, hash::Hash, instruction::Instruction,
msg, pubkey::Pubkey, rent::Rent, signature::Keypair, signature::Signer, system_instruction,
transaction::Transaction,
},
};
#[allow(clippy::unnecessary_wraps)]
@ -57,16 +57,16 @@ fn simulate_fuzz_with_context() {
processor!(process_instruction),
);
let mut test_state = rt.block_on(async { program_test.start_with_context().await });
let mut context = rt.block_on(async { program_test.start_with_context().await });
// the honggfuzz `fuzz!` macro does not allow for async closures,
// so we have to use the runtime directly to run async functions
rt.block_on(async {
run_fuzz_instructions(
&[1, 2, 3, 4, 5],
&mut test_state.banks_client,
&test_state.payer,
test_state.last_blockhash,
&mut context.banks_client,
&context.payer,
context.last_blockhash,
&program_id,
)
.await