Record and store invoked instructions in transaction meta (#12311)
* Record invoked instructions and store in transaction meta * Enable cpi recording if transaction sender is some * Rename invoked to innerInstructions
This commit is contained in:
@ -275,6 +275,7 @@ mod tests {
|
||||
account::Account,
|
||||
entrypoint_native::{ComputeBudget, Logger, ProcessInstruction},
|
||||
instruction::CompiledInstruction,
|
||||
instruction::Instruction,
|
||||
message::Message,
|
||||
rent::Rent,
|
||||
};
|
||||
@ -360,6 +361,7 @@ mod tests {
|
||||
fn get_executor(&mut self, _pubkey: &Pubkey) -> Option<Arc<dyn Executor>> {
|
||||
None
|
||||
}
|
||||
fn record_instruction(&self, _instruction: &Instruction) {}
|
||||
}
|
||||
|
||||
struct TestInstructionMeter {
|
||||
@ -587,6 +589,7 @@ mod tests {
|
||||
max_invoke_depth: 2,
|
||||
},
|
||||
Rc::new(RefCell::new(Executors::default())),
|
||||
None,
|
||||
);
|
||||
assert_eq!(
|
||||
Err(InstructionError::Custom(194969602)),
|
||||
|
@ -1020,6 +1020,7 @@ fn call<'a>(
|
||||
ro_regions,
|
||||
)?;
|
||||
verify_instruction(syscall, &instruction, &signers)?;
|
||||
invoke_context.record_instruction(&instruction);
|
||||
let message = Message::new(&[instruction], None);
|
||||
let callee_program_id_index = message.instructions[0].program_id_index as usize;
|
||||
let callee_program_id = message.account_keys[callee_program_id_index];
|
||||
|
Reference in New Issue
Block a user