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

@ -17,7 +17,7 @@ fn process_instruction(
) -> ProgramResult {
if instruction_data.len() == 32 {
let key = Pubkey::new_from_array(instruction_data.try_into().unwrap());
let ix = Instruction::new(key, &[2], vec![]);
let ix = Instruction::new_with_bincode(key, &[2], vec![]);
let mut lamports = accounts[0].lamports();
let owner = &accounts[0].owner;
let mut data = accounts[0].try_borrow_mut_data()?;
@ -36,7 +36,7 @@ fn process_instruction(
} else {
match instruction_data[0] {
1 => {
let ix = Instruction::new(
let ix = Instruction::new_with_bincode(
*program_id,
&accounts[1].key.to_bytes(),
vec![AccountMeta::new_readonly(*program_id, false)],

View File

@ -36,7 +36,7 @@ fn process_instruction(
AccountMeta::new(*target.key, false),
AccountMeta::new(*me.key, false),
];
let ix = Instruction::new(
let ix = Instruction::new_with_bincode(
system_program::id(),
&SystemInstruction::Transfer { lamports: 1 },
account_metas,