Skip to content

Commit 9137009

Browse files
committed
add GetTwoWayPegData RPC
1 parent b23aca0 commit 9137009

File tree

1 file changed

+48
-3
lines changed

1 file changed

+48
-3
lines changed

proto/mainchain.proto

+48-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,22 @@ message BlockHeaderInfo {
1111
bytes work = 4;
1212
}
1313

14-
message Deposit {
15-
uint64 sequence_number = 1;
14+
message OutPoint {
15+
bytes txid = 1;
16+
uint32 vout = 2;
17+
}
18+
19+
message Output {
1620
bytes address = 2;
1721
uint64 value = 3;
1822
}
1923

24+
message Deposit {
25+
uint64 sequence_number = 1;
26+
OutPoint outpoint = 2;
27+
Output output = 3;
28+
}
29+
2030
enum WithdrawalBundleEventType {
2131
WITHDRAWAL_BUNDLE_EVENT_TYPE_SUBMITTED_UNSPECIFIED = 0;
2232
WITHDRAWAL_BUNDLE_EVENT_TYPE_FAILED = 1;
@@ -35,15 +45,26 @@ message BlockInfo {
3545
}
3646

3747
service Mainchain {
48+
rpc BroadcastWithdrawalBundle(BroadcastWithdrawalBundleRequest)
49+
returns (BroadcastWithdrawalBundleResponse);
3850
rpc GetBlockHeaderInfo(GetBlockHeaderInfoRequest)
3951
returns (GetBlockHeaderInfoResponse);
4052
rpc GetBlockInfo(GetBlockInfoRequest) returns (GetBlockInfoResponse);
4153
rpc GetBmmHStarCommitments(GetBmmHStarCommitmentsRequest)
4254
returns (GetBmmHStarCommitmentsResponse);
4355
rpc GetChainTip(GetChainTipRequest) returns (GetChainTipResponse);
56+
rpc GetTwoWayPegData(GetTwoWayPegDataRequest)
57+
returns (GetTwoWayPegDataResponse);
4458
rpc SubscribeEvents(SubscribeEventsRequest) returns (stream EventResponse);
4559
}
4660

61+
message BroadcastWithdrawalBundleRequest {
62+
uint32 sidechain_id = 1;
63+
bytes transaction = 2;
64+
}
65+
message BroadcastWithdrawalBundleResponse {
66+
}
67+
4768
message GetBlockHeaderInfoRequest {
4869
bytes block_hash = 1;
4970
}
@@ -53,6 +74,7 @@ message GetBlockHeaderInfoResponse {
5374

5475
message GetBlockInfoRequest {
5576
bytes block_hash = 1;
77+
uint32 sidechain_id = 2;
5678
}
5779
message GetBlockInfoResponse {
5880
BlockHeaderInfo header_info = 1;
@@ -64,7 +86,16 @@ message GetBmmHStarCommitmentsRequest {
6486
uint32 sidechain_id = 2;
6587
}
6688
message GetBmmHStarCommitmentsResponse {
67-
repeated bytes commitments = 1;
89+
message BlockNotFoundError {
90+
bytes block_hash = 1;
91+
}
92+
message Commitments {
93+
repeated bytes commitments = 1;
94+
}
95+
oneof result {
96+
BlockNotFoundError block_not_found = 1;
97+
Commitments commitments = 2;
98+
}
6899
}
69100

70101
message GetChainTipRequest {
@@ -73,7 +104,21 @@ message GetChainTipResponse {
73104
BlockHeaderInfo block_header_info = 1;
74105
}
75106

107+
message GetTwoWayPegDataRequest {
108+
uint32 sidechain_id = 1;
109+
optional bytes start_block_hash = 2;
110+
bytes end_block_hash = 3;
111+
}
112+
message GetTwoWayPegDataResponse {
113+
message ResponseItem {
114+
BlockHeaderInfo block_header_info = 1;
115+
BlockInfo block_info = 2;
116+
}
117+
repeated ResponseItem blocks = 1;
118+
}
119+
76120
message SubscribeEventsRequest {
121+
uint32 sidechain_id = 1;
77122
}
78123
message EventResponse {
79124
message Event {

0 commit comments

Comments
 (0)