(
&self,
request: tonic::Request<pb::GetinfoRequest>,
)
| 83 | impl Node for Server |
| 84 | { |
| 85 | async fn getinfo( |
| 86 | &self, |
| 87 | request: tonic::Request<pb::GetinfoRequest>, |
| 88 | ) -> Result<tonic::Response<pb::GetinfoResponse>, tonic::Status> { |
| 89 | let req = request.into_inner(); |
| 90 | let req: requests::GetinfoRequest = req.into(); |
| 91 | debug!("Client asked for getinfo"); |
| 92 | trace!("getinfo request: {:?}", req); |
| 93 | let mut rpc = ClnRpc::new(&self.rpc_path) |
| 94 | .await |
| 95 | .map_err(|e| Status::new(Code::Internal, e.to_string()))?; |
| 96 | let result = rpc.call(Request::Getinfo(req)) |
| 97 | .await |
| 98 | .map_err(|e| Status::new( |
| 99 | Code::Unknown, |
| 100 | format!("Error calling method Getinfo: {:?}", e)))?; |
| 101 | match result { |
| 102 | Response::Getinfo(r) => { |
| 103 | trace!("getinfo response: {:?}", r); |
| 104 | Ok(tonic::Response::new(r.into())) |
| 105 | }, |
| 106 | r => Err(Status::new( |
| 107 | Code::Internal, |
| 108 | format!( |
| 109 | "Unexpected result {:?} to method call Getinfo", |
| 110 | r |
| 111 | ) |
| 112 | )), |
| 113 | } |
| 114 | |
| 115 | } |
| 116 | |
| 117 | async fn list_peers( |
| 118 | &self, |
nothing calls this directly
no test coverage detected