mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-04-04 02:03:14 +00:00
fix: serialize write_inputs fields separately to match guest deserialization
This commit is contained in:
parent
9ecf186851
commit
59d3d38448
@ -19,6 +19,7 @@ fn main() {
|
||||
// Read inputs
|
||||
let (
|
||||
ProgramInput {
|
||||
self_program_id: _,
|
||||
pre_states,
|
||||
instruction: greeting,
|
||||
},
|
||||
|
||||
@ -19,6 +19,7 @@ fn main() {
|
||||
// Read inputs
|
||||
let (
|
||||
ProgramInput {
|
||||
self_program_id: _,
|
||||
pre_states,
|
||||
instruction: greeting,
|
||||
},
|
||||
|
||||
@ -66,6 +66,7 @@ fn main() {
|
||||
// Read input accounts.
|
||||
let (
|
||||
ProgramInput {
|
||||
self_program_id: _,
|
||||
pre_states,
|
||||
instruction: (function_id, data),
|
||||
},
|
||||
|
||||
@ -27,6 +27,7 @@ fn main() {
|
||||
// Read inputs
|
||||
let (
|
||||
ProgramInput {
|
||||
self_program_id: _,
|
||||
pre_states,
|
||||
instruction: (),
|
||||
},
|
||||
|
||||
@ -33,6 +33,7 @@ fn main() {
|
||||
// Read inputs
|
||||
let (
|
||||
ProgramInput {
|
||||
self_program_id: _,
|
||||
pre_states,
|
||||
instruction: (),
|
||||
},
|
||||
|
||||
@ -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(())
|
||||
}
|
||||
|
||||
@ -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,
|
||||
},
|
||||
|
||||
@ -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,
|
||||
},
|
||||
|
||||
@ -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,
|
||||
},
|
||||
|
||||
@ -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,
|
||||
},
|
||||
|
||||
@ -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,
|
||||
},
|
||||
|
||||
@ -11,7 +11,8 @@ use token_program::core::Instruction;
|
||||
|
||||
fn main() {
|
||||
let (
|
||||
ProgramInput { self_program_id: _,
|
||||
ProgramInput {
|
||||
self_program_id: _,
|
||||
pre_states,
|
||||
instruction,
|
||||
},
|
||||
|
||||
@ -4,7 +4,8 @@ type Instruction = u128;
|
||||
|
||||
fn main() {
|
||||
let (
|
||||
ProgramInput { self_program_id: _,
|
||||
ProgramInput {
|
||||
self_program_id: _,
|
||||
pre_states,
|
||||
instruction: balance_to_burn,
|
||||
},
|
||||
|
||||
@ -12,7 +12,8 @@ type Instruction = (u128, ProgramId, u32, Option<PdaSeed>);
|
||||
/// program.
|
||||
fn main() {
|
||||
let (
|
||||
ProgramInput { self_program_id: _,
|
||||
ProgramInput {
|
||||
self_program_id: _,
|
||||
pre_states,
|
||||
instruction: (balance, auth_transfer_id, num_chain_calls, pda_seed),
|
||||
},
|
||||
|
||||
@ -5,7 +5,8 @@ type Instruction = (Option<Vec<u8>>, 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),
|
||||
},
|
||||
|
||||
@ -4,7 +4,8 @@ type Instruction = ();
|
||||
|
||||
fn main() {
|
||||
let (
|
||||
ProgramInput { self_program_id: _,
|
||||
ProgramInput {
|
||||
self_program_id: _,
|
||||
pre_states,
|
||||
instruction: (),
|
||||
},
|
||||
|
||||
@ -5,7 +5,8 @@ type Instruction = Vec<u8>;
|
||||
/// 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,
|
||||
},
|
||||
|
||||
@ -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),
|
||||
},
|
||||
|
||||
@ -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,
|
||||
},
|
||||
|
||||
@ -4,7 +4,8 @@ type Instruction = u128;
|
||||
|
||||
fn main() {
|
||||
let (
|
||||
ProgramInput { self_program_id: _,
|
||||
ProgramInput {
|
||||
self_program_id: _,
|
||||
pre_states,
|
||||
instruction: balance,
|
||||
},
|
||||
|
||||
@ -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),
|
||||
},
|
||||
|
||||
@ -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),
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user