From 27299e75ccb5bcefa96a1fb43747bc9e920f797b Mon Sep 17 00:00:00 2001 From: moudyellaz Date: Wed, 1 Apr 2026 21:15:02 +0200 Subject: [PATCH] feat: add self_program_id to ProgramInput and read_nssa_inputs --- nssa/core/src/program.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nssa/core/src/program.rs b/nssa/core/src/program.rs index 673e09b3..7d6a52ea 100644 --- a/nssa/core/src/program.rs +++ b/nssa/core/src/program.rs @@ -16,6 +16,7 @@ pub const MAX_NUMBER_CHAINED_CALLS: usize = 10; pub type ProgramId = [u32; 8]; pub type InstructionData = Vec; pub struct ProgramInput { + pub self_program_id: ProgramId, pub pre_states: Vec, pub instruction: T, } @@ -415,11 +416,13 @@ pub fn compute_authorized_pdas( /// Reads the NSSA inputs from the guest environment. #[must_use] pub fn read_nssa_inputs() -> (ProgramInput, InstructionData) { + let self_program_id: ProgramId = env::read(); let pre_states: Vec = env::read(); let instruction_words: InstructionData = env::read(); let instruction = T::deserialize(&mut Deserializer::new(instruction_words.as_ref())).unwrap(); ( ProgramInput { + self_program_id, pre_states, instruction, },