Skip to content

Commit

Permalink
Fix get swap
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgranhao committed Feb 26, 2025
1 parent 0c48174 commit d4aee44
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/swaps/boltz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,9 +612,9 @@ impl BoltzApiClientV2 {
}

/// Gets the latest status of the Swap
pub fn get_swap(&self, swap_id: &str) -> Result<GetSwapResponse, Error> {
pub async fn get_swap(&self, swap_id: &str) -> Result<GetSwapResponse, Error> {
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?)?)
}
}

Expand Down Expand Up @@ -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");
}
Expand Down

0 comments on commit d4aee44

Please sign in to comment.