mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-04-03 17:53:09 +00:00
refactor: pass self_program_id to ProgramOutput in production guest programs
This commit is contained in:
parent
85cc323649
commit
58b72dd77c
@ -13,8 +13,7 @@ use nssa_core::program::{ProgramInput, ProgramOutput, read_nssa_inputs};
|
||||
|
||||
fn main() {
|
||||
let (
|
||||
ProgramInput {
|
||||
self_program_id: _,
|
||||
ProgramInput { self_program_id,
|
||||
pre_states,
|
||||
instruction,
|
||||
},
|
||||
@ -153,7 +152,7 @@ fn main() {
|
||||
}
|
||||
};
|
||||
|
||||
ProgramOutput::new(instruction_words, pre_states_clone, post_states)
|
||||
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,
|
||||
pre_states,
|
||||
instruction,
|
||||
},
|
||||
@ -57,7 +56,7 @@ fn main() {
|
||||
}
|
||||
};
|
||||
|
||||
ProgramOutput::new(instruction_words, pre_states_clone, post_states)
|
||||
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,
|
||||
pre_states,
|
||||
instruction: balance_to_move,
|
||||
},
|
||||
@ -85,5 +84,5 @@ fn main() {
|
||||
_ => panic!("invalid params"),
|
||||
};
|
||||
|
||||
ProgramOutput::new(instruction_words, pre_states, post_states).write();
|
||||
ProgramOutput::new(self_program_id, instruction_words, pre_states, post_states).write();
|
||||
}
|
||||
|
||||
@ -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,
|
||||
pre_states,
|
||||
instruction: solution,
|
||||
},
|
||||
@ -80,6 +79,7 @@ fn main() {
|
||||
.expect("Overflow when adding prize to winner");
|
||||
|
||||
ProgramOutput::new(
|
||||
self_program_id,
|
||||
instruction_words,
|
||||
vec![pinata, winner],
|
||||
vec![
|
||||
|
||||
@ -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,
|
||||
pre_states,
|
||||
instruction: solution,
|
||||
},
|
||||
@ -98,6 +97,7 @@ fn main() {
|
||||
.with_pda_seeds(vec![PdaSeed::new([0; 32])]);
|
||||
|
||||
ProgramOutput::new(
|
||||
self_program_id,
|
||||
instruction_words,
|
||||
vec![
|
||||
pinata_definition,
|
||||
|
||||
@ -11,8 +11,7 @@ use token_program::core::Instruction;
|
||||
|
||||
fn main() {
|
||||
let (
|
||||
ProgramInput {
|
||||
self_program_id: _,
|
||||
ProgramInput { self_program_id,
|
||||
pre_states,
|
||||
instruction,
|
||||
},
|
||||
@ -82,5 +81,5 @@ fn main() {
|
||||
}
|
||||
};
|
||||
|
||||
ProgramOutput::new(instruction_words, pre_states_clone, post_states).write();
|
||||
ProgramOutput::new(self_program_id, instruction_words, pre_states_clone, post_states).write();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user