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

Method plugin

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

Source from the content-addressed store, hash-verified

2710 }
2711
2712 async fn plugin(
2713 &self,
2714 request: tonic::Request<pb::PluginRequest>,
2715 ) -> Result<tonic::Response<pb::PluginResponse>, tonic::Status> {
2716 let req = request.into_inner();
2717 let req: requests::PluginRequest = req.try_into()?;
2718 debug!("Client asked for plugin");
2719 trace!("plugin request: {:?}", req);
2720 let mut rpc = ClnRpc::new(&self.rpc_path)
2721 .await
2722 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
2723 let result = rpc.call(Request::Plugin(req))
2724 .await
2725 .map_err(|e| Status::new(
2726 Code::Unknown,
2727 format!("Error calling method Plugin: {:?}", e)))?;
2728 match result {
2729 Response::Plugin(r) => {
2730 trace!("plugin response: {:?}", r);
2731 Ok(tonic::Response::new(r.into()))
2732 },
2733 r => Err(Status::new(
2734 Code::Internal,
2735 format!(
2736 "Unexpected result {:?} to method call Plugin",
2737 r
2738 )
2739 )),
2740 }
2741
2742 }
2743
2744 async fn rene_pay_status(
2745 &self,

Callers 3

test_no_auto_startFunction · 0.80
test_plugin_startFunction · 0.80

Calls 4

into_innerMethod · 0.80
PluginClass · 0.50
to_stringMethod · 0.45
callMethod · 0.45

Tested by 3

test_no_auto_startFunction · 0.64
test_plugin_startFunction · 0.64