diff --git a/mm2src/mm2_tests.rs b/mm2src/mm2_tests.rs index 977a1fcb09..c4df56c61f 100644 --- a/mm2src/mm2_tests.rs +++ b/mm2src/mm2_tests.rs @@ -381,10 +381,6 @@ fn test_my_balance() { assert_eq!(my_balance, "7.777"); let my_address = unwrap!(json["address"].as_str()); assert_eq!(my_address, "RRnMcSeKiLrNdbp91qNVQwwXx5azD4S4CD"); - - // locked by swaps should be displayed as fraction - assert_eq!(json["locked_by_swaps"]["numer"], Json::from("0")); - assert_eq!(json["locked_by_swaps"]["denom"], Json::from("1")); } fn check_set_price_fails(mm: &MarketMakerIt, base: &str, rel: &str) { diff --git a/mm2src/rpc/lp_commands.rs b/mm2src/rpc/lp_commands.rs index 1b125ae9dc..37e9b9671a 100644 --- a/mm2src/rpc/lp_commands.rs +++ b/mm2src/rpc/lp_commands.rs @@ -31,7 +31,7 @@ use serde_json::{self as json, Value as Json}; use std::borrow::Cow; use crate::mm2::lp_ordermatch::{CancelBy, cancel_orders_by}; -use crate::mm2::lp_swap::{get_locked_amount, active_swaps_using_coin}; +use crate::mm2::lp_swap::{active_swaps_using_coin}; /// Attempts to disable the coin pub fn disable_coin (ctx: MmArc, req: Json) -> HyRes { @@ -73,12 +73,10 @@ pub async fn electrum (ctx: MmArc, req: Json) -> Result>, Strin let ticker = try_s! (req["coin"].as_str().ok_or ("No 'coin' field")).to_owned(); let coin: MmCoinEnum = try_s! (lp_coininit (&ctx, &ticker, &req) .await); let balance = try_s! (coin.my_balance().compat().await); - let trade_fee = try_s!(coin.get_trade_fee().compat().await); let res = json! ({ "result": "success", "address": try_s!(coin.my_address()), "balance": balance, - "locked_by_swaps": get_locked_amount (&ctx, &ticker, &trade_fee), "coin": coin.ticker(), "required_confirmations": coin.required_confirmations(), "requires_notarization": coin.requires_notarization(), @@ -92,12 +90,10 @@ pub async fn enable (ctx: MmArc, req: Json) -> Result>, String> let ticker = try_s! (req["coin"].as_str().ok_or ("No 'coin' field")).to_owned(); let coin: MmCoinEnum = try_s! (lp_coininit (&ctx, &ticker, &req) .await); let balance = try_s! (coin.my_balance().compat().await); - let trade_fee = try_s!(coin.get_trade_fee().compat().await); let res = json! ({ "result": "success", "address": try_s!(coin.my_address()), "balance": balance, - "locked_by_swaps": get_locked_amount (&ctx, &ticker, &trade_fee), "coin": coin.ticker(), "required_confirmations": coin.required_confirmations(), "requires_notarization": coin.requires_notarization(), @@ -141,12 +137,10 @@ pub async fn my_balance (ctx: MmArc, req: Json) -> Result>, Str Ok (None) => return ERR!("No such coin: {}", ticker), Err (err) => return ERR!("!lp_coinfind({}): {}", ticker, err) }; - let trade_fee = try_s!(coin.get_trade_fee().compat().await); let my_balance = try_s!(coin.my_balance().compat().await); let res = json!({ "coin": ticker, "balance": my_balance, - "locked_by_swaps": get_locked_amount(&ctx, &ticker, &trade_fee).to_fraction(), "address": try_s!(coin.my_address()), }); let res = try_s! (json::to_vec (&res));