1. Finalize with correct descriptor (of lock tx)
2. Restart fix: Allow retrieving the commit tx in state `PendingCommit` so we can re-publish in that state.
3. Update cfd feed after state transition to `PendingCommit` to see updated state in UI.
This should greatly improve resilience as we no longer have any
tasks within `tokio` that can fail without recovering.
Instead, we periodically ping the actor with a `Sync` message which
updates the local state of all scripts and sends out messages accordingly.
Caused trouble because of route collisions, so the integration was done now.
Required distinguishing Maker and Taker on the cfd level, which comes in handy anyway.
We distinguish by order origin, but still map to a `Role` enum (`Taker` / `Maker`) for readability.
To avoid duplication the `Role` from contract setup was moved into the model and used throughout.
The complexity of the code part was not worth the information we got out of it, so it was simplified.
Should hopefully make it a bit more readable and easier to understand.
All display related decisions are taken in the UI, but on top of the UI's model.
For this purpose we introduce classes for `CfdState` and `Position` so we can add the relevant mapping functions to these classes.
To achieve the mapping from daemon sse even to the `Cfd` / `Order` interface (that now contain classes instead of just primitives) we extend the sse hook to accept a mapping function.
We define this mapping function for `Cfd` and `Order`, because those contain classes, for all others we just use the default mapping.
Actions are dynamically rendered based on the state.
The daemon decides on the action name.
A single post endpoint handles all actions.
The UI maps the actions to icons.
Co-authored-by: Thomas Eizinger <thomas@coblox.tech>
The default path through the function would be to propagate every
error. However, we want to inspect whether it is one very specific
error.
Make this clear in the code structure by having a dedicated `if let`
for the special case but keep using `?` afterwards.