Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
Schema / gen updates for listpeerchannels
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyGiorgio committed Apr 26, 2023
1 parent 15795c9 commit 8f78834
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 10 deletions.
8 changes: 8 additions & 0 deletions contrib/msggen/msggen/gen/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
'ListPeers.peers[].channels[].opener': "ChannelSide",
'ListPeers.peers[].channels[].closer': "ChannelSide",
'ListPeers.peers[].channels[].features[]': "string",
'ListPeerChannels.channels[].state_changes[]': None,
'ListPeerChannels.channels[].htlcs[].state': None,
'ListPeerChannels.channels[].opener': "ChannelSide",
'ListPeerChannels.channels[].closer': "ChannelSide",
'ListPeerChannels.channels[].features[]': "string",
'ListPeerChannels.channels[].channel_type.names[]': "string",
'ListFunds.channels[].state': 'ChannelState',
'ListTransactions.transactions[].type[]': None,
}
Expand Down Expand Up @@ -454,6 +460,8 @@ def generate_composite(self, prefix, field: CompositeField) -> None:
elif isinstance(f, EnumField):
if f.path == 'ListPeers.peers[].channels[].htlcs[].state':
continue
if f.path == 'ListPeerChannels.channels[].htlcs[].state':
continue
if not f.optional:
self.write(f"{name}: c.{name}.try_into().unwrap(),\n", numindent=3)
else:
Expand Down
8 changes: 8 additions & 0 deletions contrib/msggen/msggen/gen/rust.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
'ListPeers.peers[].channels[].opener': "ChannelSide",
'ListPeers.peers[].channels[].closer': "ChannelSide",
'ListPeers.peers[].channels[].features[]': "string",
'ListPeerChannels.channels[].state_changes[].old_state': "ChannelState",
'ListPeerChannels.channels[].state_changes[].new_state': "ChannelState",
'ListPeerChannels.channels[].state_changes[].cause': "ChannelStateChangeCause",
'ListPeerChannels.channels[].htlcs[].state': None,
'ListPeerChannels.channels[].opener': "ChannelSide",
'ListPeerChannels.channels[].closer': "ChannelSide",
'ListPeerChannels.channels[].features[]': "string",
'ListPeerChannels.channels[].channel_type.names[]': "string",
'ListFunds.channels[].state': 'ChannelState',
'ListTransactions.transactions[].type[]': None,
'Invoice.exposeprivatechannels': None,
Expand Down
1 change: 1 addition & 0 deletions contrib/msggen/msggen/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def load_jsonrpc_service(schema_dir: str):
method_names = [
"Getinfo",
"ListPeers",
"ListPeerChannels",
"ListFunds",
"SendPay",
"ListChannels",
Expand Down
10 changes: 5 additions & 5 deletions doc/schemas/listclosedchannels.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@
"items": {
"type": "string",
"enum": [
"static_remotekey/even",
"anchor_outputs/even",
"anchors_zero_fee_htlc_tx/even",
"scid_alias/even",
"zeroconf/even"
"static_remotekey_even",
"anchor_outputs_even",
"anchors_zero_fee_htlc_tx_even",
"scid_alias_even",
"zeroconf_even"
],
"description": "Name of feature bit"
}
Expand Down
2 changes: 2 additions & 0 deletions doc/schemas/listpeerchannels.request.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"added": "v23.05",
"required": [],
"additionalProperties": false,
"properties": {
"id": {
"added": "v23.05",
"type": "pubkey",
"description": "If supplied, limits the channels to just the peer with the given ID, if it exists."
}
Expand Down
Loading

0 comments on commit 8f78834

Please sign in to comment.