Philipp Hoenisch
3 years ago
No known key found for this signature in database
GPG Key ID: E5F8E74C672BC666
2 changed files with
3 additions and
4 deletions
-
daemon/src/routes_taker.rs
-
daemon/src/taker_cfd_actor.rs
|
@ -67,7 +67,7 @@ pub async fn post_order_request( |
|
|
cfd_actor_inbox: &State<mpsc::UnboundedSender<taker_cfd_actor::Command>>, |
|
|
cfd_actor_inbox: &State<mpsc::UnboundedSender<taker_cfd_actor::Command>>, |
|
|
) { |
|
|
) { |
|
|
cfd_actor_inbox |
|
|
cfd_actor_inbox |
|
|
.send(taker_cfd_actor::Command::TakeOrder { |
|
|
.send(taker_cfd_actor::Command::TakeOffer { |
|
|
order_id: cfd_order_request.order_id, |
|
|
order_id: cfd_order_request.order_id, |
|
|
quantity: cfd_order_request.quantity, |
|
|
quantity: cfd_order_request.quantity, |
|
|
}) |
|
|
}) |
|
|
|
@ -16,8 +16,7 @@ use tokio::sync::{mpsc, watch}; |
|
|
#[allow(clippy::large_enum_variant)] |
|
|
#[allow(clippy::large_enum_variant)] |
|
|
pub enum Command { |
|
|
pub enum Command { |
|
|
SyncWallet, |
|
|
SyncWallet, |
|
|
// TODO: should this be TakeOffer ?
|
|
|
TakeOffer { order_id: OrderId, quantity: Usd }, |
|
|
TakeOrder { order_id: OrderId, quantity: Usd }, |
|
|
|
|
|
NewOrder(Option<Order>), |
|
|
NewOrder(Option<Order>), |
|
|
OrderAccepted(OrderId), |
|
|
OrderAccepted(OrderId), |
|
|
OrderRejected(OrderId), |
|
|
OrderRejected(OrderId), |
|
@ -54,7 +53,7 @@ pub fn new( |
|
|
let wallet_info = wallet.sync().await.unwrap(); |
|
|
let wallet_info = wallet.sync().await.unwrap(); |
|
|
wallet_feed_sender.send(wallet_info).unwrap(); |
|
|
wallet_feed_sender.send(wallet_info).unwrap(); |
|
|
} |
|
|
} |
|
|
Command::TakeOrder { order_id, quantity } => { |
|
|
Command::TakeOffer { order_id, quantity } => { |
|
|
let mut conn = db.acquire().await.unwrap(); |
|
|
let mut conn = db.acquire().await.unwrap(); |
|
|
|
|
|
|
|
|
let current_order = load_order_by_id(order_id, &mut conn).await.unwrap(); |
|
|
let current_order = load_order_by_id(order_id, &mut conn).await.unwrap(); |
|
|