Skip to content

Commit c95fa16

Browse files
committed
add GetTwoWayPegData RPC
1 parent b23aca0 commit c95fa16

File tree

1 file changed

+70
-3
lines changed

1 file changed

+70
-3
lines changed

proto/mainchain.proto

+70-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,20 @@ message BlockHeaderInfo {
1111
bytes work = 4;
1212
}
1313

14+
message OutPoint {
15+
bytes txid = 1;
16+
uint32 vout = 2;
17+
}
18+
19+
message Output {
20+
bytes address = 2;
21+
uint64 value_sats = 3;
22+
}
23+
1424
message Deposit {
1525
uint64 sequence_number = 1;
16-
bytes address = 2;
17-
uint64 value = 3;
26+
OutPoint outpoint = 2;
27+
Output output = 3;
1828
}
1929

2030
enum WithdrawalBundleEventType {
@@ -35,15 +45,48 @@ message BlockInfo {
3545
}
3646

3747
service Mainchain {
48+
rpc BroadcastWithdrawalBundle(BroadcastWithdrawalBundleRequest)
49+
returns (BroadcastWithdrawalBundleResponse);
50+
rpc CreateBmmCriticalDataTransaction(CreateBmmCriticalDataTransactionRequest)
51+
returns (CreateBmmCriticalDataTransactionResponse);
52+
// Regtest only
53+
rpc GenerateBlocks(GenerateBlocksRequest)
54+
returns (GenerateBlocksResponse);
3855
rpc GetBlockHeaderInfo(GetBlockHeaderInfoRequest)
3956
returns (GetBlockHeaderInfoResponse);
4057
rpc GetBlockInfo(GetBlockInfoRequest) returns (GetBlockInfoResponse);
4158
rpc GetBmmHStarCommitments(GetBmmHStarCommitmentsRequest)
4259
returns (GetBmmHStarCommitmentsResponse);
4360
rpc GetChainTip(GetChainTipRequest) returns (GetChainTipResponse);
61+
rpc GetTwoWayPegData(GetTwoWayPegDataRequest)
62+
returns (GetTwoWayPegDataResponse);
4463
rpc SubscribeEvents(SubscribeEventsRequest) returns (stream EventResponse);
4564
}
4665

66+
message BroadcastWithdrawalBundleRequest {
67+
uint32 sidechain_id = 1;
68+
bytes transaction = 2;
69+
}
70+
message BroadcastWithdrawalBundleResponse {
71+
}
72+
73+
message CreateBmmCriticalDataTransactionRequest {
74+
uint32 sidechain_id = 1;
75+
uint64 value_sats = 2;
76+
uint32 height = 3;
77+
bytes critical_hash = 4;
78+
bytes prev_bytes = 5;
79+
}
80+
message CreateBmmCriticalDataTransactionResponse {
81+
bytes txid = 1;
82+
}
83+
84+
message GenerateBlocksRequest {
85+
uint32 blocks = 1;
86+
}
87+
message GenerateBlocksResponse {
88+
}
89+
4790
message GetBlockHeaderInfoRequest {
4891
bytes block_hash = 1;
4992
}
@@ -53,6 +96,7 @@ message GetBlockHeaderInfoResponse {
5396

5497
message GetBlockInfoRequest {
5598
bytes block_hash = 1;
99+
uint32 sidechain_id = 2;
56100
}
57101
message GetBlockInfoResponse {
58102
BlockHeaderInfo header_info = 1;
@@ -64,7 +108,16 @@ message GetBmmHStarCommitmentsRequest {
64108
uint32 sidechain_id = 2;
65109
}
66110
message GetBmmHStarCommitmentsResponse {
67-
repeated bytes commitments = 1;
111+
message BlockNotFoundError {
112+
bytes block_hash = 1;
113+
}
114+
message Commitments {
115+
repeated bytes commitments = 1;
116+
}
117+
oneof result {
118+
BlockNotFoundError block_not_found = 1;
119+
Commitments commitments = 2;
120+
}
68121
}
69122

70123
message GetChainTipRequest {
@@ -73,7 +126,21 @@ message GetChainTipResponse {
73126
BlockHeaderInfo block_header_info = 1;
74127
}
75128

129+
message GetTwoWayPegDataRequest {
130+
uint32 sidechain_id = 1;
131+
optional bytes start_block_hash = 2;
132+
bytes end_block_hash = 3;
133+
}
134+
message GetTwoWayPegDataResponse {
135+
message ResponseItem {
136+
BlockHeaderInfo block_header_info = 1;
137+
BlockInfo block_info = 2;
138+
}
139+
repeated ResponseItem blocks = 1;
140+
}
141+
76142
message SubscribeEventsRequest {
143+
uint32 sidechain_id = 1;
77144
}
78145
message EventResponse {
79146
message Event {

0 commit comments

Comments
 (0)