From 4eb44fd0d82cab452d79015d674bfd037d4242bf Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Thu, 23 Sep 2021 10:38:24 +1000 Subject: [PATCH] Move boilerplate to bottom of file --- daemon/src/maker_cfd_actor.rs | 68 +++++++++++++++++------------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/daemon/src/maker_cfd_actor.rs b/daemon/src/maker_cfd_actor.rs index 46529e7..c94fa8e 100644 --- a/daemon/src/maker_cfd_actor.rs +++ b/daemon/src/maker_cfd_actor.rs @@ -17,64 +17,32 @@ use xtra::prelude::*; pub struct Initialized(pub Address); -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, } -impl xtra::Actor for MakerCfdActor {} - impl MakerCfdActor { pub async fn new( db: sqlx::SqlitePool, @@ -421,3 +387,37 @@ impl Handler 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 {}