2026-03-19 16:07:20 -03:00
|
|
|
use nssa_core::program::{
|
2026-03-28 02:30:15 -03:00
|
|
|
AccountPostState, BlockId, ProgramInput, ProgramOutput, Timestamp, ValidityWindow,
|
|
|
|
|
read_nssa_inputs,
|
2026-03-19 16:07:20 -03:00
|
|
|
};
|
|
|
|
|
|
2026-03-28 02:30:15 -03:00
|
|
|
type Instruction = (ValidityWindow<BlockId>, ValidityWindow<Timestamp>);
|
2026-03-19 16:07:20 -03:00
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
let (
|
|
|
|
|
ProgramInput {
|
|
|
|
|
pre_states,
|
2026-03-28 02:30:15 -03:00
|
|
|
instruction: (block_validity_window, timestamp_validity_window),
|
2026-03-19 16:07:20 -03:00
|
|
|
},
|
|
|
|
|
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(
|
2026-03-19 16:07:20 -03:00
|
|
|
instruction_words,
|
|
|
|
|
vec![pre],
|
|
|
|
|
vec![AccountPostState::new(post)],
|
2026-03-20 13:16:52 -03:00
|
|
|
)
|
2026-03-28 01:13:48 -03:00
|
|
|
.with_block_validity_window(block_validity_window)
|
2026-03-28 02:30:15 -03:00
|
|
|
.with_timestamp_validity_window(timestamp_validity_window)
|
2026-03-25 17:42:17 -03:00
|
|
|
.write();
|
2026-03-19 16:07:20 -03:00
|
|
|
}
|