lightningd: deprecate p2sh-segwit addresses for newaddr addresstype

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Deprecated: JSON-RPC: `newaddr`: `addresstype` `p2sh-segwit` (use default, or `bech32`).
This commit is contained in:
Rusty Russell
2023-01-13 11:10:35 +10:30
parent 2f36c03307
commit 932ca9e91f
8 changed files with 134 additions and 141 deletions

6
cln-rpc/src/model.rs generated
View File

@@ -809,8 +809,6 @@ pub mod requests {
pub enum NewaddrAddresstype {
#[serde(rename = "bech32")]
BECH32,
#[serde(rename = "p2sh-segwit")]
P2SH_SEGWIT,
#[serde(rename = "all")]
ALL,
}
@@ -820,8 +818,7 @@ pub mod requests {
fn try_from(c: i32) -> Result<NewaddrAddresstype, anyhow::Error> {
match c {
0 => Ok(NewaddrAddresstype::BECH32),
1 => Ok(NewaddrAddresstype::P2SH_SEGWIT),
2 => Ok(NewaddrAddresstype::ALL),
1 => Ok(NewaddrAddresstype::ALL),
o => Err(anyhow::anyhow!("Unknown variant {} for enum NewaddrAddresstype", o)),
}
}
@@ -3165,6 +3162,7 @@ pub mod responses {
pub struct NewaddrResponse {
#[serde(alias = "bech32", skip_serializing_if = "Option::is_none")]
pub bech32: Option<String>,
#[deprecated]
#[serde(alias = "p2sh-segwit", skip_serializing_if = "Option::is_none")]
pub p2sh_segwit: Option<String>,
}