feat: add caller_program_id to ProgramInput

This commit is contained in:
moudyellaz
2026-04-03 00:58:11 +02:00
committed by Moudy
parent d105a51c04
commit 087baebcca
31 changed files with 60 additions and 163 deletions
+4 -10
View File
@@ -13,8 +13,7 @@ use nssa_core::program::{ProgramInput, ProgramOutput, read_nssa_inputs};
fn main() {
let (
ProgramInput {
self_program_id,
ProgramInput { self_program_id, caller_program_id: _,
pre_states,
instruction,
},
@@ -153,12 +152,7 @@ fn main() {
}
};
ProgramOutput::new(
self_program_id,
instruction_words,
pre_states_clone,
post_states,
)
.with_chained_calls(chained_calls)
.write();
ProgramOutput::new(self_program_id, instruction_words, pre_states_clone, post_states)
.with_chained_calls(chained_calls)
.write();
}
@@ -3,8 +3,7 @@ use nssa_core::program::{ProgramInput, ProgramOutput, read_nssa_inputs};
fn main() {
let (
ProgramInput {
self_program_id,
ProgramInput { self_program_id, caller_program_id: _,
pre_states,
instruction,
},
@@ -57,12 +56,7 @@ fn main() {
}
};
ProgramOutput::new(
self_program_id,
instruction_words,
pre_states_clone,
post_states,
)
.with_chained_calls(chained_calls)
.write();
ProgramOutput::new(self_program_id, instruction_words, pre_states_clone, post_states)
.with_chained_calls(chained_calls)
.write();
}
@@ -66,8 +66,7 @@ fn transfer(
fn main() {
// Read input accounts.
let (
ProgramInput {
self_program_id,
ProgramInput { self_program_id, caller_program_id: _,
pre_states,
instruction: balance_to_move,
},
+1 -2
View File
@@ -45,8 +45,7 @@ fn main() {
// Read input accounts.
// It is expected to receive only two accounts: [pinata_account, winner_account]
let (
ProgramInput {
self_program_id,
ProgramInput { self_program_id, caller_program_id: _,
pre_states,
instruction: solution,
},
@@ -51,8 +51,7 @@ fn main() {
// It is expected to receive three accounts: [pinata_definition, pinata_token_holding,
// winner_token_holding]
let (
ProgramInput {
self_program_id,
ProgramInput { self_program_id, caller_program_id: _,
pre_states,
instruction: solution,
},
+2 -9
View File
@@ -11,8 +11,7 @@ use token_program::core::Instruction;
fn main() {
let (
ProgramInput {
self_program_id,
ProgramInput { self_program_id, caller_program_id: _,
pre_states,
instruction,
},
@@ -82,11 +81,5 @@ fn main() {
}
};
ProgramOutput::new(
self_program_id,
instruction_words,
pre_states_clone,
post_states,
)
.write();
ProgramOutput::new(self_program_id, instruction_words, pre_states_clone, post_states).write();
}