msggen : Add notification-messages to proto-file

This commit is contained in:
Erik De Smedt 2024-02-08 11:32:36 +01:00 committed by Christian Decker
parent c5a47c3149
commit 686dae2b9f
4 changed files with 102 additions and 3 deletions

View file

@ -685,6 +685,19 @@
"Bkpr-listincomeResponse": {
"Bkpr-ListIncome.income_events[]": 1
},
"BlockAddedNotification": {
"block_added.hash": 1,
"block_added.height": 2
},
"ChannelOpenFailedNotification": {
"channel_open_failed.channel_id": 1
},
"ChannelOpenedNotification": {
"channel_opened.channel_ready": 4,
"channel_opened.funding_msat": 2,
"channel_opened.funding_txid": 3,
"channel_opened.id": 1
},
"CheckmessageRequest": {
"CheckMessage.message": 1,
"CheckMessage.pubkey": 3,
@ -714,6 +727,11 @@
"Connect.address.socket": 2,
"Connect.address.type": 1
},
"ConnectNotification": {
"connect.address": 3,
"connect.direction": 2,
"connect.id": 1
},
"ConnectRequest": {
"Connect.host": 2,
"Connect.id": 1,
@ -767,6 +785,10 @@
"CreateOnion.onion": 1,
"CreateOnion.shared_secrets[]": 2
},
"CustomMsgNotification": {
"custommsg.payload": 2,
"custommsg.peer_id": 1
},
"DatastoreRequest": {
"Datastore.generation": 4,
"Datastore.hex": 2,

View file

@ -2769,3 +2769,50 @@ message BkprlistincomeIncome_events {
optional bytes txid = 9;
optional bytes payment_id = 10;
}
message StreamBlockAddedRequest {
}
message BlockAddedNotification {
bytes hash = 1;
uint32 height = 2;
}
message StreamChannelOpenFailedRequest {
}
message ChannelOpenFailedNotification {
bytes channel_id = 1;
}
message StreamChannelOpenedRequest {
}
message ChannelOpenedNotification {
optional bytes id = 1;
Amount funding_msat = 2;
bytes funding_txid = 3;
bool channel_ready = 4;
}
message StreamConnectRequest {
}
message ConnectNotification {
// connect.direction
enum ConnectDirection {
IN = 0;
OUT = 1;
}
bytes id = 1;
ConnectDirection direction = 2;
string address = 3;
}
message StreamCustomMsgRequest {
}
message CustomMsgNotification {
bytes peer_id = 1;
bytes payload = 2;
}

View file

@ -123,6 +123,14 @@ class GrpcGenerator(IGenerator):
types.extend(gather_subfields(field))
for field in method.response.fields:
types.extend(gather_subfields(field))
for notification in service.notifications:
types.extend([notification.request, notification.response])
for field in notification.request.fields:
types.extend(gather_subfields(field))
for field in notification.response.fields:
types.extend(gather_subfields(field))
return types
def generate_service(self, service: Service) -> None:

File diff suppressed because one or more lines are too long