- multiple source states allowed in transition removed need for boilerplate subscription handling
TODO:
1. fix compilation for multiple transition source states
2. add tests for:
- no transitioning to self
- multiple source states in transition
3. Check how CancelledError gets caught in future callback
4. Remove Future[?State] from run return type?
- restoring and not restoring state both use the same setup for SalesAgent, by setting the SalesAgent’s state during instantiation, allowing it to react according to its state
- remove returning of next State from run (actual types yet to be changed)
- subscribe to onchain events, and use TransitionProperties to react (TODO: do not react from AnyState, but set to only states that make sense)
- create setError method in asyncstatemachine that handles setting of error properties
Heavy work in progress, doesn't even compile yet,
this commit will be replaced by new cleaned up small commits
- callbacks are sync again
- agent.start(slots) is replaced by new state SaleStart
- disables explicit state transition tests for now; need to be replaced
Previously, SalesAgent.slotIndex had been moved to not optional. However, there were still many places where optionality was assumed. This commit removes those assumuptions.
- add slotIndex to `SalesAgent` constructor
- remove `SalesAgent.init`
- rename `SalesAgent.init` to `start` and `SalesAgent.deinit` to `stop`.
- rename `SalesAgent. populateRequest` to `SalesAgent.retreiveRequest`.
- move availability removal to the downloading state. once availability is persisted to disk, it should survive node restarts.
-