I encountered an error while running on the local testnet.
The error message is: Error: [[],[["Account_action_state_precondition_unsatisfied"]]].
I suspect that the issue lies with a reducer.getActions where the endActionState parameter is not actually the last state.
Here is the relevant code snippet:
this.reducer.getActions({
fromActionState,
endActionState,
});
This code is part of a smart contract that have 2 main function:
@method incrementCounter(amount: Field) {
this.reducer.dispatch(amount);
}
@method rollupIncrements(startAction: Field, endAction: Field) {
let pendingActions = this.reducer.getActions({
fromActionState: startAction,
endActionState: endAction,
});
let { state: newCounter, actionState: newActionState } =
this.reducer.reduce(
pendingActions,
Field,
(state: Field, _action: Field) => {
return state.add(_action);
},
{ state: Field(0), actionState: startAction }
);
this.num.set(newCounter);
}