343: All tooltips to action icons in CfdTable r=klochowicz a=klochowicz
It makes it a bit easier to use, especially for newcomers
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
342: Display available quantity in the taker r=klochowicz a=klochowicz
It becomes important when someone else controls the offers from the maker.
This should be enough for now, but it would be nice to provide nicer validation field at some point.
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
340: No reachable panics r=thomaseizinger a=thomaseizinger
- Don't return plain-text errors to the user
- Don't expose panicking code paths to the user
341: Taker routes channels r=luckysori a=luckysori
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Lucas Soriano del Pino <l.soriano.del.pino@gmail.com>
337: Better DB tests and various cleanups r=thomaseizinger a=thomaseizinger
- Extend DB test suite
- Directly return `PoolConnection`
- Don't use Default for test instance
- Take `Cfd` by reference if we don't need to consume it
- Use pretty assertions
- Make DB tests more readable by reducing boilerplate
- Refactor `insert_new_cfd_state_by_order_id` to `append_cfd_state`
- Reduce boilerplate in constructing `CfdStateCommon`
- Make it less verbose to construct simple states
- Add test for a variety of state updates
- Run tests against in-memory DB
Co-authored-by: Daniel Karzel <daniel@comit.network>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
We almost always have the entire `Cfd` available when we call this
function. It is therefore much easier to simply pass the entire
`Cfd` in instead of selective data.
308: Close bad connections to takers r=thomaseizinger a=thomaseizinger
- Introduce dedicated actor for forwarding only `Ok` messages
- Close connections with takers that don't adhere to the message format
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Upon rejection, we always have to remove the order on the maker side, otherwise a taker cannot re-try taking (with e.g. a different amount) because there is already a rejected cfd in the taker database.
331: Fix default quantity in UI r=bonomat a=bonomat
`@thomaseizinger` : I'm not sure if I understand it correctly. Can I do ed2ec8eb49 or is this not allowed because I change the variable independent of what is in the state?
Alternative solution is the second commit ac8d6e191cresolves#330
Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>
333: Use `MessageChannel` in `maker_routes` r=luckysori a=luckysori
More work towards #231.
Co-authored-by: Lucas Soriano del Pino <l.soriano.del.pino@gmail.com>
322: Cleanup in Cfd actors r=klochowicz a=klochowicz
I started out trying to fix a common gotcha (forgetting to refresh Cfd feed),
and then realised that I was not far off of addressing a bunch of TODOs in the code
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
332: Provide margin of counterparty r=bonomat a=bonomat
Very useful for the maker.
Not shown in the UI for now.
Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>
329: Set default log level for whole crate r=da-kami a=bonomat
Resolves#325
We were setting a filter for the binaries only and the rest was on INFO.
```
2021-10-15 08:47:06 WARN (post_cfd_action) POST /api/cfd/<id>/<action>
2021-10-15 08:47:06 WARN 🥅 Catchers:
2021-10-15 08:47:06 WARN (unauthorized) 401
2021-10-15 08:47:06 WARN (unauthorized) /api 401
2021-10-15 08:47:06 WARN 📡 Fairings:
2021-10-15 08:47:06 WARN Shield (liftoff, response, singleton)
2021-10-15 08:47:06 WARN SQL migrations (ignite)
2021-10-15 08:47:06 WARN 'maker' Database Pool (ignite)
2021-10-15 08:47:06 WARN Create actors (ignite)
2021-10-15 08:47:06 INFO 🛡️ Shield:
2021-10-15 08:47:06 WARN 🚀 Rocket has launched from http://127.0.0.1:8001
2021-10-15 08:47:06 INFO New taker 0f54e159-75ac-4d65-9d9f-e37847e88572 connected on 127.0.0.1:64286
2021-10-15 08:47:13 INFO POST /api/order/sell application/json:
2021-10-15 08:47:13 DEBUG Received new order
2021-10-15 08:47:14 INFO GET /api/feed text/event-stream:
2021-10-15 08:47:16 INFO POST /api/order/sell application/json:
2021-10-15 08:47:16 DEBUG Received new order
2021-10-15 08:47:21 DEBUG Taker wants to take an order taker_id=0f54e159-75ac-4d65-9d9f-e37847e88572 quantity=0 order_id=ed6dfa48-275e-4eae-b2f5-5c3ad154eda4
2021-10-15 08:48:06 DEBUG Fetching announcement for /x/BitMEX/BXBT/2021-10-15T22:00:00.price?n=20
2021-10-15 08:48:34 INFO POST /api/order/sell application/json:
2021-10-15 08:48:34 DEBUG Received new order
2021-10-15 08:48:41 DEBUG Taker wants to take an order taker_id=0f54e159-75ac-4d65-9d9f-e37847e88572 quantity=11 order_id=7bbd174b-10a2-4776-9d00-afa41a8077ae
2021-10-15 08:48:45 INFO POST /api/cfd/7bbd174b-10a2-4776-9d00-afa41a8077ae/acceptOrder:
2021-10-15 08:48:45 DEBUG Maker accepts an order order_id=7bbd174b-10a2-4776-9d00-afa41a8077ae
2021-10-15 08:49:06 DEBUG Fetching announcement for /x/BitMEX/BXBT/2021-10-15T22:00:00.price?n=20
2021-10-15 08:49:38 INFO Lock transaction published with txid 09fdafb1125295ea66401e1160542fa39d5695d61d64255bb94431275f892cb4
2021-10-15 08:49:45 DEBUG Found relevant Bitcoin transaction txid=09fdafb1125295ea66401e1160542fa39d5695d61d64255bb94431275f892cb4 status=in mempool
```
Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>
321: Use `MessageChannels` in `maker_inc_connections::Actor` r=luckysori a=luckysori
We would have liked to attach the stream of `TakerStreamMessage`s directly to the `MessageChannel`, but we failed and instead decided to let the `maker_inc_connections::Actor` send these messages to itself and then forward them to the `maker_cfd::Actor`.
---
I wasted a lot of time trying to send the message directly to the `maker_cfd::Actor`. I trust that `@thomaseizinger` can find a way, but I had to give up 😞
Co-authored-by: Lucas Soriano del Pino <l.soriano.del.pino@gmail.com>
We would have liked to attach the stream of `TakerStreamMessage`s
directly to the `MessageChannel`, but we failed and instead decided to
let the `maker_inc_connections::Actor` send these messages to itself
and then forward them to the `maker_cfd::Actor`.
Inserting cfd or updating its state requires a follow-up update on the Cfd feed
sent to the UI. Encapsulate the behaviour in functions that are shared
across Cfd actors.