Skip to content

Commit

Permalink
instruction_accounts => instructions_account
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Dec 20, 2021
1 parent 559ebc8 commit ed51cb5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions programs/bpf/rust/instruction_introspection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ fn process_instruction(
}

let secp_instruction_index = instruction_data[0];
let instruction_accounts = accounts.last().ok_or(ProgramError::NotEnoughAccountKeys)?;
assert_eq!(*instruction_accounts.key, instructions::id());
let data_len = instruction_accounts.try_borrow_data()?.len();
let instructions_account = accounts.last().ok_or(ProgramError::NotEnoughAccountKeys)?;
assert_eq!(*instructions_account.key, instructions::id());
let data_len = instructions_account.try_borrow_data()?.len();
if data_len < 2 {
return Err(ProgramError::InvalidAccountData);
}

let instruction = instructions::load_instruction_at_checked(
secp_instruction_index as usize,
instruction_accounts,
instructions_account,
)?;

let current_instruction = instructions::load_current_index_checked(instruction_accounts)?;
let current_instruction = instructions::load_current_index_checked(instructions_account)?;
let my_index = instruction_data[1] as u16;
assert_eq!(current_instruction, my_index);

Expand Down

0 comments on commit ed51cb5

Please sign in to comment.