docs: update sysvar docs for load_instruction_at_checked (#22925) (#23673)

* docs: update sysvar docs for load_instruction_at_checked

Update the instruction introspection docs to use the updated load_instruction_at_checked function instead of deprecated load_instruction_at

* Update to load_current_index_checked

(cherry picked from commit 64e2d9dc47)

Co-authored-by: Zayyan Faizal <zayyanf@gmail.com>
This commit is contained in:
mergify[bot]
2022-03-15 12:51:15 +00:00
committed by GitHub
parent 8b0576d954
commit b0543a1ae6

View File

@ -16,8 +16,8 @@ and received the Message's instruction data inside, and also the index of the cu
Two helper functions to extract this data can be used:
```
fn load_current_index(instruction_data: &[u8]) -> u16;
fn load_instruction_at(instruction_index: usize, instruction_data: &[u8]) -> Result<Instruction>;
fn load_current_index_checked(instruction_data: &[u8]) -> u16;
fn load_instruction_at_checked(instruction_index: usize, instruction_sysvar_account_info: &AccountInfo) -> Result<Instruction>;
```
The runtime will recognize this special instruction, serialize the Message instruction data