(
&self,
request: tonic::Request<pb::InvoiceRequest>,
)
| 851 | } |
| 852 | |
| 853 | async fn invoice( |
| 854 | &self, |
| 855 | request: tonic::Request<pb::InvoiceRequest>, |
| 856 | ) -> Result<tonic::Response<pb::InvoiceResponse>, tonic::Status> { |
| 857 | let req = request.into_inner(); |
| 858 | let req: requests::InvoiceRequest = req.try_into()?; |
| 859 | debug!("Client asked for invoice"); |
| 860 | trace!("invoice request: {:?}", req); |
| 861 | let mut rpc = ClnRpc::new(&self.rpc_path) |
| 862 | .await |
| 863 | .map_err(|e| Status::new(Code::Internal, e.to_string()))?; |
| 864 | let result = rpc.call(Request::Invoice(req)) |
| 865 | .await |
| 866 | .map_err(|e| Status::new( |
| 867 | Code::Unknown, |
| 868 | format!("Error calling method Invoice: {:?}", e)))?; |
| 869 | match result { |
| 870 | Response::Invoice(r) => { |
| 871 | trace!("invoice response: {:?}", r); |
| 872 | Ok(tonic::Response::new(r.into())) |
| 873 | }, |
| 874 | r => Err(Status::new( |
| 875 | Code::Internal, |
| 876 | format!( |
| 877 | "Unexpected result {:?} to method call Invoice", |
| 878 | r |
| 879 | ) |
| 880 | )), |
| 881 | } |
| 882 | |
| 883 | } |
| 884 | |
| 885 | async fn create_invoice_request( |
| 886 | &self, |
nothing calls this directly
no test coverage detected