Skip to content

Commit b8d42cf

Browse files
committed
add GetTwoWayPegData RPC
1 parent b23aca0 commit b8d42cf

File tree

1 file changed

+57
-3
lines changed

1 file changed

+57
-3
lines changed

proto/mainchain.proto

+57-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,35 @@ message BlockInfo {
3545
}
3646

3747
service Mainchain {
48+
rpc BroadcastWithdrawalBundle(BroadcastWithdrawalBundleRequest)
49+
returns (BroadcastWithdrawalBundleResponse);
50+
// Regtest only
51+
rpc GenerateBlocks(GenerateBlocksRequest)
52+
returns (GenerateBlocksResponse);
3853
rpc GetBlockHeaderInfo(GetBlockHeaderInfoRequest)
3954
returns (GetBlockHeaderInfoResponse);
4055
rpc GetBlockInfo(GetBlockInfoRequest) returns (GetBlockInfoResponse);
4156
rpc GetBmmHStarCommitments(GetBmmHStarCommitmentsRequest)
4257
returns (GetBmmHStarCommitmentsResponse);
4358
rpc GetChainTip(GetChainTipRequest) returns (GetChainTipResponse);
59+
rpc GetTwoWayPegData(GetTwoWayPegDataRequest)
60+
returns (GetTwoWayPegDataResponse);
4461
rpc SubscribeEvents(SubscribeEventsRequest) returns (stream EventResponse);
4562
}
4663

64+
message BroadcastWithdrawalBundleRequest {
65+
uint32 sidechain_id = 1;
66+
bytes transaction = 2;
67+
}
68+
message BroadcastWithdrawalBundleResponse {
69+
}
70+
71+
message GenerateBlocksRequest {
72+
uint32 blocks = 1;
73+
}
74+
message GenerateBlocksResponse {
75+
}
76+
4777
message GetBlockHeaderInfoRequest {
4878
bytes block_hash = 1;
4979
}
@@ -53,6 +83,7 @@ message GetBlockHeaderInfoResponse {
5383

5484
message GetBlockInfoRequest {
5585
bytes block_hash = 1;
86+
uint32 sidechain_id = 2;
5687
}
5788
message GetBlockInfoResponse {
5889
BlockHeaderInfo header_info = 1;
@@ -64,7 +95,16 @@ message GetBmmHStarCommitmentsRequest {
6495
uint32 sidechain_id = 2;
6596
}
6697
message GetBmmHStarCommitmentsResponse {
67-
repeated bytes commitments = 1;
98+
message BlockNotFoundError {
99+
bytes block_hash = 1;
100+
}
101+
message Commitments {
102+
repeated bytes commitments = 1;
103+
}
104+
oneof result {
105+
BlockNotFoundError block_not_found = 1;
106+
Commitments commitments = 2;
107+
}
68108
}
69109

70110
message GetChainTipRequest {
@@ -73,7 +113,21 @@ message GetChainTipResponse {
73113
BlockHeaderInfo block_header_info = 1;
74114
}
75115

116+
message GetTwoWayPegDataRequest {
117+
uint32 sidechain_id = 1;
118+
optional bytes start_block_hash = 2;
119+
bytes end_block_hash = 3;
120+
}
121+
message GetTwoWayPegDataResponse {
122+
message ResponseItem {
123+
BlockHeaderInfo block_header_info = 1;
124+
BlockInfo block_info = 2;
125+
}
126+
repeated ResponseItem blocks = 1;
127+
}
128+
76129
message SubscribeEventsRequest {
130+
uint32 sidechain_id = 1;
77131
}
78132
message EventResponse {
79133
message Event {

0 commit comments

Comments
 (0)