From d4aee4466a8ac9a5581959f1bfffbc2d5555365a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Granh=C3=A3o?= Date: Wed, 26 Feb 2025 13:33:34 +0000 Subject: [PATCH] Fix get swap --- src/swaps/boltz.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/swaps/boltz.rs b/src/swaps/boltz.rs index 16ea201..b5f3492 100644 --- a/src/swaps/boltz.rs +++ b/src/swaps/boltz.rs @@ -612,9 +612,9 @@ impl BoltzApiClientV2 { } /// Gets the latest status of the Swap - pub fn get_swap(&self, swap_id: &str) -> Result { + pub async fn get_swap(&self, swap_id: &str) -> Result { let end_point = format!("swap/{swap_id}"); - Ok(serde_json::from_str(&self.get(&end_point)?)?) + Ok(serde_json::from_str(&self.get(&end_point).await?)?) } } @@ -1463,11 +1463,11 @@ mod tests { assert!(result.is_ok(), "Failed to get chain transactions"); } - #[test] - fn test_get_swap() { + #[macros::async_test_all] + async fn test_get_swap() { let client = BoltzApiClientV2::new(BOLTZ_MAINNET_URL_V2); let id = "G6c6GJJY8eXz"; - let result = client.get_swap(id); + let result = client.get_swap(id).await; println!("{:#?}", result); assert!(result.is_ok(), "Failed to get swap status"); }