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

Method pay

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

Source from the content-addressed store, hash-verified

1171 }
1172
1173 async fn pay(
1174 &self,
1175 request: tonic::Request<pb::PayRequest>,
1176 ) -> Result<tonic::Response<pb::PayResponse>, tonic::Status> {
1177 let req = request.into_inner();
1178 #[allow(deprecated)]
1179 let req: requests::PayRequest = req.try_into()?;
1180 debug!("Client asked for pay");
1181 trace!("pay request: {:?}", req);
1182 let mut rpc = ClnRpc::new(&self.rpc_path)
1183 .await
1184 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
1185 let result = rpc.call(Request::Pay(req))
1186 .await
1187 .map_err(|e| Status::new(
1188 Code::Unknown,
1189 format!("Error calling method Pay: {:?}", e)))?;
1190 match result {
1191 Response::Pay(r) => {
1192 trace!("pay response: {:?}", r);
1193 Ok(tonic::Response::new(r.into()))
1194 },
1195 r => Err(Status::new(
1196 Code::Internal,
1197 format!(
1198 "Unexpected result {:?} to method call Pay",
1199 r
1200 )
1201 )),
1202 }
1203
1204 }
1205
1206 async fn list_nodes(
1207 &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