lsp_plugin: rename cmds and opts to fit convention

We use `experimental-*` for documented commands instead of `dev-` which
are undocumented commands.

Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
This commit is contained in:
Peter Neuroth
2025-10-07 12:44:11 +02:00
committed by Rusty Russell
parent ce0be9dc87
commit 9e301f0f9c
5 changed files with 37 additions and 35 deletions

View File

@@ -30,7 +30,7 @@ use std::str::FromStr as _;
/// An option to enable this service.
const OPTION_ENABLED: options::FlagConfigOption = options::ConfigOption::new_flag(
"dev-lsps-client-enabled",
"experimental-lsps-client",
"Enables an LSPS client on the node.",
);

View File

@@ -95,10 +95,10 @@ impl ClnApi for ClnApiRpc {
params: &Lsps2PolicyGetInfoRequest,
) -> AnyResult<Lsps2PolicyGetInfoResponse> {
let mut rpc = self.create_rpc().await?;
rpc.call_raw("dev-lsps2-getpolicy", params)
rpc.call_raw("lsps2-policy-getpolicy", params)
.await
.map_err(anyhow::Error::new)
.with_context(|| "calling dev-lsps2-getpolicy")
.with_context(|| "calling lsps2-policy-getpolicy")
}
async fn lsps2_getchannelcapacity(
@@ -106,10 +106,10 @@ impl ClnApi for ClnApiRpc {
params: &Lsps2PolicyGetChannelCapacityRequest,
) -> AnyResult<Lsps2PolicyGetChannelCapacityResponse> {
let mut rpc = self.create_rpc().await?;
rpc.call_raw("dev-lsps2-getchannelcapacity", params)
rpc.call_raw("lsps2-policy-getchannelcapacity", params)
.await
.map_err(anyhow::Error::new)
.with_context(|| "calling dev-lsps2-getchannelcapacity")
.with_context(|| "calling lsps2-policy-getchannelcapacity")
}
async fn cln_getinfo(&self, params: &GetinfoRequest) -> AnyResult<GetinfoResponse> {
@@ -185,7 +185,7 @@ impl<A: ClnApi> Lsps2GetInfoHandler<A> {
}
}
/// The RequestHandler calls the internal rpc command `dev-lsps2-getinfo`. It
/// The RequestHandler calls the internal rpc command `lsps2-policy-getinfo`. It
/// expects a plugin has registered this command and manages policies for the
/// LSPS2 service.
#[async_trait]

View File

@@ -5,13 +5,13 @@ pub mod handler;
pub mod model;
pub const OPTION_ENABLED: options::FlagConfigOption = options::ConfigOption::new_flag(
"dev-lsps2-service-enabled",
"experimental-lsps2-service",
"Enables lsps2 for the LSP service",
);
pub const OPTION_PROMISE_SECRET: options::StringConfigOption =
options::ConfigOption::new_str_no_default(
"dev-lsps2-promise-secret",
"experimental-lsps2-promise-secret",
"A 64-character hex string that is the secret for promises",
);

View File

@@ -10,8 +10,8 @@ from datetime import datetime, timedelta, timezone
plugin = Plugin()
@plugin.method("dev-lsps2-getpolicy")
def lsps2_getpolicy(request):
@plugin.method("lsps2-policy-getpolicy")
def lsps2_policy_getpolicy(request):
"""Returns an opening fee menu for the LSPS2 plugin."""
now = datetime.now(timezone.utc)
@@ -42,8 +42,8 @@ def lsps2_getpolicy(request):
}
@plugin.method("dev-lsps2-getchannelcapacity")
def lsps2_getchannelcapacity(request, init_payment_size, scid, opening_fee_params):
@plugin.method("lsps2-policy-getchannelcapacity")
def lsps2_policy_getchannelcapacity(request, init_payment_size, scid, opening_fee_params):
"""Returns an opening fee menu for the LSPS2 plugin."""
return {"channel_capacity_msat": 100000000}

View File

@@ -22,7 +22,14 @@ def test_lsps_service_disabled(node_factory):
@unittest.skipUnless(RUST, 'RUST is not enabled')
def test_lsps0_listprotocols(node_factory):
l1, l2 = node_factory.get_nodes(
2, opts=[{"dev-lsps-client-enabled": None}, {"dev-lsps-service-enabled": None}]
2,
opts=[
{"experimental-lsps-client": None},
{
"experimental-lsps2-service": None,
"experimental-lsps2-promise-secret": "0" * 64,
},
],
)
# We don't need a channel to query for lsps services
@@ -36,11 +43,10 @@ def test_lsps2_enabled(node_factory):
l1, l2 = node_factory.get_nodes(
2,
opts=[
{"dev-lsps-client-enabled": None},
{"experimental-lsps-client": None},
{
"dev-lsps-service-enabled": None,
"dev-lsps2-service-enabled": None,
"dev-lsps2-promise-secret": "0" * 64,
"experimental-lsps2-service": None,
"experimental-lsps2-promise-secret": "0" * 64,
},
],
)
@@ -57,14 +63,13 @@ def test_lsps2_getinfo(node_factory):
l1, l2 = node_factory.get_nodes(
2,
opts=[
{"dev-lsps-client-enabled": None},
{"experimental-lsps-client": None},
{
"dev-lsps-service-enabled": None,
"dev-lsps2-service-enabled": None,
"dev-lsps2-promise-secret": "0" * 64,
"experimental-lsps2-service": None,
"experimental-lsps2-promise-secret": "0" * 64,
"plugin": plugin,
},
],
]
)
node_factory.join_nodes([l1, l2], fundchannel=False)
@@ -80,14 +85,13 @@ def test_lsps2_buy(node_factory):
l1, l2 = node_factory.get_nodes(
2,
opts=[
{"dev-lsps-client-enabled": None},
{"experimental-lsps-client": None},
{
"dev-lsps-service-enabled": None,
"dev-lsps2-service-enabled": None,
"dev-lsps2-promise-secret": "0" * 64,
"experimental-lsps2-service": None,
"experimental-lsps2-promise-secret": "0" * 64,
"plugin": plugin,
},
],
]
)
# We don't need a channel to query for lsps services
@@ -123,11 +127,10 @@ def test_lsps2_buyjitchannel_no_mpp_var_invoice(node_factory, bitcoind):
l1, l2, l3 = node_factory.get_nodes(
3,
opts=[
{"dev-lsps-client-enabled": None},
{"experimental-lsps-client": None},
{
"dev-lsps-service-enabled": None,
"dev-lsps2-service-enabled": None,
"dev-lsps2-promise-secret": "00" * 32,
"experimental-lsps2-service": None,
"experimental-lsps2-promise-secret": "0" * 64,
"plugin": plugin,
"fee-base": 0, # We are going to deduct our fee anyways,
"fee-per-satoshi": 0, # We are going to deduct our fee anyways,
@@ -199,11 +202,10 @@ def test_lsps2_non_approved_zero_conf(node_factory, bitcoind):
l1, l2, l3 = node_factory.get_nodes(
3,
opts=[
{"dev-lsps-client-enabled": None},
{"experimental-lsps-client": None},
{
"dev-lsps-service-enabled": None,
"dev-lsps2-service-enabled": None,
"dev-lsps2-promise-secret": "00" * 32,
"experimental-lsps2-service": None,
"experimental-lsps2-promise-secret": "0" * 64,
"plugin": plugin,
"fee-base": 0, # We are going to deduct our fee anyways,
"fee-per-satoshi": 0, # We are going to deduct our fee anyways,