Ver Fonte

coinex 订单推送打印和订单详情状态设置

JiahengHe há 1 ano atrás
pai
commit
28d28301f3
2 ficheiros alterados com 5 adições e 5 exclusões
  1. 2 3
      standard/src/coinex_swap.rs
  2. 3 2
      strategy/src/coinex_usdt_swap.rs

+ 2 - 3
standard/src/coinex_swap.rs

@@ -346,7 +346,7 @@ impl Platform for CoinexSwap {
         }
 
         if res_data.code == 200 {
-            info!("order_detail {}", res_data.data);
+            // info!("order_detail {}", res_data.data);
             if res_data.data.is_array() {
                 let res_data_json = res_data.data.as_array().unwrap();
                 if res_data_json.len() == 0 { // 已取消或已成交
@@ -373,12 +373,11 @@ impl Platform for CoinexSwap {
                 result.id = order_id.to_string();
                 Ok(result)
             }
-
         } else if res_data.code == -1 && res_data.message.contains("3103:order not exists") { // 未成交已取消的订单会报不存在
             let mut order = Order::new();
             order.id = order_id.to_string();
             order.custom_id = custom_id.to_string();
-            order.status = "NULL".to_string();
+            order.status = "REMOVE".to_string();
             Ok(order)
         } else {
             Err(Error::new(ErrorKind::Other, res_data.to_string()))

+ 3 - 2
strategy/src/coinex_usdt_swap.rs

@@ -1,4 +1,4 @@
-use tracing::{error};
+use tracing::{error, info};
 use std::collections::BTreeMap;
 use std::sync::Arc;
 use std::sync::atomic::AtomicBool;
@@ -98,7 +98,7 @@ async fn on_data(core_arc_clone: Arc<Mutex<Core>>,
         }
         "order.update" => {
             trace_stack.set_source("coinex_swap.orders".to_string());
-            // info!("coinex_usdt_swap 订单推送:{:?}", response);
+            info!("coinex_usdt_swap 订单推送:{:?}", response);
             let orders = standard::handle_info::HandleSwapInfo::handle_order(CoinexSwap, response.clone(), multiplier.clone());
             let mut order_infos:Vec<OrderInfo> = Vec::new();
             for mut order in orders.order {
@@ -112,6 +112,7 @@ async fn on_data(core_arc_clone: Arc<Mutex<Core>>,
             }
 
             if order_infos.is_empty() {
+                error!("coinex_usdt_swap 未识别的订单 格式化失败:{:?}", response);
                 return
             }
             let mut new_order = order_infos[0].clone();