mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-03-30 14:13:18 +00:00
33 lines
844 B
Rust
33 lines
844 B
Rust
|
|
use nssa_core::program::{
|
||
|
|
ChainedCall, ProgramId, ProgramInput, read_nssa_inputs, write_nssa_outputs_with_chained_call,
|
||
|
|
};
|
||
|
|
use risc0_zkvm::serde::to_vec;
|
||
|
|
|
||
|
|
type Instruction = (u128, ProgramId);
|
||
|
|
|
||
|
|
fn main() {
|
||
|
|
let ProgramInput {
|
||
|
|
pre_states,
|
||
|
|
instruction: (balance, program_id),
|
||
|
|
} = read_nssa_inputs::<Instruction>();
|
||
|
|
|
||
|
|
let [sender_pre, receiver_pre] = match pre_states.try_into() {
|
||
|
|
Ok(array) => array,
|
||
|
|
Err(_) => return,
|
||
|
|
};
|
||
|
|
|
||
|
|
let instruction_data = to_vec(&balance).unwrap();
|
||
|
|
|
||
|
|
let chained_call = Some(ChainedCall {
|
||
|
|
program_id,
|
||
|
|
instruction_data,
|
||
|
|
account_indices: vec![1, 0],
|
||
|
|
});
|
||
|
|
|
||
|
|
write_nssa_outputs_with_chained_call(
|
||
|
|
vec![sender_pre.clone(), receiver_pre.clone()],
|
||
|
|
vec![sender_pre.account, receiver_pre.account],
|
||
|
|
chained_call,
|
||
|
|
);
|
||
|
|
}
|