lssa/test_program_methods/guest/src/bin/validity_window.rs

30 lines
641 B
Rust
Raw Normal View History

use nssa_core::program::{
AccountPostState, ProgramInput, ProgramOutput, ValidityWindow, read_nssa_inputs,
};
type Instruction = ValidityWindow;
fn main() {
let (
ProgramInput {
pre_states,
instruction: validity_window,
},
instruction_words,
) = read_nssa_inputs::<Instruction>();
let Ok([pre]) = <[_; 1]>::try_from(pre_states) else {
return;
};
let post = pre.account.clone();
2026-03-25 17:42:17 -03:00
ProgramOutput::new(
instruction_words,
vec![pre],
vec![AccountPostState::new(post)],
2026-03-20 13:16:52 -03:00
)
.with_validity_window(validity_window)
2026-03-25 17:42:17 -03:00
.write();
}