Skip to content

Commit e5140e6

Browse files
committed
update: make sub-clients stored in Lnd Struct public to avoid complete reliance on proxy methods
1 parent d1595d1 commit e5140e6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/lib.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ use tonic::{
3131

3232
#[derive(Debug, Clone)]
3333
pub struct Lnd {
34-
lightning: LightningClient<InterceptedService<Channel, LndInterceptor>>,
35-
invoices: InvoicesClient<InterceptedService<Channel, LndInterceptor>>,
36-
router: RouterClient<InterceptedService<Channel, LndInterceptor>>,
34+
pub lightning: LightningClient<InterceptedService<Channel, LndInterceptor>>,
35+
pub invoices: InvoicesClient<InterceptedService<Channel, LndInterceptor>>,
36+
pub router: RouterClient<InterceptedService<Channel, LndInterceptor>>,
3737
}
3838

3939
#[derive(Debug, thiserror::Error)]
@@ -136,7 +136,7 @@ impl Lnd {
136136
}
137137

138138
#[derive(Debug, Clone)]
139-
struct LndInterceptor {
139+
pub struct LndInterceptor {
140140
macaroon: Option<MetadataValue<Ascii>>,
141141
}
142142

@@ -162,6 +162,7 @@ impl Interceptor for LndInterceptor {
162162
}
163163

164164
impl Lnd {
165+
165166
pub async fn get_info(&mut self) -> Result<GetInfoResponse, Status> {
166167
self.lightning
167168
.get_info(GetInfoRequest {})
@@ -254,6 +255,7 @@ impl Lnd {
254255
.await
255256
.map(Response::into_inner)
256257
}
258+
257259
}
258260

259261
impl Lnd {

0 commit comments

Comments
 (0)