Skip to main content

Module state

Module state 

Source
Expand description

State machine validation.

Enforces valid state transitions for account lifecycle enums. Prevents invalid state jumps (e.g., Pending -> Closed skipping Active).

Functionsยง

check_state
Check that the state byte at offset in data matches expected.
check_state_in
Check that the state byte at offset is in the allowed set.
check_state_not
Check that the state byte at offset is NOT rejected.
check_state_transition
Check that a state transition is valid.
transition_state
Write a new state byte at offset, validating the transition.