From d5bfae7813ceb048d37dbf71c5e902a994686fb8 Mon Sep 17 00:00:00 2001 From: Vaibhav Date: Mon, 8 Jan 2024 13:50:51 +0530 Subject: [PATCH] chore: remove redundant ln functions --- bitfinex-client/src/client/mod.rs | 53 ------------------- .../tests/bitfinex_client_tests.rs | 34 ------------ 2 files changed, 87 deletions(-) diff --git a/bitfinex-client/src/client/mod.rs b/bitfinex-client/src/client/mod.rs index e0ab9ad9..0a66678a 100644 --- a/bitfinex-client/src/client/mod.rs +++ b/bitfinex-client/src/client/mod.rs @@ -307,59 +307,6 @@ impl BitfinexClient { Ok(details.address) } - #[instrument(name = "bitfinex_client.get_ln_deposit_address", skip(self), err)] - pub async fn get_ln_deposit_address(&self) -> Result { - let mut body: HashMap = HashMap::new(); - body.insert("wallet".to_string(), Wallet::EXCHANGE.to_string()); - body.insert("method".to_string(), AddressMethod::LNX.to_string()); - let request_body = serde_json::to_string(&body)?; - - let endpoint = "/deposit/address"; - let params = ""; - let headers = self.post_w_request_headers(endpoint, params, &request_body)?; - - let response = self - .rate_limit_client(endpoint) - .await - .post(Self::url_for_auth_w_path(endpoint, params)) - .headers(headers) - .body(request_body) - .send() - .await?; - - let details = Self::extract_response_data::(response).await?; - Ok(details.address) - } - - #[instrument(name = "bitfinex_client.get_ln_invoice", skip(self), err)] - pub async fn get_ln_invoice( - &self, - client_id: ClientId, - amount: Decimal, - ) -> Result { - let mut body: HashMap = HashMap::new(); - body.insert("wallet".to_string(), Wallet::EXCHANGE.to_string()); - body.insert("currency".to_string(), Currency::LNX.to_string()); - body.insert("amount".to_string(), amount.to_string()); - let request_body = serde_json::to_string(&body)?; - - let endpoint = "/deposit/invoice"; - let params = ""; - let headers = self.post_w_request_headers(endpoint, params, &request_body)?; - - let response = self - .rate_limit_client(endpoint) - .await - .post(Self::url_for_auth_w_path(endpoint, params)) - .headers(headers) - .body(request_body) - .send() - .await?; - - let invoice = Self::extract_response_data::(response).await?; - Ok(invoice) - } - #[instrument(name = "bitfinex_client.transfer_funding_to_trading", skip(self), err)] pub async fn transfer_funding_to_trading( &self, diff --git a/bitfinex-client/tests/bitfinex_client_tests.rs b/bitfinex-client/tests/bitfinex_client_tests.rs index c69004ea..b3c7866e 100644 --- a/bitfinex-client/tests/bitfinex_client_tests.rs +++ b/bitfinex-client/tests/bitfinex_client_tests.rs @@ -2,7 +2,6 @@ use std::env; use bitfinex_client::*; -use rust_decimal_macros::dec; use serial_test::serial; async fn configured_client() -> anyhow::Result { @@ -104,39 +103,6 @@ async fn get_funding_deposit_address() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] -#[serial] -async fn get_ln_deposit_address() -> anyhow::Result<()> { - if let Ok(client) = configured_client().await { - let _address = client.get_ln_deposit_address().await?; - } - - Ok(()) -} - -#[tokio::test] -#[serial] -async fn get_ln_invoice() -> anyhow::Result<()> { - if let Ok(client) = configured_client().await { - let client_id = ClientId::new(); - let amount = dec!(0.001); - let _invoice = client.get_ln_invoice(client_id, amount).await?; - } - - Ok(()) -} - -#[tokio::test] -#[serial] -async fn get_ln_transactions() -> anyhow::Result<()> { - if let Ok(client) = configured_client().await { - let client_id = ClientId::new(); - let _invoice = client.get_ln_transactions(client_id).await?; - } - - Ok(()) -} - #[tokio::test] #[serial] async fn get_btc_on_chain_transactions() -> anyhow::Result<()> {