-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathcodec.proto
279 lines (272 loc) · 15.1 KB
/
codec.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
syntax = "proto3";
package bnsd;
import "cmd/bnsd/x/account/codec.proto";
import "cmd/bnsd/x/preregistration/codec.proto";
import "cmd/bnsd/x/qualityscore/codec.proto";
import "cmd/bnsd/x/termdeposit/codec.proto";
import "cmd/bnsd/x/username/codec.proto";
import "datamigration/codec.proto";
import "gogoproto/gogo.proto";
import "migration/codec.proto";
import "x/aswap/codec.proto";
import "x/cash/codec.proto";
import "x/currency/codec.proto";
import "x/distribution/codec.proto";
import "x/escrow/codec.proto";
import "x/gov/codec.proto";
import "x/msgfee/codec.proto";
import "x/multisig/codec.proto";
import "x/sigs/codec.proto";
import "x/txfee/codec.proto";
import "x/validators/codec.proto";
// Tx contains the message.
//
// When extending Tx, follow the rules:
// - range 1-50 is reserved for middlewares,
// - range 51-inf is reserved for different message types,
// - keep the same numbers for the same message types in both bnsd and other
// applications. For example, FeeInfo field is used by both and indexed at
// first position. Skip unused fields (leave index unused or comment out for
// clarity).
// When there is a gap in message sequence numbers - that most likely means some
// old fields got deprecated. This is done to maintain binary compatibility.
message Tx {
cash.FeeInfo fees = 1;
repeated sigs.StdSignature signatures = 2;
// Multisig contains IDs of multisig contracts.
// empty array results in multisig being ignored, basically the same behaviour
// as if it never got supplied.
repeated bytes multisig = 4;
// msg is a sum type over all allowed messages on this chain.
oneof sum {
cash.SendMsg cash_send_msg = 51;
escrow.CreateMsg escrow_create_msg = 52;
escrow.ReleaseMsg escrow_release_msg = 53;
escrow.ReturnMsg escrow_return_msg = 54;
escrow.UpdatePartiesMsg escrow_update_parties_msg = 55;
multisig.CreateMsg multisig_create_msg = 56;
multisig.UpdateMsg multisig_update_msg = 57;
validators.ApplyDiffMsg validators_apply_diff_msg = 58;
currency.CreateMsg currency_create_msg = 59;
ExecuteBatchMsg execute_batch_msg = 60;
username.RegisterTokenMsg username_register_token_msg = 61;
username.TransferTokenMsg username_transfer_token_msg = 62;
username.ChangeTokenTargetsMsg username_change_token_targets_msg = 63;
username.UpdateConfigurationMsg username_update_configuration_msg = 64;
distribution.CreateMsg distribution_create_msg = 66;
distribution.DistributeMsg distribution_msg = 67;
distribution.ResetMsg distribution_reset_msg = 68;
migration.UpgradeSchemaMsg migration_upgrade_schema_msg = 69;
aswap.CreateMsg aswap_create_msg = 70;
aswap.ReleaseMsg aswap_release_msg = 71;
aswap.ReturnMsg aswap_return_msg = 72;
gov.CreateProposalMsg gov_create_proposal_msg = 73;
gov.DeleteProposalMsg gov_delete_proposal_msg = 74;
gov.VoteMsg gov_vote_msg = 75;
// Tally is executed via cron only.
// gov.TallyMsg gov_tally_msg = 76;
gov.UpdateElectorateMsg gov_update_electorate_msg = 77;
gov.UpdateElectionRuleMsg gov_update_election_rule_msg = 78;
// 79 is reserved (see ProposalOptions: TextResolutionMsg)
msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80;
datamigration.ExecuteMigrationMsg datamigration_execute_migration_msg = 81;
account.UpdateConfigurationMsg account_update_configuration_msg = 82;
account.RegisterDomainMsg account_register_domain_msg = 83;
account.ReplaceAccountMsgFeesMsg account_replace_account_msg_fees_msg = 84;
account.TransferDomainMsg account_transfer_domain_msg = 85;
account.RenewDomainMsg account_renew_domain_msg = 86;
account.DeleteDomainMsg account_delete_domain_msg = 87;
account.RegisterAccountMsg account_register_account_msg = 88;
account.TransferAccountMsg account_transfer_account_msg = 89;
account.ReplaceAccountTargetsMsg account_replace_account_targets_msg = 90;
account.DeleteAccountMsg account_delete_account_msg = 91;
account.FlushDomainMsg account_flush_domain_msg = 92;
account.RenewAccountMsg account_renew_account_msg = 93;
account.AddAccountCertificateMsg account_add_account_certificate_msg = 94;
account.DeleteAccountCertificateMsg account_delete_account_certificate_msg = 95;
preregistration.RegisterMsg preregistration_register_msg = 96;
cash.UpdateConfigurationMsg cash_update_configuration_msg = 97;
txfee.UpdateConfigurationMsg txfee_update_configuration_msg = 98;
termdeposit.CreateDepositContractMsg termdeposit_create_deposit_contract_msg = 99;
termdeposit.DepositMsg termdeposit_deposit_msg = 100;
termdeposit.ReleaseDepositMsg termdeposit_release_deposit_msg = 101;
termdeposit.UpdateConfigurationMsg termdeposit_update_configuration_msg = 102;
qualityscore.UpdateConfigurationMsg qualityscore_update_configuration_msg = 103;
preregistration.UpdateConfigurationMsg preregistration_update_configuration_msg = 104;
msgfee.UpdateConfigurationMsg msgfee_update_configuration_msg = 105;
}
}
// ExecuteBatchMsg encapsulates multiple messages to support batch transaction
message ExecuteBatchMsg {
message Union {
oneof sum {
cash.SendMsg cash_send_msg = 51;
escrow.CreateMsg escrow_create_msg = 52;
escrow.ReleaseMsg escrow_release_msg = 53;
escrow.ReturnMsg escrow_return_msg = 54;
escrow.UpdatePartiesMsg escrow_update_parties_msg = 55;
multisig.CreateMsg multisig_create_msg = 56;
multisig.UpdateMsg multisig_update_msg = 57;
validators.ApplyDiffMsg validators_apply_diff_msg = 58;
currency.CreateMsg currency_create_msg = 59;
// No recursive batches!
username.RegisterTokenMsg username_register_token_msg = 61;
username.TransferTokenMsg username_transfer_token_msg = 62;
username.ChangeTokenTargetsMsg username_change_token_targets_msg = 63;
username.UpdateConfigurationMsg username_update_configuration_msg = 64;
distribution.CreateMsg distribution_create_msg = 66;
distribution.DistributeMsg distribution_msg = 67;
distribution.ResetMsg distribution_reset_msg = 68;
// upgrade schema is important enough, it should be a solo action
// aswap and gov don't make much sense as part of a batch (no vote buying)
msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80;
datamigration.ExecuteMigrationMsg datamigration_execute_migration_msg = 81;
account.UpdateConfigurationMsg account_update_configuration_msg = 82;
account.RegisterDomainMsg account_register_domain_msg = 83;
account.ReplaceAccountMsgFeesMsg account_replace_account_msg_fees_msg = 84;
account.TransferDomainMsg account_transfer_domain_msg = 85;
account.RenewDomainMsg account_renew_domain_msg = 86;
account.DeleteDomainMsg account_delete_domain_msg = 87;
account.RegisterAccountMsg account_register_account_msg = 88;
account.TransferAccountMsg account_transfer_account_msg = 89;
account.ReplaceAccountTargetsMsg account_replace_account_targets_msg = 90;
account.DeleteAccountMsg account_delete_account_msg = 91;
account.FlushDomainMsg account_flush_domain_msg = 92;
account.RenewAccountMsg account_renew_account_msg = 93;
account.AddAccountCertificateMsg account_add_account_certificate_msg = 94;
account.DeleteAccountCertificateMsg account_delete_account_certificate_msg = 95;
// 96 is used by preregistration
cash.UpdateConfigurationMsg cash_update_configuration_msg = 97;
txfee.UpdateConfigurationMsg txfee_update_configuration_msg = 98;
termdeposit.CreateDepositContractMsg termdeposit_create_deposit_contract_msg = 99;
termdeposit.DepositMsg termdeposit_deposit_msg = 100;
termdeposit.ReleaseDepositMsg termdeposit_release_deposit_msg = 101;
termdeposit.UpdateConfigurationMsg termdeposit_update_configuration_msg = 102;
qualityscore.UpdateConfigurationMsg qualityscore_update_configuration_msg = 103;
preregistration.UpdateConfigurationMsg preregistration_update_configuration_msg = 104;
msgfee.UpdateConfigurationMsg msgfee_update_configuration_msg = 105;
}
}
repeated Union messages = 1 [(gogoproto.nullable) = false];
}
// ProposalOptions are possible items that can be enacted by a governance vote
// Trimmed down somewhat arbitrary to what is believed to be reasonable
message ProposalOptions {
oneof option {
cash.SendMsg cash_send_msg = 51;
escrow.ReleaseMsg escrow_release_msg = 53;
escrow.UpdatePartiesMsg update_escrow_parties_msg = 55;
multisig.UpdateMsg multisig_update_msg = 57;
validators.ApplyDiffMsg validators_apply_diff_msg = 58;
currency.CreateMsg currency_create_msg = 59;
ExecuteProposalBatchMsg execute_proposal_batch_msg = 60;
username.RegisterTokenMsg username_register_token_msg = 61;
username.TransferTokenMsg username_transfer_token_msg = 62;
username.ChangeTokenTargetsMsg username_change_token_targets_msg = 63;
username.UpdateConfigurationMsg username_update_configuration_msg = 64;
distribution.CreateMsg distribution_create_msg = 66;
distribution.DistributeMsg distribution_msg = 67;
distribution.ResetMsg distribution_reset_msg = 68;
migration.UpgradeSchemaMsg migration_upgrade_schema_msg = 69;
gov.UpdateElectorateMsg gov_update_electorate_msg = 77;
gov.UpdateElectionRuleMsg gov_update_election_rule_msg = 78;
gov.CreateTextResolutionMsg gov_create_text_resolution_msg = 79;
msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80;
datamigration.ExecuteMigrationMsg datamigration_execute_migration_msg = 81;
account.UpdateConfigurationMsg account_update_configuration_msg = 82;
account.RegisterDomainMsg account_register_domain_msg = 83;
account.ReplaceAccountMsgFeesMsg account_replace_account_msg_fees_msg = 84;
account.TransferDomainMsg account_transfer_domain_msg = 85;
account.RenewDomainMsg account_renew_domain_msg = 86;
account.DeleteDomainMsg account_delete_domain_msg = 87;
account.RegisterAccountMsg account_register_account_msg = 88;
account.TransferAccountMsg account_transfer_account_msg = 89;
account.ReplaceAccountTargetsMsg account_replace_account_targets_msg = 90;
account.DeleteAccountMsg account_delete_account_msg = 91;
account.FlushDomainMsg account_flush_domain_msg = 92;
account.RenewAccountMsg account_renew_account_msg = 93;
account.AddAccountCertificateMsg account_add_account_certificate_msg = 94;
account.DeleteAccountCertificateMsg account_delete_account_certificate_msg = 95;
cash.UpdateConfigurationMsg cash_update_configuration_msg = 97;
txfee.UpdateConfigurationMsg txfee_update_configuration_msg = 98;
termdeposit.CreateDepositContractMsg termdeposit_create_deposit_contract_msg = 99;
termdeposit.DepositMsg termdeposit_deposit_msg = 100;
termdeposit.ReleaseDepositMsg termdeposit_release_deposit_msg = 101;
termdeposit.UpdateConfigurationMsg termdeposit_update_configuration_msg = 102;
qualityscore.UpdateConfigurationMsg qualityscore_update_configuration_msg = 103;
preregistration.UpdateConfigurationMsg preregistration_update_configuration_msg = 104;
msgfee.UpdateConfigurationMsg msgfee_update_configuration_msg = 105;
}
}
message ExecuteProposalBatchMsg {
message Union {
oneof sum {
cash.SendMsg send_msg = 51;
escrow.ReleaseMsg escrow_release_msg = 53;
escrow.UpdatePartiesMsg update_escrow_parties_msg = 55;
multisig.UpdateMsg multisig_update_msg = 57;
validators.ApplyDiffMsg validators_apply_diff_msg = 58;
// no recursive batches
username.RegisterTokenMsg username_register_token_msg = 61;
username.TransferTokenMsg username_transfer_token_msg = 62;
username.ChangeTokenTargetsMsg username_change_token_targets_msg = 63;
username.UpdateConfigurationMsg username_update_configuration_msg = 64;
distribution.CreateMsg distribution_create_msg = 66;
distribution.DistributeMsg distribution_msg = 67;
distribution.ResetMsg distribution_reset_msg = 68;
// don't allow UpgradeSchema as part of a batch, as effects are too confusing
gov.UpdateElectorateMsg gov_update_electorate_msg = 77;
gov.UpdateElectionRuleMsg gov_update_election_rule_msg = 78;
gov.CreateTextResolutionMsg gov_create_text_resolution_msg = 79;
msgfee.SetMsgFeeMsg msgfee_set_msg_fee_msg = 80;
datamigration.ExecuteMigrationMsg datamigration_execute_migration_msg = 81;
account.UpdateConfigurationMsg account_update_configuration_msg = 82;
account.RegisterDomainMsg account_register_domain_msg = 83;
account.ReplaceAccountMsgFeesMsg account_replace_account_msg_fees_msg = 84;
account.TransferDomainMsg account_transfer_domain_msg = 85;
account.RenewDomainMsg account_renew_domain_msg = 86;
account.DeleteDomainMsg account_delete_domain_msg = 87;
account.RegisterAccountMsg account_register_account_msg = 88;
account.TransferAccountMsg account_transfer_account_msg = 89;
account.ReplaceAccountTargetsMsg account_replace_account_targets_msg = 90;
account.DeleteAccountMsg account_delete_account_msg = 91;
account.FlushDomainMsg account_flush_domain_msg = 92;
account.RenewAccountMsg account_renew_account_msg = 93;
account.AddAccountCertificateMsg account_add_account_certificate_msg = 94;
account.DeleteAccountCertificateMsg account_delete_account_certificate_msg = 95;
cash.UpdateConfigurationMsg cash_update_configuration_msg = 97;
txfee.UpdateConfigurationMsg txfee_update_configuration_msg = 98;
termdeposit.CreateDepositContractMsg termdeposit_create_deposit_contract_msg = 99;
termdeposit.DepositMsg termdeposit_deposit_msg = 100;
termdeposit.ReleaseDepositMsg termdeposit_release_deposit_msg = 101;
termdeposit.UpdateConfigurationMsg termdeposit_update_configuration_msg = 102;
qualityscore.UpdateConfigurationMsg qualityscore_update_configuration_msg = 103;
preregistration.UpdateConfigurationMsg preregistration_update_configuration_msg = 104;
msgfee.UpdateConfigurationMsg msgfee_update_configuration_msg = 105;
}
}
repeated Union messages = 1 [(gogoproto.nullable) = false];
}
// CronTask is a format used by the CronMarshaler to marshal and unmarshal cron
// task.
//
// When there is a gap in message sequence numbers - that most likely means some
// old fields got deprecated. This is done to maintain binary compatibility.
message CronTask {
// Authenticators contains a list of conditions that authenticate execution
// of this task.
// This is one of the main differences between the CronTask and Tx entities.
// CronTask is created interanlly and does not have to be signed. Because we
// use the same handlers as for the Tx to process a cron task, we must
// provide authentication method. This attribute contains all authentication
// conditions required for execution, that will be inserted into the context.
repeated bytes authenticators = 1 [(gogoproto.casttype) = "github.com/iov-one/weave.Condition"];
// Use the same indexes for the messages as the Tx message.
oneof sum {
escrow.ReleaseMsg escrow_release_msg = 53;
escrow.ReturnMsg escrow_return_msg = 54;
distribution.DistributeMsg distribution_distribute_msg = 67;
aswap.ReleaseMsg aswap_release_msg = 71;
gov.TallyMsg gov_tally_msg = 76;
}
}