diff --git a/examples/program_deployment/methods/guest/src/bin/hello_world.rs b/examples/program_deployment/methods/guest/src/bin/hello_world.rs index 810e83f3..bf1bbe14 100644 --- a/examples/program_deployment/methods/guest/src/bin/hello_world.rs +++ b/examples/program_deployment/methods/guest/src/bin/hello_world.rs @@ -19,6 +19,7 @@ fn main() { // Read inputs let ( ProgramInput { + self_program_id: _, pre_states, instruction: greeting, }, diff --git a/examples/program_deployment/methods/guest/src/bin/hello_world_with_authorization.rs b/examples/program_deployment/methods/guest/src/bin/hello_world_with_authorization.rs index 62908870..15e658c4 100644 --- a/examples/program_deployment/methods/guest/src/bin/hello_world_with_authorization.rs +++ b/examples/program_deployment/methods/guest/src/bin/hello_world_with_authorization.rs @@ -19,6 +19,7 @@ fn main() { // Read inputs let ( ProgramInput { + self_program_id: _, pre_states, instruction: greeting, }, diff --git a/examples/program_deployment/methods/guest/src/bin/hello_world_with_move_function.rs b/examples/program_deployment/methods/guest/src/bin/hello_world_with_move_function.rs index 7e29b5de..f9cddc35 100644 --- a/examples/program_deployment/methods/guest/src/bin/hello_world_with_move_function.rs +++ b/examples/program_deployment/methods/guest/src/bin/hello_world_with_move_function.rs @@ -66,6 +66,7 @@ fn main() { // Read input accounts. let ( ProgramInput { + self_program_id: _, pre_states, instruction: (function_id, data), }, diff --git a/examples/program_deployment/methods/guest/src/bin/simple_tail_call.rs b/examples/program_deployment/methods/guest/src/bin/simple_tail_call.rs index d2c04083..18ff8e9c 100644 --- a/examples/program_deployment/methods/guest/src/bin/simple_tail_call.rs +++ b/examples/program_deployment/methods/guest/src/bin/simple_tail_call.rs @@ -27,6 +27,7 @@ fn main() { // Read inputs let ( ProgramInput { + self_program_id: _, pre_states, instruction: (), }, diff --git a/examples/program_deployment/methods/guest/src/bin/tail_call_with_pda.rs b/examples/program_deployment/methods/guest/src/bin/tail_call_with_pda.rs index 564efc2b..8f4e3941 100644 --- a/examples/program_deployment/methods/guest/src/bin/tail_call_with_pda.rs +++ b/examples/program_deployment/methods/guest/src/bin/tail_call_with_pda.rs @@ -33,6 +33,7 @@ fn main() { // Read inputs let ( ProgramInput { + self_program_id: _, pre_states, instruction: (), }, diff --git a/nssa/src/program.rs b/nssa/src/program.rs index 3187c295..5ff19fbc 100644 --- a/nssa/src/program.rs +++ b/nssa/src/program.rs @@ -88,7 +88,10 @@ impl Program { .map_err(|e| NssaError::ProgramWriteInputFailed(e.to_string()))?; let pre_states = pre_states.to_vec(); env_builder - .write(&(pre_states, instruction_data)) + .write(&pre_states) + .map_err(|e| NssaError::ProgramWriteInputFailed(e.to_string()))?; + env_builder + .write(&instruction_data) .map_err(|e| NssaError::ProgramWriteInputFailed(e.to_string()))?; Ok(()) } diff --git a/program_methods/guest/src/bin/amm.rs b/program_methods/guest/src/bin/amm.rs index 6c5aecd8..c11c8d8e 100644 --- a/program_methods/guest/src/bin/amm.rs +++ b/program_methods/guest/src/bin/amm.rs @@ -13,7 +13,8 @@ use nssa_core::program::{ProgramInput, ProgramOutput, read_nssa_inputs}; fn main() { let ( - ProgramInput { self_program_id: _, + 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 03838964..765e0b7e 100644 --- a/program_methods/guest/src/bin/associated_token_account.rs +++ b/program_methods/guest/src/bin/associated_token_account.rs @@ -3,7 +3,8 @@ use nssa_core::program::{ProgramInput, ProgramOutput, read_nssa_inputs}; fn main() { let ( - ProgramInput { self_program_id: _, + 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 5961fbcf..a44b968f 100644 --- a/program_methods/guest/src/bin/authenticated_transfer.rs +++ b/program_methods/guest/src/bin/authenticated_transfer.rs @@ -66,7 +66,8 @@ fn transfer( fn main() { // Read input accounts. let ( - ProgramInput { self_program_id: _, + 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 ec15c635..fdd0cc42 100644 --- a/program_methods/guest/src/bin/pinata.rs +++ b/program_methods/guest/src/bin/pinata.rs @@ -45,7 +45,8 @@ 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: _, 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 b3a3d296..24ae558c 100644 --- a/program_methods/guest/src/bin/pinata_token.rs +++ b/program_methods/guest/src/bin/pinata_token.rs @@ -51,7 +51,8 @@ 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: _, pre_states, instruction: solution, }, diff --git a/program_methods/guest/src/bin/token.rs b/program_methods/guest/src/bin/token.rs index ab7000fe..389c3721 100644 --- a/program_methods/guest/src/bin/token.rs +++ b/program_methods/guest/src/bin/token.rs @@ -11,7 +11,8 @@ use token_program::core::Instruction; fn main() { let ( - ProgramInput { self_program_id: _, + 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 80e241cf..d5cbc4e5 100644 --- a/test_program_methods/guest/src/bin/burner.rs +++ b/test_program_methods/guest/src/bin/burner.rs @@ -4,7 +4,8 @@ type Instruction = u128; fn main() { let ( - ProgramInput { self_program_id: _, + 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 6e47b7fe..c619d5e1 100644 --- a/test_program_methods/guest/src/bin/chain_caller.rs +++ b/test_program_methods/guest/src/bin/chain_caller.rs @@ -12,7 +12,8 @@ type Instruction = (u128, ProgramId, u32, Option); /// program. fn main() { let ( - ProgramInput { self_program_id: _, + 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 2210c0ab..53435db0 100644 --- a/test_program_methods/guest/src/bin/changer_claimer.rs +++ b/test_program_methods/guest/src/bin/changer_claimer.rs @@ -5,7 +5,8 @@ type Instruction = (Option>, bool); /// A program that optionally modifies the account data and optionally claims it. fn main() { let ( - ProgramInput { self_program_id: _, + 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 67896f21..c9d391ff 100644 --- a/test_program_methods/guest/src/bin/claimer.rs +++ b/test_program_methods/guest/src/bin/claimer.rs @@ -4,7 +4,8 @@ type Instruction = (); fn main() { let ( - ProgramInput { self_program_id: _, + 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 502b2104..4680376f 100644 --- a/test_program_methods/guest/src/bin/data_changer.rs +++ b/test_program_methods/guest/src/bin/data_changer.rs @@ -5,7 +5,8 @@ type Instruction = Vec; /// A program that modifies the account data by setting bytes sent in instruction. fn main() { let ( - ProgramInput { self_program_id: _, + 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 bea4439f..a177cbe0 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,8 @@ type Instruction = (u128, ProgramId); /// but sets the `is_authorized` field of the first account to true. fn main() { let ( - ProgramInput { self_program_id: _, + 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 ff590a99..969e139e 100644 --- a/test_program_methods/guest/src/bin/modified_transfer.rs +++ b/test_program_methods/guest/src/bin/modified_transfer.rs @@ -63,7 +63,8 @@ fn transfer( fn main() { // Read input accounts. let ( - ProgramInput { self_program_id: _, + 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 77032107..b0a33764 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,8 @@ type Instruction = u128; fn main() { let ( - ProgramInput { self_program_id: _, + 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 5d986225..864ba24b 100644 --- a/test_program_methods/guest/src/bin/validity_window.rs +++ b/test_program_methods/guest/src/bin/validity_window.rs @@ -7,7 +7,8 @@ type Instruction = (BlockValidityWindow, TimestampValidityWindow); fn main() { let ( - ProgramInput { self_program_id: _, + 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 dc27f62a..acc11d17 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,8 @@ type Instruction = (BlockValidityWindow, ProgramId, BlockValidityWindow); fn main() { let ( - ProgramInput { self_program_id: _, + ProgramInput { + self_program_id: _, pre_states, instruction: (block_validity_window, chained_program_id, chained_block_validity_window), },