From 9ecf186851f0d82978e16c4a6f2a587b863e6eac Mon Sep 17 00:00:00 2001 From: moudyellaz Date: Wed, 1 Apr 2026 21:16:16 +0200 Subject: [PATCH] refactor: update all guest programs to handle self_program_id field --- program_methods/guest/src/bin/amm.rs | 2 +- program_methods/guest/src/bin/associated_token_account.rs | 2 +- program_methods/guest/src/bin/authenticated_transfer.rs | 2 +- program_methods/guest/src/bin/pinata.rs | 2 +- program_methods/guest/src/bin/pinata_token.rs | 2 +- program_methods/guest/src/bin/token.rs | 2 +- test_program_methods/guest/src/bin/burner.rs | 2 +- test_program_methods/guest/src/bin/chain_caller.rs | 2 +- test_program_methods/guest/src/bin/changer_claimer.rs | 2 +- test_program_methods/guest/src/bin/claimer.rs | 2 +- test_program_methods/guest/src/bin/data_changer.rs | 2 +- .../guest/src/bin/malicious_authorization_changer.rs | 2 +- test_program_methods/guest/src/bin/modified_transfer.rs | 2 +- test_program_methods/guest/src/bin/simple_balance_transfer.rs | 2 +- test_program_methods/guest/src/bin/validity_window.rs | 2 +- .../guest/src/bin/validity_window_chain_caller.rs | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/program_methods/guest/src/bin/amm.rs b/program_methods/guest/src/bin/amm.rs index 3a3e134e..6c5aecd8 100644 --- a/program_methods/guest/src/bin/amm.rs +++ b/program_methods/guest/src/bin/amm.rs @@ -13,7 +13,7 @@ use nssa_core::program::{ProgramInput, ProgramOutput, read_nssa_inputs}; fn main() { let ( - ProgramInput { + ProgramInput { self_program_id: _, pre_states, instruction, }, diff --git a/program_methods/guest/src/bin/associated_token_account.rs b/program_methods/guest/src/bin/associated_token_account.rs index 55d5824b..03838964 100644 --- a/program_methods/guest/src/bin/associated_token_account.rs +++ b/program_methods/guest/src/bin/associated_token_account.rs @@ -3,7 +3,7 @@ use nssa_core::program::{ProgramInput, ProgramOutput, read_nssa_inputs}; fn main() { let ( - ProgramInput { + ProgramInput { self_program_id: _, pre_states, instruction, }, diff --git a/program_methods/guest/src/bin/authenticated_transfer.rs b/program_methods/guest/src/bin/authenticated_transfer.rs index 2fb0ea8b..5961fbcf 100644 --- a/program_methods/guest/src/bin/authenticated_transfer.rs +++ b/program_methods/guest/src/bin/authenticated_transfer.rs @@ -66,7 +66,7 @@ fn transfer( fn main() { // Read input accounts. let ( - ProgramInput { + ProgramInput { self_program_id: _, pre_states, instruction: balance_to_move, }, diff --git a/program_methods/guest/src/bin/pinata.rs b/program_methods/guest/src/bin/pinata.rs index 2f85f069..ec15c635 100644 --- a/program_methods/guest/src/bin/pinata.rs +++ b/program_methods/guest/src/bin/pinata.rs @@ -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, }, diff --git a/program_methods/guest/src/bin/pinata_token.rs b/program_methods/guest/src/bin/pinata_token.rs index 3dee05b7..b3a3d296 100644 --- a/program_methods/guest/src/bin/pinata_token.rs +++ b/program_methods/guest/src/bin/pinata_token.rs @@ -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, }, diff --git a/program_methods/guest/src/bin/token.rs b/program_methods/guest/src/bin/token.rs index 421d43ef..ab7000fe 100644 --- a/program_methods/guest/src/bin/token.rs +++ b/program_methods/guest/src/bin/token.rs @@ -11,7 +11,7 @@ use token_program::core::Instruction; fn main() { let ( - ProgramInput { + ProgramInput { self_program_id: _, pre_states, instruction, }, diff --git a/test_program_methods/guest/src/bin/burner.rs b/test_program_methods/guest/src/bin/burner.rs index 991091c0..80e241cf 100644 --- a/test_program_methods/guest/src/bin/burner.rs +++ b/test_program_methods/guest/src/bin/burner.rs @@ -4,7 +4,7 @@ type Instruction = u128; fn main() { let ( - ProgramInput { + ProgramInput { self_program_id: _, pre_states, instruction: balance_to_burn, }, diff --git a/test_program_methods/guest/src/bin/chain_caller.rs b/test_program_methods/guest/src/bin/chain_caller.rs index c5780665..6e47b7fe 100644 --- a/test_program_methods/guest/src/bin/chain_caller.rs +++ b/test_program_methods/guest/src/bin/chain_caller.rs @@ -12,7 +12,7 @@ type Instruction = (u128, ProgramId, u32, Option); /// program. fn main() { let ( - ProgramInput { + ProgramInput { self_program_id: _, pre_states, instruction: (balance, auth_transfer_id, num_chain_calls, pda_seed), }, diff --git a/test_program_methods/guest/src/bin/changer_claimer.rs b/test_program_methods/guest/src/bin/changer_claimer.rs index ee82ec16..2210c0ab 100644 --- a/test_program_methods/guest/src/bin/changer_claimer.rs +++ b/test_program_methods/guest/src/bin/changer_claimer.rs @@ -5,7 +5,7 @@ type Instruction = (Option>, 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), }, diff --git a/test_program_methods/guest/src/bin/claimer.rs b/test_program_methods/guest/src/bin/claimer.rs index e6239381..67896f21 100644 --- a/test_program_methods/guest/src/bin/claimer.rs +++ b/test_program_methods/guest/src/bin/claimer.rs @@ -4,7 +4,7 @@ type Instruction = (); fn main() { let ( - ProgramInput { + ProgramInput { self_program_id: _, pre_states, instruction: (), }, diff --git a/test_program_methods/guest/src/bin/data_changer.rs b/test_program_methods/guest/src/bin/data_changer.rs index 730a7180..502b2104 100644 --- a/test_program_methods/guest/src/bin/data_changer.rs +++ b/test_program_methods/guest/src/bin/data_changer.rs @@ -5,7 +5,7 @@ type Instruction = Vec; /// 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, }, diff --git a/test_program_methods/guest/src/bin/malicious_authorization_changer.rs b/test_program_methods/guest/src/bin/malicious_authorization_changer.rs index 7452d337..bea4439f 100644 --- a/test_program_methods/guest/src/bin/malicious_authorization_changer.rs +++ b/test_program_methods/guest/src/bin/malicious_authorization_changer.rs @@ -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), }, diff --git a/test_program_methods/guest/src/bin/modified_transfer.rs b/test_program_methods/guest/src/bin/modified_transfer.rs index a89c72fb..ff590a99 100644 --- a/test_program_methods/guest/src/bin/modified_transfer.rs +++ b/test_program_methods/guest/src/bin/modified_transfer.rs @@ -63,7 +63,7 @@ fn transfer( fn main() { // Read input accounts. let ( - ProgramInput { + ProgramInput { self_program_id: _, pre_states, instruction: balance_to_move, }, diff --git a/test_program_methods/guest/src/bin/simple_balance_transfer.rs b/test_program_methods/guest/src/bin/simple_balance_transfer.rs index 9ee715e8..77032107 100644 --- a/test_program_methods/guest/src/bin/simple_balance_transfer.rs +++ b/test_program_methods/guest/src/bin/simple_balance_transfer.rs @@ -4,7 +4,7 @@ type Instruction = u128; fn main() { let ( - ProgramInput { + ProgramInput { self_program_id: _, pre_states, instruction: balance, }, diff --git a/test_program_methods/guest/src/bin/validity_window.rs b/test_program_methods/guest/src/bin/validity_window.rs index a0ff9f36..5d986225 100644 --- a/test_program_methods/guest/src/bin/validity_window.rs +++ b/test_program_methods/guest/src/bin/validity_window.rs @@ -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), }, diff --git a/test_program_methods/guest/src/bin/validity_window_chain_caller.rs b/test_program_methods/guest/src/bin/validity_window_chain_caller.rs index 39f8ad69..dc27f62a 100644 --- a/test_program_methods/guest/src/bin/validity_window_chain_caller.rs +++ b/test_program_methods/guest/src/bin/validity_window_chain_caller.rs @@ -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), },