Răsfoiți Sursa

let is_success = rst["status"].as_bool().unwrap();

skyffire 1 an în urmă
părinte
comite
9547d2808a
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      strategy/src/strategy.rs

+ 1 - 1
strategy/src/strategy.rs

@@ -487,7 +487,7 @@ impl Strategy {
         if response.status().is_success() {
             let response_text = response.text().await.unwrap();
             let rst: Value = serde_json::from_str(response_text.as_str()).unwrap();
-            let is_success = rst.as_bool().unwrap();
+            let is_success = rst["status"].as_bool().unwrap();
 
             return if is_success {
                 let delta_sum = Decimal::from_f64(rst["delta_sum"].as_f64().unwrap()).unwrap();