| 187 | } |
| 188 | |
| 189 | async fn add_gossip( |
| 190 | &self, |
| 191 | request: tonic::Request<pb::AddgossipRequest>, |
| 192 | ) -> Result<tonic::Response<pb::AddgossipResponse>, tonic::Status> { |
| 193 | let req = request.into_inner(); |
| 194 | let req: requests::AddgossipRequest = req.into(); |
| 195 | debug!("Client asked for add_gossip"); |
| 196 | trace!("add_gossip request: {:?}", req); |
| 197 | let mut rpc = ClnRpc::new(&self.rpc_path) |
| 198 | .await |
| 199 | .map_err(|e| Status::new(Code::Internal, e.to_string()))?; |
| 200 | let result = rpc.call(Request::AddGossip(req)) |
| 201 | .await |
| 202 | .map_err(|e| Status::new( |
| 203 | Code::Unknown, |
| 204 | format!("Error calling method AddGossip: {:?}", e)))?; |
| 205 | match result { |
| 206 | Response::AddGossip(r) => { |
| 207 | trace!("add_gossip response: {:?}", r); |
| 208 | Ok(tonic::Response::new(r.into())) |
| 209 | }, |
| 210 | r => Err(Status::new( |
| 211 | Code::Internal, |
| 212 | format!( |
| 213 | "Unexpected result {:?} to method call AddGossip", |
| 214 | r |
| 215 | ) |
| 216 | )), |
| 217 | } |
| 218 | |
| 219 | } |
| 220 | |
| 221 | async fn auto_clean_invoice( |
| 222 | &self, |