Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions cln-grpc/proto/node.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 1 addition & 103 deletions cln-rpc/src/model.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions cln-rpc/src/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub enum ChannelState {
DUALOPEND_OPEN_COMMIT_READY = 13,
}

/// ['The first 10 states are for `out`, the next 10 are for `in`.']
#[derive(Copy, Clone, Serialize, Deserialize, Debug, PartialEq, Eq)]
#[allow(non_camel_case_types)]
pub enum HtlcState {
Expand Down Expand Up @@ -106,6 +107,19 @@ impl TryFrom<i32> for AutocleanSubsystem {
}
}

impl Display for AutocleanSubsystem {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
AutocleanSubsystem::SUCCEEDEDFORWARDS => write!(f, "SUCCEEDEDFORWARDS"),
AutocleanSubsystem::FAILEDFORWARDS => write!(f, "FAILEDFORWARDS"),
AutocleanSubsystem::SUCCEEDEDPAYS => write!(f, "SUCCEEDEDPAYS"),
AutocleanSubsystem::FAILEDPAYS => write!(f, "FAILEDPAYS"),
AutocleanSubsystem::PAIDINVOICES => write!(f, "PAIDINVOICES"),
AutocleanSubsystem::EXPIREDINVOICES => write!(f, "EXPIREDINVOICES"),
}
}
}

#[derive(Copy, Clone, Serialize, Deserialize, Debug)]
#[allow(non_camel_case_types)]
pub enum PluginSubcommand {
Expand Down Expand Up @@ -452,6 +466,27 @@ impl TryFrom<i32> for ChannelState {
}
}

impl Display for ChannelState {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
ChannelState::OPENINGD => write!(f, "OPENINGD"),
ChannelState::CHANNELD_AWAITING_LOCKIN => write!(f, "CHANNELD_AWAITING_LOCKIN"),
ChannelState::CHANNELD_NORMAL => write!(f, "CHANNELD_NORMAL"),
ChannelState::CHANNELD_SHUTTING_DOWN => write!(f, "CHANNELD_SHUTTING_DOWN"),
ChannelState::CLOSINGD_SIGEXCHANGE => write!(f, "CLOSINGD_SIGEXCHANGE"),
ChannelState::CLOSINGD_COMPLETE => write!(f, "CLOSINGD_COMPLETE"),
ChannelState::AWAITING_UNILATERAL => write!(f, "AWAITING_UNILATERAL"),
ChannelState::FUNDING_SPEND_SEEN => write!(f, "FUNDING_SPEND_SEEN"),
ChannelState::ONCHAIN => write!(f, "ONCHAIN"),
ChannelState::DUALOPEND_OPEN_INIT => write!(f, "DUALOPEND_OPEN_INIT"),
ChannelState::DUALOPEND_AWAITING_LOCKIN => write!(f, "DUALOPEND_AWAITING_LOCKIN"),
ChannelState::CHANNELD_AWAITING_SPLICE => write!(f, "CHANNELD_AWAITING_SPLICE"),
ChannelState::DUALOPEND_OPEN_COMMITTED => write!(f, "DUALOPEND_OPEN_COMMITTED"),
ChannelState::DUALOPEND_OPEN_COMMIT_READY => write!(f, "DUALOPEND_OPEN_COMMIT_READY"),
}
}
}

impl From<i32> for ChannelTypeName {
fn from(value: i32) -> Self {
match value {
Expand Down Expand Up @@ -479,6 +514,21 @@ impl From<ChannelTypeName> for i32 {
}
}

impl Display for ChannelTypeName {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
ChannelTypeName::STATIC_REMOTEKEY_EVEN => write!(f, "STATIC_REMOTEKEY_EVEN"),
ChannelTypeName::ANCHOR_OUTPUTS_EVEN => write!(f, "ANCHOR_OUTPUTS_EVEN"),
ChannelTypeName::ANCHORS_ZERO_FEE_HTLC_TX_EVEN => {
write!(f, "ANCHORS_ZERO_FEE_HTLC_TX_EVEN")
}
ChannelTypeName::SCID_ALIAS_EVEN => write!(f, "SCID_ALIAS_EVEN"),
ChannelTypeName::ZEROCONF_EVEN => write!(f, "ZEROCONF_EVEN"),
ChannelTypeName::ANCHORS_EVEN => write!(f, "ANCHORS_EVEN"),
}
}
}

impl From<i32> for HtlcState {
fn from(value: i32) -> Self {
match value {
Expand Down Expand Up @@ -508,6 +558,33 @@ impl From<i32> for HtlcState {
}
}

impl Display for HtlcState {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
HtlcState::SENT_ADD_HTLC => write!(f, "SENT_ADD_HTLC"),
HtlcState::SENT_ADD_COMMIT => write!(f, "SENT_ADD_COMMIT"),
HtlcState::RCVD_ADD_REVOCATION => write!(f, "RCVD_ADD_REVOCATION"),
HtlcState::RCVD_ADD_ACK_COMMIT => write!(f, "RCVD_ADD_ACK_COMMIT"),
HtlcState::SENT_ADD_ACK_REVOCATION => write!(f, "SENT_ADD_ACK_REVOCATION"),
HtlcState::RCVD_ADD_ACK_REVOCATION => write!(f, "RCVD_ADD_ACK_REVOCATION"),
HtlcState::RCVD_REMOVE_HTLC => write!(f, "RCVD_REMOVE_HTLC"),
HtlcState::RCVD_REMOVE_COMMIT => write!(f, "RCVD_REMOVE_COMMIT"),
HtlcState::SENT_REMOVE_REVOCATION => write!(f, "SENT_REMOVE_REVOCATION"),
HtlcState::SENT_REMOVE_ACK_COMMIT => write!(f, "SENT_REMOVE_ACK_COMMIT"),
HtlcState::RCVD_REMOVE_ACK_REVOCATION => write!(f, "RCVD_REMOVE_ACK_REVOCATION"),
HtlcState::RCVD_ADD_HTLC => write!(f, "RCVD_ADD_HTLC"),
HtlcState::RCVD_ADD_COMMIT => write!(f, "RCVD_ADD_COMMIT"),
HtlcState::SENT_ADD_REVOCATION => write!(f, "SENT_ADD_REVOCATION"),
HtlcState::SENT_ADD_ACK_COMMIT => write!(f, "SENT_ADD_ACK_COMMIT"),
HtlcState::SENT_REMOVE_HTLC => write!(f, "SENT_REMOVE_HTLC"),
HtlcState::SENT_REMOVE_COMMIT => write!(f, "SENT_REMOVE_COMMIT"),
HtlcState::RCVD_REMOVE_REVOCATION => write!(f, "RCVD_REMOVE_REVOCATION"),
HtlcState::RCVD_REMOVE_ACK_COMMIT => write!(f, "RCVD_REMOVE_ACK_COMMIT"),
HtlcState::SENT_REMOVE_ACK_REVOCATION => write!(f, "SENT_REMOVE_ACK_REVOCATION"),
}
}
}

impl<'de> Deserialize<'de> for Amount {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
Expand Down
1 change: 1 addition & 0 deletions contrib/msggen/msggen/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ class OverridePatch(Patch):
"channel_state_changed.old_state": "ChannelState",
"channel_state_changed.new_state": "ChannelState",
"ListPeerChannels.channels[].state": "ChannelState",
"Wait.htlcs.state": "HtlcState",
}

def visit(self, f: model.Field, parent: Optional[model.Field] = None) -> None:
Expand Down
4 changes: 2 additions & 2 deletions contrib/msggen/msggen/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21056,7 +21056,7 @@
"SENT_REMOVE_ACK_REVOCATION"
],
"description": [
"The first 10 states are for `in`, the next 10 are for `out`."
"The first 10 states are for `out`, the next 10 are for `in`."
]
}
}
Expand Down Expand Up @@ -34660,7 +34660,7 @@
],
"added": "v25.05",
"description": [
"The first 10 states are for `in`, the next 10 are for `out`."
"The first 10 states are for `out`, the next 10 are for `in`."
]
},
"htlc_id": {
Expand Down
818 changes: 408 additions & 410 deletions contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/schemas/listhtlcs.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"SENT_REMOVE_ACK_REVOCATION"
],
"description": [
"The first 10 states are for `in`, the next 10 are for `out`."
"The first 10 states are for `out`, the next 10 are for `in`."
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion doc/schemas/wait.json
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@
],
"added": "v25.05",
"description": [
"The first 10 states are for `in`, the next 10 are for `out`."
"The first 10 states are for `out`, the next 10 are for `in`."
]
},
"htlc_id": {
Expand Down
Loading