mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-11 17:53:12 +00:00
add chained_call field to program output
This commit is contained in:
parent
97eb110f0e
commit
6d9d6b3d28
@ -12,11 +12,20 @@ pub struct ProgramInput<T> {
|
||||
pub instruction: T,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
#[cfg_attr(any(feature = "host", test), derive(Debug, PartialEq, Eq))]
|
||||
pub struct ChainedCall {
|
||||
pub program_id: ProgramId,
|
||||
pub instruction_data: InstructionData,
|
||||
pub account_indices: Vec<usize>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
#[cfg_attr(any(feature = "host", test), derive(Debug, PartialEq, Eq))]
|
||||
pub struct ProgramOutput {
|
||||
pub pre_states: Vec<AccountWithMetadata>,
|
||||
pub post_states: Vec<Account>,
|
||||
pub chained_call: Option<ChainedCall>
|
||||
}
|
||||
|
||||
pub fn read_nssa_inputs<T: DeserializeOwned>() -> ProgramInput<T> {
|
||||
@ -33,6 +42,7 @@ pub fn write_nssa_outputs(pre_states: Vec<AccountWithMetadata>, post_states: Vec
|
||||
let output = ProgramOutput {
|
||||
pre_states,
|
||||
post_states,
|
||||
chained_call: None
|
||||
};
|
||||
env::commit(&output);
|
||||
}
|
||||
|
||||
@ -27,6 +27,7 @@ fn main() {
|
||||
let ProgramOutput {
|
||||
pre_states,
|
||||
post_states,
|
||||
chained_call: _,
|
||||
} = program_output;
|
||||
|
||||
// Check that there are no repeated account ids
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user