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

Function testoptions

plugins/examples/cln-plugin-startup.rs:116–132  ·  view source on GitHub ↗
(p: Plugin<()>, _v: serde_json::Value)

Source from the content-addressed store, hash-verified

114}
115
116async fn testoptions(p: Plugin<()>, _v: serde_json::Value) -> Result<serde_json::Value, Error> {
117 let test_option = p.option(&TEST_OPTION)?;
118 let test_option_no_default = p.option(&TEST_OPTION_NO_DEFAULT)?;
119 let test_multi_str_option = p.option(&TEST_MULTI_STR_OPTION)?;
120 let test_multi_str_option_default = p.option(&TEST_MULTI_STR_OPTION_DEFAULT)?;
121 let test_multi_i64_option = p.option(&TEST_MULTI_I64_OPTION)?;
122 let test_multi_i64_option_default = p.option(&TEST_MULTI_I64_OPTION_DEFAULT)?;
123
124 Ok(json!({
125 "test-option": test_option,
126 "opt-option" : test_option_no_default,
127 "multi-str-option": test_multi_str_option,
128 "multi-str-option-default": test_multi_str_option_default,
129 "multi-i64-option": test_multi_i64_option,
130 "multi-i64-option-default": test_multi_i64_option_default,
131 }))
132}
133
134async fn testmethod(_p: Plugin<()>, _v: serde_json::Value) -> Result<serde_json::Value, Error> {
135 Ok(json!("Hello"))

Callers

nothing calls this directly

Calls 1

optionMethod · 0.80

Tested by

no test coverage detected