(
&self,
request: tonic::Request<pb::SendinvoiceRequest>,
)
| 2872 | } |
| 2873 | |
| 2874 | async fn send_invoice( |
| 2875 | &self, |
| 2876 | request: tonic::Request<pb::SendinvoiceRequest>, |
| 2877 | ) -> Result<tonic::Response<pb::SendinvoiceResponse>, tonic::Status> { |
| 2878 | let req = request.into_inner(); |
| 2879 | let req: requests::SendinvoiceRequest = req.try_into()?; |
| 2880 | debug!("Client asked for send_invoice"); |
| 2881 | trace!("send_invoice request: {:?}", req); |
| 2882 | let mut rpc = ClnRpc::new(&self.rpc_path) |
| 2883 | .await |
| 2884 | .map_err(|e| Status::new(Code::Internal, e.to_string()))?; |
| 2885 | let result = rpc.call(Request::SendInvoice(req)) |
| 2886 | .await |
| 2887 | .map_err(|e| Status::new( |
| 2888 | Code::Unknown, |
| 2889 | format!("Error calling method SendInvoice: {:?}", e)))?; |
| 2890 | match result { |
| 2891 | Response::SendInvoice(r) => { |
| 2892 | trace!("send_invoice response: {:?}", r); |
| 2893 | Ok(tonic::Response::new(r.into())) |
| 2894 | }, |
| 2895 | r => Err(Status::new( |
| 2896 | Code::Internal, |
| 2897 | format!( |
| 2898 | "Unexpected result {:?} to method call SendInvoice", |
| 2899 | r |
| 2900 | ) |
| 2901 | )), |
| 2902 | } |
| 2903 | |
| 2904 | } |
| 2905 | |
| 2906 | async fn set_channel( |
| 2907 | &self, |
nothing calls this directly
no test coverage detected