Daniel Karzel
a84fd60179
Add failing test
A test that shows, that if we save two CFDs in the database, we fail to correctly load the second CFD by order-uuid.
3 years ago
Thomas Eizinger
b6d0fc6c2f
Convert `send_wire_message_actor` to xtra::Actor
This will give us a generalized `Sink` interface for writing to the
connection.
3 years ago
Thomas Eizinger
e7774dc29f
Replace negative .gitignores with build script
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.
3 years ago
Lucas Soriano del Pino
366c415314
Introduce monitor actor
3 years ago
Thomas Eizinger
c1b0ec63a4
Simplify testing of protected routes
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.
3 years ago
Mariusz Klochowicz
4dd27fbd25
Don't repeat names in module and types
Same refactor as recently on the maker side.
3 years ago
Philipp Hoenisch
609b3f22d4
Don't double load from db
3 years ago
Philipp Hoenisch
95906ed5e6
The order was removed in TakeOrder
3 years ago
Thomas Eizinger
81259e1b61
Decouple wallet sync from cfd actors
Now that we have a cloneable wallet, we don't actually need to have
a single owner of it.
3 years ago
Thomas Eizinger
54263ce38a
Don't repeat names in modules and types
3 years ago
Thomas Eizinger
4d33083af7
Rename variable
This piece of code is always in the scope of the maker, no need to
repeat that.
We also don't need to repeat the data type in the name.
3 years ago
Thomas Eizinger
e69ffc86b9
Initialize the addresses to other actors without `Option`
By creating the `Context` first, we can obtain an address without
actually instantiating the actor. This allows us to have two actors
own a reference to each other without the use of `Option`.
3 years ago
Thomas Eizinger
0ad9348e32
Don't repeat name in module and type
3 years ago
Mariusz Klochowicz
576237ce3e
Don't use unwrap() inside MakerCfdActor
3 years ago
Mariusz Klochowicz
15ecdf01b0
Roll-out xtra framework into the taker actor
3 years ago
Philipp Hoenisch
822edc206d
Rename TakeOrder to TakeOffer
3 years ago
Philipp Hoenisch
08f31f11f7
Remove unused CfdState
3 years ago
Philipp Hoenisch
a0951c03ac
Add accept/reject order feature to maker
3 years ago
Philipp Hoenisch
2a6fe6b664
Rename TakeRequest to Order
3 years ago
Thomas Eizinger
33a27d4d92
Don't dbg log the latest state
3 years ago
Thomas Eizinger
e7f9d24e94
Start contract setup directly after sending the accept
The taker does this unconditionally, we don't need to wait for
another message on the maker side.
3 years ago
Thomas Eizinger
816f9b9791
Buffer incoming messages in case the maker is faster in reaching setup
3 years ago
Thomas Eizinger
49bff80b93
Destruct msg to access variables directly
3 years ago
Philipp Hoenisch
759d0688e2
Allow for presence/non-presence of index page
A dev might have or might not have built the frontend. If he did not, a get request to `/` will result in a `HTTP::404`. If he did, the containing `index.html` will be returned leading to a `HTTP::200`.
3 years ago
Thomas Eizinger
a879b25a91
Replace unwraps with `?`
3 years ago
Thomas Eizinger
4eb44fd0d8
Move boilerplate to bottom of file
3 years ago
Thomas Eizinger
db29126c87
Have all handlers return `()`
Errors returned from handlers are swallowed. We must not return
errors from handlers.
3 years ago
Daniel Karzel
72ffe1b325
Replace all the remaining println with tracing logs
3 years ago
Mariusz Klochowicz
d407b7f654
Send the protocol messages to the actor asynchronously
`send()` does not actually send anything unless its polled; convert to
`do_send_async()` like elsewhere to send the message.
3 years ago
Thomas Eizinger
25d54078e7
Add BitMex price feed
Fixes #96 .
3 years ago
Mariusz Klochowicz
1ab92469a1
Add missing await for the message announcing NewTakerOnline
Without the await, the message was never sent and the taker could not see new offers.
3 years ago
Mariusz Klochowicz
46e9b96fbf
Roll-out xtra framework usage in maker
3 years ago
Mariusz Klochowicz
c43d913d3d
Use a dedicated test route for testing maker's authentication
Upcoming rollout of xtra will make instantiating an actor for test purposes much
more cumbersome. These tests don't need the actor, therefore a new route that
does not depend on instantiating one has been created.
3 years ago
Philipp Hoenisch
88554de160
Log username and password
3 years ago
dependabot[bot]
d6865981e6
Bump rust_decimal_macros from 1.15.0 to 1.16.0
Bumps [rust_decimal_macros](https://github.com/paupino/rust-decimal ) from 1.15.0 to 1.16.0.
- [Release notes](https://github.com/paupino/rust-decimal/releases )
- [Commits](https://github.com/paupino/rust-decimal/commits )
---
updated-dependencies:
- dependency-name: rust_decimal_macros
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Daniel Karzel
de66e85d73
Successful publication of lock tx
3 years ago
Thomas Eizinger
dda021b37c
Password protect the maker's routes
3 years ago
Philipp Hoenisch
90ae8ef154
Enable rocket logs by default
3 years ago
Daniel Karzel
d647a69795
Successful `ContractSetup` phase
3 years ago
Thomas Eizinger
3cd28e92e0
Remove dead code
3 years ago
Thomas Eizinger
f2445ee8e5
Reformat impl of `derive_extended_priv_key`
3 years ago
Daniel Karzel
b6bb36266d
Remove snapshot tests
These tests don't really add much value anymore.
They were initially added for making sure we don't break the API towards the UI, but we introduced a separate model for that in the meanwhile.
One could still argue that these tests ensure backwards compatibility for the cfd state in the DB, but that is not important at the moment.
Since we have more complex states now it is quite a pain to maintain these tests now - without getting much out.
3 years ago
Philipp Hoenisch
1fd4745319
Use logger instead of println
3 years ago
Philipp Hoenisch
382e7095e8
Add logging library and initialize by default
3 years ago
Lucas Soriano del Pino
4fdbe89898
Refactor cfd_protocol crate
3 years ago
Lucas Soriano del Pino
b49dc137fe
Construct payouts from intervals
3 years ago
Lucas Soriano del Pino
aedce9b4b6
Handle multiple (message, nonce) pairs
3 years ago
Philipp Hoenisch
28cc157cee
Add ext trait to convert EmbeddedFile to Response
3 years ago
Philipp Hoenisch
6ec95eef7a
Embed maker/taker frontend into binary
Note: we need to check-in `frontend/dist` directories as otherwise the build will fail.
If you want to embed the files into the binaries you will need to build them first (`yarn run build`).
3 years ago
Daniel Karzel
17471c9196
Remove `AdaptorSignature` wrapper in favor of latest `rust-secp256k1-zkp`
`EcdsaAdaptorSignature` implements `Serialize` and `Deserialize` on latest master of `rust-secp256k1-zkp` so we can remove the wrapper.
3 years ago