refactor: update all guest programs to handle self_program_id field

This commit is contained in:
moudyellaz 2026-04-01 21:16:16 +02:00 committed by Moudy
parent d5cb3e0454
commit 9ecf186851
16 changed files with 16 additions and 16 deletions

View File

@ -13,7 +13,7 @@ use nssa_core::program::{ProgramInput, ProgramOutput, read_nssa_inputs};
fn main() {
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction,
},

View File

@ -3,7 +3,7 @@ use nssa_core::program::{ProgramInput, ProgramOutput, read_nssa_inputs};
fn main() {
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction,
},

View File

@ -66,7 +66,7 @@ fn transfer(
fn main() {
// Read input accounts.
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction: balance_to_move,
},

View File

@ -45,7 +45,7 @@ fn main() {
// Read input accounts.
// It is expected to receive only two accounts: [pinata_account, winner_account]
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction: solution,
},

View File

@ -51,7 +51,7 @@ fn main() {
// It is expected to receive three accounts: [pinata_definition, pinata_token_holding,
// winner_token_holding]
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction: solution,
},

View File

@ -11,7 +11,7 @@ use token_program::core::Instruction;
fn main() {
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction,
},

View File

@ -4,7 +4,7 @@ type Instruction = u128;
fn main() {
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction: balance_to_burn,
},

View File

@ -12,7 +12,7 @@ type Instruction = (u128, ProgramId, u32, Option<PdaSeed>);
/// program.
fn main() {
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction: (balance, auth_transfer_id, num_chain_calls, pda_seed),
},

View File

@ -5,7 +5,7 @@ type Instruction = (Option<Vec<u8>>, bool);
/// A program that optionally modifies the account data and optionally claims it.
fn main() {
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction: (data_opt, should_claim),
},

View File

@ -4,7 +4,7 @@ type Instruction = ();
fn main() {
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction: (),
},

View File

@ -5,7 +5,7 @@ type Instruction = Vec<u8>;
/// A program that modifies the account data by setting bytes sent in instruction.
fn main() {
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction: data,
},

View File

@ -13,7 +13,7 @@ type Instruction = (u128, ProgramId);
/// but sets the `is_authorized` field of the first account to true.
fn main() {
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction: (balance, transfer_program_id),
},

View File

@ -63,7 +63,7 @@ fn transfer(
fn main() {
// Read input accounts.
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction: balance_to_move,
},

View File

@ -4,7 +4,7 @@ type Instruction = u128;
fn main() {
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction: balance,
},

View File

@ -7,7 +7,7 @@ type Instruction = (BlockValidityWindow, TimestampValidityWindow);
fn main() {
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction: (block_validity_window, timestamp_validity_window),
},

View File

@ -15,7 +15,7 @@ type Instruction = (BlockValidityWindow, ProgramId, BlockValidityWindow);
fn main() {
let (
ProgramInput {
ProgramInput { self_program_id: _,
pre_states,
instruction: (block_validity_window, chained_program_id, chained_block_validity_window),
},