Skip to content

Commit 3538daf

Browse files
committed
add RPC to stream events
1 parent 4afae3e commit 3538daf

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

proto/sidechain.proto

+20-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ service Sidechain {
1616
rpc GetWithdrawalBundle(GetWithdrawalBundleRequest)
1717
returns (GetWithdrawalBundleResponse);
1818

19-
rpc StreamEvents()
19+
rpc SubscribeEvents(SubscribeEventsRequest) returns (stream EventResponse);
2020
}
2121

2222
message SubmitTransactionRequest {
@@ -61,12 +61,16 @@ message WithdrawalBundleEvent {
6161
WithdrawalBundleEventType withdrawal_bundle_event_type = 2;
6262
}
6363

64-
message ConnectMainBlockRequest {
64+
message MainBlockInfo {
6565
repeated Deposit deposits = 1;
6666
optional WithdrawalBundleEvent withdrawal_bundle_event = 2;
6767
repeated bytes bmm_hashes = 3;
6868
uint32 block_height = 4;
6969
bytes block_hash = 5;
70+
bytes prev_block_hash = 6;
71+
}
72+
message ConnectMainBlockRequest {
73+
MainBlockInfo main_block_info = 1;
7074
}
7175
message ConnectMainBlockResponse {
7276
}
@@ -90,3 +94,17 @@ message GetWithdrawalBundleRequest {
9094
message GetWithdrawalBundleResponse {
9195
bytes bundle = 1;
9296
}
97+
98+
message SubscribeEventsRequest {
99+
}
100+
message ConnectMainBlockEvent {
101+
MainBlockInfo main_block_info = 1;
102+
}
103+
message Event {
104+
oneof event {
105+
ConnectMainBlockEvent connect_block = 1;
106+
}
107+
}
108+
message EventResponse {
109+
Event event = 1;
110+
}

0 commit comments

Comments
 (0)