2026-03-19 16:07:20 -03:00
|
|
|
use nssa_core::program::{
|
|
|
|
|
AccountPostState, BlockId, ProgramInput, ProgramOutput, read_nssa_inputs,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
type Instruction = (Option<BlockId>, Option<BlockId>);
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
let (
|
|
|
|
|
ProgramInput {
|
|
|
|
|
pre_states,
|
|
|
|
|
instruction: (from_id, until_id),
|
|
|
|
|
},
|
|
|
|
|
instruction_words,
|
|
|
|
|
) = read_nssa_inputs::<Instruction>();
|
|
|
|
|
|
|
|
|
|
let Ok([pre]) = <[_; 1]>::try_from(pre_states) else {
|
|
|
|
|
return;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let post = pre.account.clone();
|
|
|
|
|
|
2026-03-20 13:16:52 -03:00
|
|
|
let output = ProgramOutput::new(
|
2026-03-19 16:07:20 -03:00
|
|
|
instruction_words,
|
|
|
|
|
vec![pre],
|
|
|
|
|
vec![AccountPostState::new(post)],
|
2026-03-20 13:16:52 -03:00
|
|
|
)
|
|
|
|
|
.valid_from_id(from_id)
|
|
|
|
|
.unwrap()
|
|
|
|
|
.valid_until_id(until_id)
|
|
|
|
|
.unwrap();
|
2026-03-19 16:07:20 -03:00
|
|
|
|
|
|
|
|
output.write();
|
|
|
|
|
}
|