MCPcopy Create free account
hub / github.com/ElementsProject/lightning / invoice

Method invoice

cln-grpc/src/server.rs:853–883  ·  view source on GitHub ↗
(
        &self,
        request: tonic::Request<pb::InvoiceRequest>,
    )

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 4

InvoiceClass · 0.85
into_innerMethod · 0.80
to_stringMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected