Instruction sysvar fixes, additions (#20958)

This commit is contained in:
Jack May
2021-10-26 13:07:40 -07:00
committed by GitHub
parent 261dd96ae3
commit 4fe3354c8f
4 changed files with 228 additions and 25 deletions

View File

@ -36,11 +36,9 @@ fn process_instruction(
let instruction = instructions::load_instruction_at_checked(
secp_instruction_index as usize,
instruction_accounts,
)
.map_err(|_| ProgramError::InvalidAccountData)?;
)?;
let current_instruction =
instructions::load_current_index(&instruction_accounts.try_borrow_data()?);
let current_instruction = instructions::load_current_index_checked(instruction_accounts)?;
let my_index = instruction_data[1] as u16;
assert_eq!(current_instruction, my_index);