Skip to content

Commit f0e1c2f

Browse files
committed
fixup! added Eclair node support
got rid of anyhow::Result
1 parent 185d020 commit f0e1c2f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

simln-lib/src/eclair.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use reqwest::{Client, Method, Url};
1111
use serde::{Deserialize, Serialize};
1212
use serde_json::Value;
1313
use std::collections::HashMap;
14+
use std::error::Error;
1415
use std::str::FromStr;
1516
use std::time::Duration;
1617
use tokio::time;
@@ -27,7 +28,7 @@ pub struct EclairConnection {
2728
}
2829

2930
impl EclairConnection {
30-
fn construct_url(&self, endpoint: &str) -> anyhow::Result<Url> {
31+
fn construct_url(&self, endpoint: &str) -> Result<Url, Box<dyn Error>> {
3132
Ok(Url::parse(&self.base_url)?.join(endpoint)?)
3233
}
3334
}
@@ -45,7 +46,7 @@ impl EclairNode {
4546
client: &Client,
4647
endpoint: &str,
4748
params: Option<HashMap<String, String>>,
48-
) -> anyhow::Result<T> {
49+
) -> Result<T, Box<dyn Error>> {
4950
let url = connection.construct_url(endpoint)?;
5051
let mut request = client
5152
.request(Method::POST, url)
@@ -73,7 +74,7 @@ impl EclairNode {
7374
&self,
7475
endpoint: &str,
7576
params: Option<HashMap<String, String>>,
76-
) -> anyhow::Result<T> {
77+
) -> Result<T, Box<dyn Error>> {
7778
EclairNode::request_static(&self.connection, &self.http_client, endpoint, params).await
7879
}
7980

0 commit comments

Comments
 (0)