Deprecate Instruction::new (#15695)
This commit is contained in:
@ -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)],
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user