Browse Source

Move boilerplate to bottom of file

fix-bad-api-calls
Thomas Eizinger 3 years ago
parent
commit
4eb44fd0d8
No known key found for this signature in database GPG Key ID: 651AC83A6C6C8B96
  1. 68
      daemon/src/maker_cfd_actor.rs

68
daemon/src/maker_cfd_actor.rs

@ -17,64 +17,32 @@ use xtra::prelude::*;
pub struct Initialized(pub Address<MakerIncConnectionsActor>);
impl Message for Initialized {
type Result = ();
}
pub struct TakeOrder {
pub taker_id: TakerId,
pub order_id: OrderId,
pub quantity: Usd,
}
impl Message for TakeOrder {
type Result = ();
}
pub struct NewOrder(pub Order);
impl Message for NewOrder {
type Result = ();
}
pub struct StartContractSetup {
pub taker_id: TakerId,
pub order_id: OrderId,
}
impl Message for StartContractSetup {
type Result = ();
}
pub struct NewTakerOnline {
pub id: TakerId,
}
impl Message for NewTakerOnline {
type Result = ();
}
pub struct IncProtocolMsg(pub SetupMsg);
impl Message for IncProtocolMsg {
type Result = ();
}
pub struct CfdSetupCompleted {
pub order_id: OrderId,
pub dlc: Dlc,
}
impl Message for CfdSetupCompleted {
type Result = ();
}
pub struct SyncWallet;
impl Message for SyncWallet {
type Result = ();
}
pub struct MakerCfdActor {
db: sqlx::SqlitePool,
wallet: Wallet,
@ -90,8 +58,6 @@ pub struct MakerCfdActor {
contract_setup_message_buffer: Vec<SetupMsg>,
}
impl xtra::Actor for MakerCfdActor {}
impl MakerCfdActor {
pub async fn new(
db: sqlx::SqlitePool,
@ -421,3 +387,37 @@ impl Handler<SyncWallet> for MakerCfdActor {
log_error!(self.handle_sync_wallet());
}
}
impl Message for Initialized {
type Result = ();
}
impl Message for TakeOrder {
type Result = ();
}
impl Message for NewOrder {
type Result = ();
}
impl Message for StartContractSetup {
type Result = ();
}
impl Message for NewTakerOnline {
type Result = ();
}
impl Message for IncProtocolMsg {
type Result = ();
}
impl Message for CfdSetupCompleted {
type Result = ();
}
impl Message for SyncWallet {
type Result = ();
}
impl xtra::Actor for MakerCfdActor {}

Loading…
Cancel
Save