Prevent proof program from being invoked as an inner instruction

This commit is contained in:
Michael Vines 2021-10-04 17:32:10 -07:00
parent af80203522
commit 62b6eafd7c
1 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,11 @@ pub fn process_instruction(
input: &[u8],
invoke_context: &mut dyn InvokeContext,
) -> Result<(), InstructionError> {
if invoke_context.invoke_depth() != 1 {
// Not supported as an inner instruction
return Err(InstructionError::UnsupportedProgramId);
}
match ProofInstruction::decode_type(program_id, input)
.ok_or(InstructionError::InvalidInstructionData)?
{