/
codec.pb.go
3235 lines (3106 loc) · 78.9 KB
/
codec.pb.go
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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: x/gov/codec.proto
package gov
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
github_com_iov_one_weave "github.com/iov-one/weave"
io "io"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
// VoteOptions define possible values for a vote including the INVALID default.
type VoteOption int32
const (
VoteOption_Invalid VoteOption = 0
VoteOption_Yes VoteOption = 1
VoteOption_No VoteOption = 2
VoteOption_Abstain VoteOption = 3
)
var VoteOption_name = map[int32]string{
0: "VOTE_OPTION_INVALID",
1: "VOTE_OPTION_YES",
2: "VOTE_OPTION_NO",
3: "VOTE_OPTION_ABSTAIN",
}
var VoteOption_value = map[string]int32{
"VOTE_OPTION_INVALID": 0,
"VOTE_OPTION_YES": 1,
"VOTE_OPTION_NO": 2,
"VOTE_OPTION_ABSTAIN": 3,
}
func (x VoteOption) String() string {
return proto.EnumName(VoteOption_name, int32(x))
}
func (VoteOption) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_24f6e3c5f1b82a85, []int{0}
}
// Status of the proposal base on the final tally result. `UNDEFINED` as initial value.
type TextProposal_Status int32
const (
TextProposal_Invalid TextProposal_Status = 0
TextProposal_Undefined TextProposal_Status = 1
TextProposal_Accepted TextProposal_Status = 2
TextProposal_Rejected TextProposal_Status = 3
)
var TextProposal_Status_name = map[int32]string{
0: "TEXT_PROPOSAL_STATUS_INVALID",
1: "TEXT_PROPOSAL_STATUS_UNDEFINED",
2: "TEXT_PROPOSAL_STATUS_ACCEPTED",
3: "TEXT_PROPOSAL_STATUS_REJECTED",
}
var TextProposal_Status_value = map[string]int32{
"TEXT_PROPOSAL_STATUS_INVALID": 0,
"TEXT_PROPOSAL_STATUS_UNDEFINED": 1,
"TEXT_PROPOSAL_STATUS_ACCEPTED": 2,
"TEXT_PROPOSAL_STATUS_REJECTED": 3,
}
func (x TextProposal_Status) String() string {
return proto.EnumName(TextProposal_Status_name, int32(x))
}
func (TextProposal_Status) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_24f6e3c5f1b82a85, []int{4, 0}
}
// Electorate defines who may vote in an election. This same group can be used in many elections
// and is stored for re-use
type Electorate struct {
// Human readable title.
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
// Elector defines a list of all signatures that are allowed to participate in a vote
Electors []Elector `protobuf:"bytes,2,rep,name=electors,proto3" json:"electors"`
// TotalWeightElectorate is the sum of all electors weights.
TotalWeightElectorate uint64 `protobuf:"varint,3,opt,name=TotalWeightElectorate,proto3" json:"TotalWeightElectorate,omitempty"`
}
func (m *Electorate) Reset() { *m = Electorate{} }
func (m *Electorate) String() string { return proto.CompactTextString(m) }
func (*Electorate) ProtoMessage() {}
func (*Electorate) Descriptor() ([]byte, []int) {
return fileDescriptor_24f6e3c5f1b82a85, []int{0}
}
func (m *Electorate) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Electorate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Electorate.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Electorate) XXX_Merge(src proto.Message) {
xxx_messageInfo_Electorate.Merge(m, src)
}
func (m *Electorate) XXX_Size() int {
return m.Size()
}
func (m *Electorate) XXX_DiscardUnknown() {
xxx_messageInfo_Electorate.DiscardUnknown(m)
}
var xxx_messageInfo_Electorate proto.InternalMessageInfo
func (m *Electorate) GetTitle() string {
if m != nil {
return m.Title
}
return ""
}
func (m *Electorate) GetElectors() []Elector {
if m != nil {
return m.Electors
}
return nil
}
func (m *Electorate) GetTotalWeightElectorate() uint64 {
if m != nil {
return m.TotalWeightElectorate
}
return 0
}
// Elector clubs together a signature with a weight. The greater the weight
// the greater the power of a participant.
type Elector struct {
// The address of the voter.
Signature github_com_iov_one_weave.Address `protobuf:"bytes,1,opt,name=signature,proto3,casttype=github.com/iov-one/weave.Address" json:"signature,omitempty"`
// Weight defines the power of the participants vote. max value is 65535 (2^16-1).
Weight uint32 `protobuf:"varint,2,opt,name=weight,proto3" json:"weight,omitempty"`
}
func (m *Elector) Reset() { *m = Elector{} }
func (m *Elector) String() string { return proto.CompactTextString(m) }
func (*Elector) ProtoMessage() {}
func (*Elector) Descriptor() ([]byte, []int) {
return fileDescriptor_24f6e3c5f1b82a85, []int{1}
}
func (m *Elector) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Elector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Elector.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Elector) XXX_Merge(src proto.Message) {
xxx_messageInfo_Elector.Merge(m, src)
}
func (m *Elector) XXX_Size() int {
return m.Size()
}
func (m *Elector) XXX_DiscardUnknown() {
xxx_messageInfo_Elector.DiscardUnknown(m)
}
var xxx_messageInfo_Elector proto.InternalMessageInfo
func (m *Elector) GetSignature() github_com_iov_one_weave.Address {
if m != nil {
return m.Signature
}
return nil
}
func (m *Elector) GetWeight() uint32 {
if m != nil {
return m.Weight
}
return 0
}
// Election Rule defines how an election is run. A proposal must be voted upon via a pre-defined ruleset.
type ElectionRule struct {
// Human readable title.
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
// Duration how long the voting period will take place.
VotingPeriodHours uint32 `protobuf:"varint,3,opt,name=voting_period_hours,json=votingPeriodHours,proto3" json:"voting_period_hours,omitempty"`
// Threshold is the fraction of all eligible voters, not only the ones who voted. To accept a
// proposal this value must be exceeded.
// The formula is `(yes*denominator) > (numerator*total_electors_weight)`.
// The valid range for the threshold value is `0.5` to `1` (inclusive) which allows any value between half and all
// of the eligible voters.
Threshold Fraction `protobuf:"bytes,4,opt,name=threshold,proto3" json:"threshold"`
}
func (m *ElectionRule) Reset() { *m = ElectionRule{} }
func (m *ElectionRule) String() string { return proto.CompactTextString(m) }
func (*ElectionRule) ProtoMessage() {}
func (*ElectionRule) Descriptor() ([]byte, []int) {
return fileDescriptor_24f6e3c5f1b82a85, []int{2}
}
func (m *ElectionRule) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ElectionRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ElectionRule.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ElectionRule) XXX_Merge(src proto.Message) {
xxx_messageInfo_ElectionRule.Merge(m, src)
}
func (m *ElectionRule) XXX_Size() int {
return m.Size()
}
func (m *ElectionRule) XXX_DiscardUnknown() {
xxx_messageInfo_ElectionRule.DiscardUnknown(m)
}
var xxx_messageInfo_ElectionRule proto.InternalMessageInfo
func (m *ElectionRule) GetTitle() string {
if m != nil {
return m.Title
}
return ""
}
func (m *ElectionRule) GetVotingPeriodHours() uint32 {
if m != nil {
return m.VotingPeriodHours
}
return 0
}
func (m *ElectionRule) GetThreshold() Fraction {
if m != nil {
return m.Threshold
}
return Fraction{}
}
// The Fraction type represents a numerator and denominator to enable higher precision thresholds in
// the election rules. For example:
// numerator: 1, denominator: 2 => > 50%
// numerator: 2, denominator: 3 => > 66.666..%
// numerator: 6273, denominator: 10000 => > 62.73%
// Valid range of the fraction is 0.5 to 1.
type Fraction struct {
// The top number in a fraction.
Numerator uint32 `protobuf:"varint,1,opt,name=numerator,proto3" json:"numerator,omitempty"`
// The bottom number
Denominator uint32 `protobuf:"varint,2,opt,name=denominator,proto3" json:"denominator,omitempty"`
}
func (m *Fraction) Reset() { *m = Fraction{} }
func (m *Fraction) String() string { return proto.CompactTextString(m) }
func (*Fraction) ProtoMessage() {}
func (*Fraction) Descriptor() ([]byte, []int) {
return fileDescriptor_24f6e3c5f1b82a85, []int{3}
}
func (m *Fraction) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Fraction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Fraction.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Fraction) XXX_Merge(src proto.Message) {
xxx_messageInfo_Fraction.Merge(m, src)
}
func (m *Fraction) XXX_Size() int {
return m.Size()
}
func (m *Fraction) XXX_DiscardUnknown() {
xxx_messageInfo_Fraction.DiscardUnknown(m)
}
var xxx_messageInfo_Fraction proto.InternalMessageInfo
func (m *Fraction) GetNumerator() uint32 {
if m != nil {
return m.Numerator
}
return 0
}
func (m *Fraction) GetDenominator() uint32 {
if m != nil {
return m.Denominator
}
return 0
}
// A text form proposal for an on-chain governance process.
type TextProposal struct {
// Human readable title.
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
// Description of the proposal in text form.
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
// Reference to the election rule
ElectionRuleID []byte `protobuf:"bytes,3,opt,name=election_rule_id,json=electionRuleId,proto3" json:"election_rule_id,omitempty"`
// Reference to the electorate to define the group of possible voters.
ElectorateID []byte `protobuf:"bytes,4,opt,name=electorate_id,json=electorateId,proto3" json:"electorate_id,omitempty"`
// Unix timestamp of the block where the voting period starts. Header time of the votes must be greater than or equal
// to this start time.
VotingStartTime github_com_iov_one_weave.UnixTime `protobuf:"varint,5,opt,name=voting_start_time,json=votingStartTime,proto3,casttype=github.com/iov-one/weave.UnixTime" json:"voting_start_time,omitempty"`
// Unix timestamp of the block where the voting period ends. Header times of the votes must be before this end time
// to be included in the election.
VotingEndTime github_com_iov_one_weave.UnixTime `protobuf:"varint,6,opt,name=voting_end_time,json=votingEndTime,proto3,casttype=github.com/iov-one/weave.UnixTime" json:"voting_end_time,omitempty"`
// Unix timestamp of the block where the proposal was added to the chain.
SubmissionTime github_com_iov_one_weave.UnixTime `protobuf:"varint,7,opt,name=submission_time,json=submissionTime,proto3,casttype=github.com/iov-one/weave.UnixTime" json:"submission_time,omitempty"`
// Address of the author who created the proposal. If not set explicit on creation it will default to the main signer.
Author github_com_iov_one_weave.Address `protobuf:"bytes,8,opt,name=author,proto3,casttype=github.com/iov-one/weave.Address" json:"author,omitempty"`
// Votes contain the list of individual votes with elector and voted option.
Votes []*Vote `protobuf:"bytes,9,rep,name=votes,proto3" json:"votes,omitempty"`
// Result of the election. Contains intermediate tally results while voting period is open.
VoteResult TallyResult `protobuf:"bytes,10,opt,name=vote_result,json=voteResult,proto3" json:"vote_result"`
// status is the final result based on the votes and election rule.
Status TextProposal_Status `protobuf:"varint,11,opt,name=status,proto3,enum=gov.TextProposal_Status" json:"status,omitempty"`
}
func (m *TextProposal) Reset() { *m = TextProposal{} }
func (m *TextProposal) String() string { return proto.CompactTextString(m) }
func (*TextProposal) ProtoMessage() {}
func (*TextProposal) Descriptor() ([]byte, []int) {
return fileDescriptor_24f6e3c5f1b82a85, []int{4}
}
func (m *TextProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *TextProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_TextProposal.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *TextProposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_TextProposal.Merge(m, src)
}
func (m *TextProposal) XXX_Size() int {
return m.Size()
}
func (m *TextProposal) XXX_DiscardUnknown() {
xxx_messageInfo_TextProposal.DiscardUnknown(m)
}
var xxx_messageInfo_TextProposal proto.InternalMessageInfo
func (m *TextProposal) GetTitle() string {
if m != nil {
return m.Title
}
return ""
}
func (m *TextProposal) GetDescription() string {
if m != nil {
return m.Description
}
return ""
}
func (m *TextProposal) GetElectionRuleID() []byte {
if m != nil {
return m.ElectionRuleID
}
return nil
}
func (m *TextProposal) GetElectorateID() []byte {
if m != nil {
return m.ElectorateID
}
return nil
}
func (m *TextProposal) GetVotingStartTime() github_com_iov_one_weave.UnixTime {
if m != nil {
return m.VotingStartTime
}
return 0
}
func (m *TextProposal) GetVotingEndTime() github_com_iov_one_weave.UnixTime {
if m != nil {
return m.VotingEndTime
}
return 0
}
func (m *TextProposal) GetSubmissionTime() github_com_iov_one_weave.UnixTime {
if m != nil {
return m.SubmissionTime
}
return 0
}
func (m *TextProposal) GetAuthor() github_com_iov_one_weave.Address {
if m != nil {
return m.Author
}
return nil
}
func (m *TextProposal) GetVotes() []*Vote {
if m != nil {
return m.Votes
}
return nil
}
func (m *TextProposal) GetVoteResult() TallyResult {
if m != nil {
return m.VoteResult
}
return TallyResult{}
}
func (m *TextProposal) GetStatus() TextProposal_Status {
if m != nil {
return m.Status
}
return TextProposal_Invalid
}
// TallyResult contains sums of the votes and all data for the final result.
type TallyResult struct {
// Sum of weights of all the voters that approved the proposal
TotalYes uint32 `protobuf:"varint,1,opt,name=total_yes,json=totalYes,proto3" json:"total_yes,omitempty"`
// Sum of weights of all the voters that rejected the proposal
TotalNo uint32 `protobuf:"varint,2,opt,name=total_no,json=totalNo,proto3" json:"total_no,omitempty"`
// Sum of weights of all the voters that voted abstain
TotalAbstain uint32 `protobuf:"varint,3,opt,name=total_abstain,json=totalAbstain,proto3" json:"total_abstain,omitempty"`
// Sum of all weights in the electorate.
TotalWeightElectorate uint64 `protobuf:"varint,4,opt,name=total_weight_electorate,json=totalWeightElectorate,proto3" json:"total_weight_electorate,omitempty"`
// Threshold is the fraction of all eligible voters, not only the ones who voted. To accept a
// proposal this value must be exceeded.
Threshold Fraction `protobuf:"bytes,5,opt,name=threshold,proto3" json:"threshold"`
}
func (m *TallyResult) Reset() { *m = TallyResult{} }
func (m *TallyResult) String() string { return proto.CompactTextString(m) }
func (*TallyResult) ProtoMessage() {}
func (*TallyResult) Descriptor() ([]byte, []int) {
return fileDescriptor_24f6e3c5f1b82a85, []int{5}
}
func (m *TallyResult) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *TallyResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_TallyResult.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *TallyResult) XXX_Merge(src proto.Message) {
xxx_messageInfo_TallyResult.Merge(m, src)
}
func (m *TallyResult) XXX_Size() int {
return m.Size()
}
func (m *TallyResult) XXX_DiscardUnknown() {
xxx_messageInfo_TallyResult.DiscardUnknown(m)
}
var xxx_messageInfo_TallyResult proto.InternalMessageInfo
func (m *TallyResult) GetTotalYes() uint32 {
if m != nil {
return m.TotalYes
}
return 0
}
func (m *TallyResult) GetTotalNo() uint32 {
if m != nil {
return m.TotalNo
}
return 0
}
func (m *TallyResult) GetTotalAbstain() uint32 {
if m != nil {
return m.TotalAbstain
}
return 0
}
func (m *TallyResult) GetTotalWeightElectorate() uint64 {
if m != nil {
return m.TotalWeightElectorate
}
return 0
}
func (m *TallyResult) GetThreshold() Fraction {
if m != nil {
return m.Threshold
}
return Fraction{}
}
// Vote combines the elector and his voted option to archive them.
type Vote struct {
Elector Elector `protobuf:"bytes,1,opt,name=elector,proto3" json:"elector"`
Voted VoteOption `protobuf:"varint,2,opt,name=voted,proto3,enum=gov.VoteOption" json:"voted,omitempty"`
}
func (m *Vote) Reset() { *m = Vote{} }
func (m *Vote) String() string { return proto.CompactTextString(m) }
func (*Vote) ProtoMessage() {}
func (*Vote) Descriptor() ([]byte, []int) {
return fileDescriptor_24f6e3c5f1b82a85, []int{6}
}
func (m *Vote) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Vote.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Vote) XXX_Merge(src proto.Message) {
xxx_messageInfo_Vote.Merge(m, src)
}
func (m *Vote) XXX_Size() int {
return m.Size()
}
func (m *Vote) XXX_DiscardUnknown() {
xxx_messageInfo_Vote.DiscardUnknown(m)
}
var xxx_messageInfo_Vote proto.InternalMessageInfo
func (m *Vote) GetElector() Elector {
if m != nil {
return m.Elector
}
return Elector{}
}
func (m *Vote) GetVoted() VoteOption {
if m != nil {
return m.Voted
}
return VoteOption_Invalid
}
// CreateTextProposalMsg creates a new governance proposal.
type CreateTextProposalMsg struct {
// Human readable title. Must match `^[a-zA-Z0-9 _.-]{4,128}$`
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
// Human readable description with 3 to 5000 chars.
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
// Reference to the election rule
ElectionRuleID []byte `protobuf:"bytes,3,opt,name=election_rule_id,json=electionRuleId,proto3" json:"election_rule_id,omitempty"`
// Reference to the electorate to define the group of possible voters.
ElectorateID []byte `protobuf:"bytes,4,opt,name=electorate_id,json=electorateId,proto3" json:"electorate_id,omitempty"`
// Unix timestamp when the proposal starts. Must be in the future.
StartTime github_com_iov_one_weave.UnixTime `protobuf:"varint,5,opt,name=start_time,json=startTime,proto3,casttype=github.com/iov-one/weave.UnixTime" json:"start_time,omitempty"`
// Author is an optional field to set the address of the author with a proposal. The author must sign the message.
// When not set it will default to the main signer.
Author github_com_iov_one_weave.Address `protobuf:"bytes,8,opt,name=author,proto3,casttype=github.com/iov-one/weave.Address" json:"author,omitempty"`
}
func (m *CreateTextProposalMsg) Reset() { *m = CreateTextProposalMsg{} }
func (m *CreateTextProposalMsg) String() string { return proto.CompactTextString(m) }
func (*CreateTextProposalMsg) ProtoMessage() {}
func (*CreateTextProposalMsg) Descriptor() ([]byte, []int) {
return fileDescriptor_24f6e3c5f1b82a85, []int{7}
}
func (m *CreateTextProposalMsg) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *CreateTextProposalMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_CreateTextProposalMsg.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *CreateTextProposalMsg) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateTextProposalMsg.Merge(m, src)
}
func (m *CreateTextProposalMsg) XXX_Size() int {
return m.Size()
}
func (m *CreateTextProposalMsg) XXX_DiscardUnknown() {
xxx_messageInfo_CreateTextProposalMsg.DiscardUnknown(m)
}
var xxx_messageInfo_CreateTextProposalMsg proto.InternalMessageInfo
func (m *CreateTextProposalMsg) GetTitle() string {
if m != nil {
return m.Title
}
return ""
}
func (m *CreateTextProposalMsg) GetDescription() string {
if m != nil {
return m.Description
}
return ""
}
func (m *CreateTextProposalMsg) GetElectionRuleID() []byte {
if m != nil {
return m.ElectionRuleID
}
return nil
}
func (m *CreateTextProposalMsg) GetElectorateID() []byte {
if m != nil {
return m.ElectorateID
}
return nil
}
func (m *CreateTextProposalMsg) GetStartTime() github_com_iov_one_weave.UnixTime {
if m != nil {
return m.StartTime
}
return 0
}
func (m *CreateTextProposalMsg) GetAuthor() github_com_iov_one_weave.Address {
if m != nil {
return m.Author
}
return nil
}
// VoteMsg is the way to express a voice and participate in an election of a proposal on chain.
type VoteMsg struct {
// The unique id of the proposal.
ProposalID []byte `protobuf:"bytes,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
// voter address is an optional field. When not set the main signer will be used as default. The voter address
// must be included in the electorate for a valid vote.
Voter github_com_iov_one_weave.Address `protobuf:"bytes,2,opt,name=voter,proto3,casttype=github.com/iov-one/weave.Address" json:"voter,omitempty"`
// Option for the vote. Must be Yes, No or Abstain for a valid vote.
Selected VoteOption `protobuf:"varint,3,opt,name=selected,proto3,enum=gov.VoteOption" json:"selected,omitempty"`
}
func (m *VoteMsg) Reset() { *m = VoteMsg{} }
func (m *VoteMsg) String() string { return proto.CompactTextString(m) }
func (*VoteMsg) ProtoMessage() {}
func (*VoteMsg) Descriptor() ([]byte, []int) {
return fileDescriptor_24f6e3c5f1b82a85, []int{8}
}
func (m *VoteMsg) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *VoteMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_VoteMsg.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *VoteMsg) XXX_Merge(src proto.Message) {
xxx_messageInfo_VoteMsg.Merge(m, src)
}
func (m *VoteMsg) XXX_Size() int {
return m.Size()
}
func (m *VoteMsg) XXX_DiscardUnknown() {
xxx_messageInfo_VoteMsg.DiscardUnknown(m)
}
var xxx_messageInfo_VoteMsg proto.InternalMessageInfo
func (m *VoteMsg) GetProposalID() []byte {
if m != nil {
return m.ProposalID
}
return nil
}
func (m *VoteMsg) GetVoter() github_com_iov_one_weave.Address {
if m != nil {
return m.Voter
}
return nil
}
func (m *VoteMsg) GetSelected() VoteOption {
if m != nil {
return m.Selected
}
return VoteOption_Invalid
}
// TallyMsg can be sent after the voting period has ended to do the final tally and trigger any state changes.
// A final tally can be execute only once. A second submission will fail with an invalid state error.
type TallyMsg struct {
// ProposalID is UUID of the proposal to close.
ProposalID []byte `protobuf:"bytes,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
}
func (m *TallyMsg) Reset() { *m = TallyMsg{} }
func (m *TallyMsg) String() string { return proto.CompactTextString(m) }
func (*TallyMsg) ProtoMessage() {}
func (*TallyMsg) Descriptor() ([]byte, []int) {
return fileDescriptor_24f6e3c5f1b82a85, []int{9}
}
func (m *TallyMsg) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *TallyMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_TallyMsg.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *TallyMsg) XXX_Merge(src proto.Message) {
xxx_messageInfo_TallyMsg.Merge(m, src)
}
func (m *TallyMsg) XXX_Size() int {
return m.Size()
}
func (m *TallyMsg) XXX_DiscardUnknown() {
xxx_messageInfo_TallyMsg.DiscardUnknown(m)
}
var xxx_messageInfo_TallyMsg proto.InternalMessageInfo
func (m *TallyMsg) GetProposalID() []byte {
if m != nil {
return m.ProposalID
}
return nil
}
func init() {
proto.RegisterEnum("gov.VoteOption", VoteOption_name, VoteOption_value)
proto.RegisterEnum("gov.TextProposal_Status", TextProposal_Status_name, TextProposal_Status_value)
proto.RegisterType((*Electorate)(nil), "gov.Electorate")
proto.RegisterType((*Elector)(nil), "gov.Elector")
proto.RegisterType((*ElectionRule)(nil), "gov.ElectionRule")
proto.RegisterType((*Fraction)(nil), "gov.Fraction")
proto.RegisterType((*TextProposal)(nil), "gov.TextProposal")
proto.RegisterType((*TallyResult)(nil), "gov.TallyResult")
proto.RegisterType((*Vote)(nil), "gov.Vote")
proto.RegisterType((*CreateTextProposalMsg)(nil), "gov.CreateTextProposalMsg")
proto.RegisterType((*VoteMsg)(nil), "gov.VoteMsg")
proto.RegisterType((*TallyMsg)(nil), "gov.TallyMsg")
}
func init() { proto.RegisterFile("x/gov/codec.proto", fileDescriptor_24f6e3c5f1b82a85) }
var fileDescriptor_24f6e3c5f1b82a85 = []byte{
// 1043 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x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f, 0x12, 0xc0, 0x3a, 0x2b, 0xba, 0x03, 0xb7, 0x8f, 0xfb, 0x86,
0x6a, 0xf6, 0x07, 0x86, 0xd6, 0xef, 0x5d, 0xb7, 0x2c, 0xf6, 0x60, 0x27, 0x8e, 0x7a, 0xa2, 0x0e,
0xcb, 0x52, 0x25, 0x73, 0x76, 0xae, 0x24, 0xc3, 0x41, 0xac, 0x40, 0x29, 0x1e, 0xed, 0xf5, 0xcb,
0x89, 0x4a, 0xfa, 0xec, 0x5c, 0x49, 0xf4, 0xc8, 0xdf, 0xf3, 0xb7, 0x3b, 0x43, 0xa3, 0xad, 0xf5,
0xca, 0x49, 0x91, 0x3f, 0x1a, 0xc5, 0x8e, 0x7c, 0xb1, 0xac, 0x4a, 0x2f, 0x96, 0x55, 0xe9, 0x8f,
0x65, 0x55, 0xfa, 0xf1, 0xb2, 0xba, 0xf5, 0xe2, 0xb2, 0xba, 0xf5, 0xfb, 0x65, 0x75, 0xeb, 0x24,
0xcd, 0xff, 0x29, 0x7d, 0xf4, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xaf, 0xc4, 0xc3, 0x59, 0x72,
0x09, 0x00, 0x00,
}
func (m *Electorate) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Electorate) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Title) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintCodec(dAtA, i, uint64(len(m.Title)))
i += copy(dAtA[i:], m.Title)
}
if len(m.Electors) > 0 {
for _, msg := range m.Electors {
dAtA[i] = 0x12
i++
i = encodeVarintCodec(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if m.TotalWeightElectorate != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintCodec(dAtA, i, uint64(m.TotalWeightElectorate))
}
return i, nil
}
func (m *Elector) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Elector) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Signature) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintCodec(dAtA, i, uint64(len(m.Signature)))
i += copy(dAtA[i:], m.Signature)
}
if m.Weight != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintCodec(dAtA, i, uint64(m.Weight))
}
return i, nil
}
func (m *ElectionRule) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ElectionRule) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Title) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintCodec(dAtA, i, uint64(len(m.Title)))
i += copy(dAtA[i:], m.Title)
}
if m.VotingPeriodHours != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintCodec(dAtA, i, uint64(m.VotingPeriodHours))
}
dAtA[i] = 0x22