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

Method ping

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

Source from the content-addressed store, hash-verified

2678 }
2679
2680 async fn ping(
2681 &self,
2682 request: tonic::Request<pb::PingRequest>,
2683 ) -> Result<tonic::Response<pb::PingResponse>, tonic::Status> {
2684 let req = request.into_inner();
2685 let req: requests::PingRequest = req.try_into()?;
2686 debug!("Client asked for ping");
2687 trace!("ping request: {:?}", req);
2688 let mut rpc = ClnRpc::new(&self.rpc_path)
2689 .await
2690 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
2691 let result = rpc.call(Request::Ping(req))
2692 .await
2693 .map_err(|e| Status::new(
2694 Code::Unknown,
2695 format!("Error calling method Ping: {:?}", e)))?;
2696 match result {
2697 Response::Ping(r) => {
2698 trace!("ping response: {:?}", r);
2699 Ok(tonic::Response::new(r.into()))
2700 },
2701 r => Err(Status::new(
2702 Code::Internal,
2703 format!(
2704 "Unexpected result {:?} to method call Ping",
2705 r
2706 )
2707 )),
2708 }
2709
2710 }
2711
2712 async fn plugin(
2713 &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