| 91 | } |
| 92 | |
| 93 | async fn list_funds( |
| 94 | &self, |
| 95 | request: tonic::Request<pb::ListfundsRequest>, |
| 96 | ) -> Result<tonic::Response<pb::ListfundsResponse>, tonic::Status> { |
| 97 | let req = request.into_inner(); |
| 98 | let req: requests::ListfundsRequest = req.into(); |
| 99 | debug!("Client asked for list_funds"); |
| 100 | trace!("list_funds request: {:?}", req); |
| 101 | let mut rpc = ClnRpc::new(&self.rpc_path) |
| 102 | .await |
| 103 | .map_err(|e| Status::new(Code::Internal, e.to_string()))?; |
| 104 | let result = rpc.call(Request::ListFunds(req)) |
| 105 | .await |
| 106 | .map_err(|e| Status::new( |
| 107 | Code::Unknown, |
| 108 | format!("Error calling method ListFunds: {:?}", e)))?; |
| 109 | match result { |
| 110 | Response::ListFunds(r) => { |
| 111 | trace!("list_funds response: {:?}", r); |
| 112 | Ok(tonic::Response::new(r.into())) |
| 113 | }, |
| 114 | r => Err(Status::new( |
| 115 | Code::Internal, |
| 116 | format!( |
| 117 | "Unexpected result {:?} to method call ListFunds", |
| 118 | r |
| 119 | ) |
| 120 | )), |
| 121 | } |
| 122 | |
| 123 | } |
| 124 | |
| 125 | async fn send_pay( |
| 126 | &self, |