(
&self,
request: tonic::Request<pb::ListpeersRequest>,
)
| 115 | } |
| 116 | |
| 117 | async fn list_peers( |
| 118 | &self, |
| 119 | request: tonic::Request<pb::ListpeersRequest>, |
| 120 | ) -> Result<tonic::Response<pb::ListpeersResponse>, tonic::Status> { |
| 121 | let req = request.into_inner(); |
| 122 | let req: requests::ListpeersRequest = req.into(); |
| 123 | debug!("Client asked for list_peers"); |
| 124 | trace!("list_peers request: {:?}", req); |
| 125 | let mut rpc = ClnRpc::new(&self.rpc_path) |
| 126 | .await |
| 127 | .map_err(|e| Status::new(Code::Internal, e.to_string()))?; |
| 128 | let result = rpc.call(Request::ListPeers(req)) |
| 129 | .await |
| 130 | .map_err(|e| Status::new( |
| 131 | Code::Unknown, |
| 132 | format!("Error calling method ListPeers: {:?}", e)))?; |
| 133 | match result { |
| 134 | Response::ListPeers(r) => { |
| 135 | trace!("list_peers response: {:?}", r); |
| 136 | Ok(tonic::Response::new(r.into())) |
| 137 | }, |
| 138 | r => Err(Status::new( |
| 139 | Code::Internal, |
| 140 | format!( |
| 141 | "Unexpected result {:?} to method call ListPeers", |
| 142 | r |
| 143 | ) |
| 144 | )), |
| 145 | } |
| 146 | |
| 147 | } |
| 148 | |
| 149 | async fn list_funds( |
| 150 | &self, |
nothing calls this directly
no test coverage detected