`attach_stream` uses `send` under the hood which will process messages
in order. This will guarantee that the `taker_cfd::Actor` processes the
messages in the order they come in on the wire. That allows us to assume
that we will always get the `Accept` message before the first `Setup` message.
These are mostly copy-pasted from xmr-btc-swap modulo the changelog
handling (because we don't have a changelog).
The gist is:
- We attach release binaries to every release that is created.
- Every merge to master creates a `preview` release.
- A merge from a branch that is named `release/x.y.z` creates a
release `x.y.z`.
- A new release branch can be created via `draft-new-release.yml`.
This goes towards handling all cfd state transitions in one place, so it becomes easier to reason about it.
Currently, state transitions are scattered over the code of the cfd actor.
This change bundles the actual transition in the cfd itself.
Inserting the new state into the db is still in the responsibility of the caller.
note: the `monitor` import in `taker.rs` should technically not be part of this commit, but was needed because I decided that the `CfdMonitoringEvent` should live in the `monitor` actor. But since that is not part of the `Cfd` in `model` the taker needs to know about the `monitor`.
We currently have cases where the CFD might transition to a same state twice when restarting.
Furthermore, we might transition from `Open` to `Open` upon renewal.
Since it is currently unclear if this restriction is really needed we just print a warning in the logs instead of failing.
Bundling the frontend does not necessarily require type checking,
nor should type checking imply bundling.
TSC is also fairly slow. Separate the two and invoke tsc separately in
CI.
The only thing that has to stay in the root is the `index.html` file,
otherwise the dev server doesn't pick it up.
Also make sure our frontend tests actually run and pass in CI.
Not suitable for all use-cases as the logs are jumbled up, but it makes
regression testing more approachable.
Hitting a single `ctrl+c` stops all processes.
The problem was that the restriction on the JOIN clause does not properly filter the complete set, but actually results in wrongly joining the CFDs.
This resulted in two CFDs returned, where one was wrongly assembled (the id of the first one, but the data of the second one).
In a cases where the wrong one is the first one in the list of returned CFDs we would run into an error when inserting a new state, because we would try to alter the state of a wrong CFD.
Fixed by joining on the id and filtering for the order.uuid in the where clause.
Note:
I also tested to add the `and orders.uuid = ?` restriction to the first join clause (in addition to the id clause) which might theoretically be more optimized.
That would work as well, but I found it harder to reason about it. As part of the overall where clause one can see the restriction to exactly this value more clearly.
Vite deletes the `dist` directory on re-builds. That will also delete
the gitignore which makes the generated files show up in Git.
We need those directories to exist otherwise `rust-embed` fails.
Use a build-script to create them when we compile the daemons.
To password protect a route, we only need to add the `Authenticated`
route guard. To test that this works as expected, we can create a
dummy route in the test which makes the rocket instance easier to
construct.