State Machines
State machines are simple units that can be used to model the state of a system. They are composed of states, events, and transitions. A state machine can be in one state at a time, and can transition to another state when an event is triggered. The state machine can also have actions that are executed when a transition occurs. Stackr-JS provides a simple state machine implementation that takes in the Rollup state and STFAll of this should go outside the
state.ts
fileGenesis State
The genesis state is the initial state of the state machine. It is the state that is used to initialize the state machine. It is also the state that is used to initialize the state of the rollup. You need to set the genesis state insidegenesis-state.json
file.
The format is
{ "state" : WHATEVER_YOU_WANT_AS_JSON }
example
Input type schema
The user-input type schema is the schema that is used to validate the user input. It is used to validate the user input before it is applied to the state machine.This is what the user/ another entity send to the app or rollup. This
is NOT what is applied to the State transition function.
Notice the types
These are not TypeScript interfaces, these are actual Objects hence the way
the type is passed on is inside quotes.
Supported user input types
These are same as solidity typesinternal stackr-js
Stackr Converts these to EIP-712 typed data fields and expects user signatures
on it
ActionSchema
from this
userInputSchema
can be used to create instances of user Actions