Deprecate Instruction::new (#15695)

This commit is contained in:
Jack May
2021-03-03 21:46:48 -08:00
committed by GitHub
parent d6ea2f392b
commit b53cb8eb2d
32 changed files with 272 additions and 207 deletions

View File

@ -22,7 +22,7 @@ fn invoker_process_instruction(
let account_info_iter = &mut accounts.iter();
let invoked_program_info = next_account_info(account_info_iter)?;
invoke(
&Instruction::new(*invoked_program_info.key, &[0], vec![]),
&Instruction::new_with_bincode(*invoked_program_info.key, &[0], vec![]),
&[invoked_program_info.clone()],
)?;
msg!("Processing invoker instruction after CPI");
@ -58,7 +58,7 @@ async fn cpi() {
);
let mut test_state = program_test.start_with_context().await;
let instructions = vec![Instruction::new(
let instructions = vec![Instruction::new_with_bincode(
invoker_program_id,
&[0],
vec![AccountMeta::new_readonly(invoked_program_id, false)],

View File

@ -92,7 +92,7 @@ async fn run_fuzz_instructions(
program_id,
);
instructions.push(instruction);
instructions.push(Instruction::new(*program_id, &[0], vec![]));
instructions.push(Instruction::new_with_bincode(*program_id, &[0], vec![]));
signer_keypairs.push(keypair);
}
// Process transaction on test network

View File

@ -58,7 +58,7 @@ async fn clock_sysvar_updated_from_warp() {
let mut context = program_test.start_with_context().await;
let expected_slot = 5_000_000;
let instruction = Instruction::new(
let instruction = Instruction::new_with_bincode(
program_id,
&expected_slot,
vec![AccountMeta::new_readonly(clock::id(), false)],
@ -83,7 +83,7 @@ async fn clock_sysvar_updated_from_warp() {
// Warp to success!
context.warp_to_slot(expected_slot).unwrap();
let instruction = Instruction::new(
let instruction = Instruction::new_with_bincode(
program_id,
&expected_slot,
vec![AccountMeta::new_readonly(clock::id(), false)],