mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 10:46:58 +01:00
cln_plugin: Configure "dynamic" field in "getmanifest" message
This commit is contained in:
parent
71cd07ea61
commit
42783aaa92
2 changed files with 10 additions and 0 deletions
|
@ -48,6 +48,7 @@ where
|
|||
configuration: Option<Configuration>,
|
||||
rpcmethods: HashMap<String, RpcMethod<S>>,
|
||||
subscriptions: HashMap<String, Subscription<S>>,
|
||||
dynamic: bool,
|
||||
}
|
||||
|
||||
impl<S, I, O> Builder<S, I, O>
|
||||
|
@ -66,6 +67,7 @@ where
|
|||
options: vec![],
|
||||
configuration: None,
|
||||
rpcmethods: HashMap::new(),
|
||||
dynamic: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,6 +144,12 @@ where
|
|||
self
|
||||
}
|
||||
|
||||
/// Send true value for "dynamic" field in "getmanifest" response
|
||||
pub fn dynamic(mut self) -> Builder<S, I, O> {
|
||||
self.dynamic = true;
|
||||
self
|
||||
}
|
||||
|
||||
/// Communicate with `lightningd` to tell it about our options,
|
||||
/// RPC methods and subscribe to hooks, and then process the
|
||||
/// initialization, configuring the plugin.
|
||||
|
@ -280,6 +288,7 @@ where
|
|||
subscriptions: self.subscriptions.keys().map(|s| s.clone()).collect(),
|
||||
hooks: self.hooks.keys().map(|s| s.clone()).collect(),
|
||||
rpcmethods,
|
||||
dynamic: self.dynamic,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -156,6 +156,7 @@ pub(crate) struct GetManifestResponse {
|
|||
pub(crate) rpcmethods: Vec<RpcMethod>,
|
||||
pub(crate) subscriptions: Vec<String>,
|
||||
pub(crate) hooks: Vec<String>,
|
||||
pub(crate) dynamic: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Default, Debug)]
|
||||
|
|
Loading…
Add table
Reference in a new issue