Skip to content

Commit e7bd486

Browse files
committed
swapserverrpc: refactor reservation notifications
This commit refactors the proto definitions of the reservation notifications to use a more generic mechanism that can be used for other types of notifications as well.
1 parent 6db2a39 commit e7bd486

File tree

6 files changed

+784
-608
lines changed

6 files changed

+784
-608
lines changed

swapserverrpc/reservation.pb.go

Lines changed: 38 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swapserverrpc/reservation.proto

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ package looprpc;
99
option go_package = "github.com/lightninglabs/loop/swapserverrpc";
1010

1111
service ReservationService {
12-
// ReservationNotificationStream is a server side stream that sends
13-
// notifications if the server wants to open a reservation to the client.
14-
rpc ReservationNotificationStream (ReservationNotificationRequest)
15-
returns (stream ServerReservationNotification);
16-
1712
// OpenReservation requests a new reservation UTXO from the server.
1813
rpc OpenReservation (ServerOpenReservationRequest)
1914
returns (ServerOpenReservationResponse);
@@ -22,6 +17,8 @@ service ReservationService {
2217
// ReservationNotificationRequest is an empty request sent from the client to
2318
// the server to open a stream to receive reservation notifications.
2419
message ReservationNotificationRequest {
20+
// protocol_version is the maximum version the client supports.
21+
ReservationProtocolVersion protocol_version = 1;
2522
}
2623

2724
// ServerReservationNotification is a notification sent from the server to the
@@ -64,7 +61,7 @@ enum ReservationProtocolVersion {
6461
// protocol version is not set.
6562
RESERVATION_NONE = 0;
6663

67-
// RESERVATION_SERVER_REQUEST is the first version of the reservation
64+
// RESERVATION_SERVER_NOTIFY_FULL is the first version of the reservation
6865
// protocol where the server notifies the client about a reservation.
6966
RESERVATION_SERVER_NOTIFY = 1;
7067
};

swapserverrpc/reservation_grpc.pb.go

Lines changed: 1 addition & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)