pub fn get_processed_instruction(index: u64) -> Option<ProcessedInstruction>Expand description
Retrieve a previously processed sibling instruction from the current transaction.
index is 0-based: 0 = most recently processed instruction before
the current one, 1 = the one before that, etc.
Returns None if no instruction exists at that index.
ยงUse case: Ed25519 signature verification
To verify an Ed25519 signature on-chain:
- The transaction includes an instruction to the Ed25519 precompile with the message, signature, and public key.
- Your program calls
get_processed_instruction(0)to read that instruction. - Verify the program_id is the Ed25519 precompile address.
- Parse the instruction data to extract the verified message.