Commit Graph

11 Commits (620ac569f7db4b19c3dc761619e7a4d0ab0841dd)

Author SHA1 Message Date
Daniel Karzel c0070f8fa7
Move files from `protocol` to appropriate module
Some network and application specific code does not belong in the protocol module and was moved.
Eventloop, recovery and the outside behaviour were moved to the respective application module because they are application specific.

The `swap_setup` was moved into the network module because upon change both sides will have to be changed and should thus stay close together.
3 years ago
Thomas Eizinger 8a30ef725c
Refactor transports to construct them specific for each application
Instead of splitting up the transports into capabilities, we compose
them directly for each application. This allows us to remove the
websocket transport for the CLI which is really only needed for the
ASB to allow retrieval of quotes via the browser.
3 years ago
rishflab 8805002f96 Remove redundant noun from tracing initialiser functions 3 years ago
rishflab e517c5934e Move asb tracing initializer to asb module 3 years ago
Thomas Eizinger 3e0301a9d4
Move `FixedRate` into event_loop module
This is where these types are used, they can be defined in there.
3 years ago
Thomas Eizinger 1822886cd0
Provide stronger isolation of kraken module
Instead of leaking the tokio::sync::Receiver type in our
return value, we create a newtype that implements the desired
interface. This allows us to get rid of the `RateService` structs
and instead implement `LatestRate` directly on top of this struct.

Given that `LatestRate` is only used within the event_loop module,
we move the definition of this type into there.
3 years ago
Thomas Eizinger bc176bc4fb
Minor import optimizations 3 years ago
Thomas Eizinger a8bfc1d686 Make LatestRate::Error require std::error::Error trait bound
This allows us to use .context instead of .map_err when calling
`latest_rate()`. For the static rate module, we simply fill in
`Infallible` which is actually better suited because it describes
that we are never using this error.
3 years ago
Franck Royer 644f4c1732 Bubble up ws error to consumer
Note that because we are using `watch` channel, only a reference to the
channel value can be returned.
Hence, using custom Error that can be cloned to be able to
pass `Result` through the channel.
3 years ago
Franck Royer 92b3df4158 Introduce dynamic rates 3 years ago
Daniel Karzel fe3d6f1fef Rename nectar to asb (automated swap backend) 3 years ago