(
&self,
request: tonic::Request<pb::FetchinvoiceRequest>,
)
| 1973 | } |
| 1974 | |
| 1975 | async fn fetch_invoice( |
| 1976 | &self, |
| 1977 | request: tonic::Request<pb::FetchinvoiceRequest>, |
| 1978 | ) -> Result<tonic::Response<pb::FetchinvoiceResponse>, tonic::Status> { |
| 1979 | let req = request.into_inner(); |
| 1980 | let req: requests::FetchinvoiceRequest = req.try_into()?; |
| 1981 | debug!("Client asked for fetch_invoice"); |
| 1982 | trace!("fetch_invoice request: {:?}", req); |
| 1983 | let mut rpc = ClnRpc::new(&self.rpc_path) |
| 1984 | .await |
| 1985 | .map_err(|e| Status::new(Code::Internal, e.to_string()))?; |
| 1986 | let result = rpc.call(Request::FetchInvoice(req)) |
| 1987 | .await |
| 1988 | .map_err(|e| Status::new( |
| 1989 | Code::Unknown, |
| 1990 | format!("Error calling method FetchInvoice: {:?}", e)))?; |
| 1991 | match result { |
| 1992 | Response::FetchInvoice(r) => { |
| 1993 | trace!("fetch_invoice response: {:?}", r); |
| 1994 | Ok(tonic::Response::new(r.into())) |
| 1995 | }, |
| 1996 | r => Err(Status::new( |
| 1997 | Code::Internal, |
| 1998 | format!( |
| 1999 | "Unexpected result {:?} to method call FetchInvoice", |
| 2000 | r |
| 2001 | ) |
| 2002 | )), |
| 2003 | } |
| 2004 | |
| 2005 | } |
| 2006 | |
| 2007 | async fn cancel_recurring_invoice( |
| 2008 | &self, |
nothing calls this directly
no test coverage detected