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

Method sign_invoice

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

Source from the content-addressed store, hash-verified

3000 }
3001
3002 async fn sign_invoice(
3003 &self,
3004 request: tonic::Request<pb::SigninvoiceRequest>,
3005 ) -> Result<tonic::Response<pb::SigninvoiceResponse>, tonic::Status> {
3006 let req = request.into_inner();
3007 let req: requests::SigninvoiceRequest = req.try_into()?;
3008 debug!("Client asked for sign_invoice");
3009 trace!("sign_invoice request: {:?}", req);
3010 let mut rpc = ClnRpc::new(&self.rpc_path)
3011 .await
3012 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
3013 let result = rpc.call(Request::SignInvoice(req))
3014 .await
3015 .map_err(|e| Status::new(
3016 Code::Unknown,
3017 format!("Error calling method SignInvoice: {:?}", e)))?;
3018 match result {
3019 Response::SignInvoice(r) => {
3020 trace!("sign_invoice response: {:?}", r);
3021 Ok(tonic::Response::new(r.into()))
3022 },
3023 r => Err(Status::new(
3024 Code::Internal,
3025 format!(
3026 "Unexpected result {:?} to method call SignInvoice",
3027 r
3028 )
3029 )),
3030 }
3031
3032 }
3033
3034 async fn sign_message(
3035 &self,

Callers

nothing calls this directly

Calls 3

into_innerMethod · 0.80
to_stringMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected