@@ -11,6 +11,7 @@ use reqwest::{Client, Method, Url};
11
11
use serde:: { Deserialize , Serialize } ;
12
12
use serde_json:: Value ;
13
13
use std:: collections:: HashMap ;
14
+ use std:: error:: Error ;
14
15
use std:: str:: FromStr ;
15
16
use std:: time:: Duration ;
16
17
use tokio:: time;
@@ -27,7 +28,7 @@ pub struct EclairConnection {
27
28
}
28
29
29
30
impl EclairConnection {
30
- fn construct_url ( & self , endpoint : & str ) -> anyhow :: Result < Url > {
31
+ fn construct_url ( & self , endpoint : & str ) -> Result < Url , Box < dyn Error > > {
31
32
Ok ( Url :: parse ( & self . base_url ) ?. join ( endpoint) ?)
32
33
}
33
34
}
@@ -45,7 +46,7 @@ impl EclairNode {
45
46
client : & Client ,
46
47
endpoint : & str ,
47
48
params : Option < HashMap < String , String > > ,
48
- ) -> anyhow :: Result < T > {
49
+ ) -> Result < T , Box < dyn Error > > {
49
50
let url = connection. construct_url ( endpoint) ?;
50
51
let mut request = client
51
52
. request ( Method :: POST , url)
@@ -73,7 +74,7 @@ impl EclairNode {
73
74
& self ,
74
75
endpoint : & str ,
75
76
params : Option < HashMap < String , String > > ,
76
- ) -> anyhow :: Result < T > {
77
+ ) -> Result < T , Box < dyn Error > > {
77
78
EclairNode :: request_static ( & self . connection , & self . http_client , endpoint, params) . await
78
79
}
79
80
0 commit comments