github.com/Finschia/finschia-sdk@v0.48.1/x/gov/types/gov.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: cosmos/gov/v1beta1/gov.proto 3 4 package types 5 6 import ( 7 fmt "fmt" 8 types1 "github.com/Finschia/finschia-sdk/codec/types" 9 github_com_Finschia_finschia_sdk_types "github.com/Finschia/finschia-sdk/types" 10 types "github.com/Finschia/finschia-sdk/types" 11 _ "github.com/gogo/protobuf/gogoproto" 12 proto "github.com/gogo/protobuf/proto" 13 github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" 14 _ "github.com/regen-network/cosmos-proto" 15 _ "google.golang.org/protobuf/types/known/durationpb" 16 _ "google.golang.org/protobuf/types/known/timestamppb" 17 io "io" 18 math "math" 19 math_bits "math/bits" 20 time "time" 21 ) 22 23 // Reference imports to suppress errors if they are not otherwise used. 24 var _ = proto.Marshal 25 var _ = fmt.Errorf 26 var _ = math.Inf 27 var _ = time.Kitchen 28 29 // This is a compile-time assertion to ensure that this generated file 30 // is compatible with the proto package it is being compiled against. 31 // A compilation error at this line likely means your copy of the 32 // proto package needs to be updated. 33 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 34 35 // VoteOption enumerates the valid vote options for a given governance proposal. 36 type VoteOption int32 37 38 const ( 39 // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. 40 OptionEmpty VoteOption = 0 41 // VOTE_OPTION_YES defines a yes vote option. 42 OptionYes VoteOption = 1 43 // VOTE_OPTION_ABSTAIN defines an abstain vote option. 44 OptionAbstain VoteOption = 2 45 // VOTE_OPTION_NO defines a no vote option. 46 OptionNo VoteOption = 3 47 // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. 48 OptionNoWithVeto VoteOption = 4 49 ) 50 51 var VoteOption_name = map[int32]string{ 52 0: "VOTE_OPTION_UNSPECIFIED", 53 1: "VOTE_OPTION_YES", 54 2: "VOTE_OPTION_ABSTAIN", 55 3: "VOTE_OPTION_NO", 56 4: "VOTE_OPTION_NO_WITH_VETO", 57 } 58 59 var VoteOption_value = map[string]int32{ 60 "VOTE_OPTION_UNSPECIFIED": 0, 61 "VOTE_OPTION_YES": 1, 62 "VOTE_OPTION_ABSTAIN": 2, 63 "VOTE_OPTION_NO": 3, 64 "VOTE_OPTION_NO_WITH_VETO": 4, 65 } 66 67 func (x VoteOption) String() string { 68 return proto.EnumName(VoteOption_name, int32(x)) 69 } 70 71 func (VoteOption) EnumDescriptor() ([]byte, []int) { 72 return fileDescriptor_6e82113c1a9a4b7c, []int{0} 73 } 74 75 // ProposalStatus enumerates the valid statuses of a proposal. 76 type ProposalStatus int32 77 78 const ( 79 // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. 80 StatusNil ProposalStatus = 0 81 // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit 82 // period. 83 StatusDepositPeriod ProposalStatus = 1 84 // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting 85 // period. 86 StatusVotingPeriod ProposalStatus = 2 87 // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has 88 // passed. 89 StatusPassed ProposalStatus = 3 90 // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has 91 // been rejected. 92 StatusRejected ProposalStatus = 4 93 // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has 94 // failed. 95 StatusFailed ProposalStatus = 5 96 ) 97 98 var ProposalStatus_name = map[int32]string{ 99 0: "PROPOSAL_STATUS_UNSPECIFIED", 100 1: "PROPOSAL_STATUS_DEPOSIT_PERIOD", 101 2: "PROPOSAL_STATUS_VOTING_PERIOD", 102 3: "PROPOSAL_STATUS_PASSED", 103 4: "PROPOSAL_STATUS_REJECTED", 104 5: "PROPOSAL_STATUS_FAILED", 105 } 106 107 var ProposalStatus_value = map[string]int32{ 108 "PROPOSAL_STATUS_UNSPECIFIED": 0, 109 "PROPOSAL_STATUS_DEPOSIT_PERIOD": 1, 110 "PROPOSAL_STATUS_VOTING_PERIOD": 2, 111 "PROPOSAL_STATUS_PASSED": 3, 112 "PROPOSAL_STATUS_REJECTED": 4, 113 "PROPOSAL_STATUS_FAILED": 5, 114 } 115 116 func (x ProposalStatus) String() string { 117 return proto.EnumName(ProposalStatus_name, int32(x)) 118 } 119 120 func (ProposalStatus) EnumDescriptor() ([]byte, []int) { 121 return fileDescriptor_6e82113c1a9a4b7c, []int{1} 122 } 123 124 // WeightedVoteOption defines a unit of vote for vote split. 125 // 126 // Since: cosmos-sdk 0.43 127 type WeightedVoteOption struct { 128 Option VoteOption `protobuf:"varint,1,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` 129 Weight github_com_Finschia_finschia_sdk_types.Dec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/Finschia/finschia-sdk/types.Dec" json:"weight" yaml:"weight"` 130 } 131 132 func (m *WeightedVoteOption) Reset() { *m = WeightedVoteOption{} } 133 func (*WeightedVoteOption) ProtoMessage() {} 134 func (*WeightedVoteOption) Descriptor() ([]byte, []int) { 135 return fileDescriptor_6e82113c1a9a4b7c, []int{0} 136 } 137 func (m *WeightedVoteOption) XXX_Unmarshal(b []byte) error { 138 return m.Unmarshal(b) 139 } 140 func (m *WeightedVoteOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 141 if deterministic { 142 return xxx_messageInfo_WeightedVoteOption.Marshal(b, m, deterministic) 143 } else { 144 b = b[:cap(b)] 145 n, err := m.MarshalToSizedBuffer(b) 146 if err != nil { 147 return nil, err 148 } 149 return b[:n], nil 150 } 151 } 152 func (m *WeightedVoteOption) XXX_Merge(src proto.Message) { 153 xxx_messageInfo_WeightedVoteOption.Merge(m, src) 154 } 155 func (m *WeightedVoteOption) XXX_Size() int { 156 return m.Size() 157 } 158 func (m *WeightedVoteOption) XXX_DiscardUnknown() { 159 xxx_messageInfo_WeightedVoteOption.DiscardUnknown(m) 160 } 161 162 var xxx_messageInfo_WeightedVoteOption proto.InternalMessageInfo 163 164 // TextProposal defines a standard text proposal whose changes need to be 165 // manually updated in case of approval. 166 type TextProposal struct { 167 Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` 168 Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` 169 } 170 171 func (m *TextProposal) Reset() { *m = TextProposal{} } 172 func (*TextProposal) ProtoMessage() {} 173 func (*TextProposal) Descriptor() ([]byte, []int) { 174 return fileDescriptor_6e82113c1a9a4b7c, []int{1} 175 } 176 func (m *TextProposal) XXX_Unmarshal(b []byte) error { 177 return m.Unmarshal(b) 178 } 179 func (m *TextProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 180 if deterministic { 181 return xxx_messageInfo_TextProposal.Marshal(b, m, deterministic) 182 } else { 183 b = b[:cap(b)] 184 n, err := m.MarshalToSizedBuffer(b) 185 if err != nil { 186 return nil, err 187 } 188 return b[:n], nil 189 } 190 } 191 func (m *TextProposal) XXX_Merge(src proto.Message) { 192 xxx_messageInfo_TextProposal.Merge(m, src) 193 } 194 func (m *TextProposal) XXX_Size() int { 195 return m.Size() 196 } 197 func (m *TextProposal) XXX_DiscardUnknown() { 198 xxx_messageInfo_TextProposal.DiscardUnknown(m) 199 } 200 201 var xxx_messageInfo_TextProposal proto.InternalMessageInfo 202 203 // Deposit defines an amount deposited by an account address to an active 204 // proposal. 205 type Deposit struct { 206 ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"` 207 Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` 208 Amount github_com_Finschia_finschia_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coins" json:"amount"` 209 } 210 211 func (m *Deposit) Reset() { *m = Deposit{} } 212 func (*Deposit) ProtoMessage() {} 213 func (*Deposit) Descriptor() ([]byte, []int) { 214 return fileDescriptor_6e82113c1a9a4b7c, []int{2} 215 } 216 func (m *Deposit) XXX_Unmarshal(b []byte) error { 217 return m.Unmarshal(b) 218 } 219 func (m *Deposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 220 if deterministic { 221 return xxx_messageInfo_Deposit.Marshal(b, m, deterministic) 222 } else { 223 b = b[:cap(b)] 224 n, err := m.MarshalToSizedBuffer(b) 225 if err != nil { 226 return nil, err 227 } 228 return b[:n], nil 229 } 230 } 231 func (m *Deposit) XXX_Merge(src proto.Message) { 232 xxx_messageInfo_Deposit.Merge(m, src) 233 } 234 func (m *Deposit) XXX_Size() int { 235 return m.Size() 236 } 237 func (m *Deposit) XXX_DiscardUnknown() { 238 xxx_messageInfo_Deposit.DiscardUnknown(m) 239 } 240 241 var xxx_messageInfo_Deposit proto.InternalMessageInfo 242 243 // Proposal defines the core field members of a governance proposal. 244 type Proposal struct { 245 ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"id" yaml:"id"` 246 Content *types1.Any `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` 247 Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"status,omitempty" yaml:"proposal_status"` 248 FinalTallyResult TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result" yaml:"final_tally_result"` 249 SubmitTime time.Time `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time" yaml:"submit_time"` 250 DepositEndTime time.Time `protobuf:"bytes,6,opt,name=deposit_end_time,json=depositEndTime,proto3,stdtime" json:"deposit_end_time" yaml:"deposit_end_time"` 251 TotalDeposit github_com_Finschia_finschia_sdk_types.Coins `protobuf:"bytes,7,rep,name=total_deposit,json=totalDeposit,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coins" json:"total_deposit" yaml:"total_deposit"` 252 VotingStartTime time.Time `protobuf:"bytes,8,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time" yaml:"voting_start_time"` 253 VotingEndTime time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time" yaml:"voting_end_time"` 254 } 255 256 func (m *Proposal) Reset() { *m = Proposal{} } 257 func (*Proposal) ProtoMessage() {} 258 func (*Proposal) Descriptor() ([]byte, []int) { 259 return fileDescriptor_6e82113c1a9a4b7c, []int{3} 260 } 261 func (m *Proposal) XXX_Unmarshal(b []byte) error { 262 return m.Unmarshal(b) 263 } 264 func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 265 if deterministic { 266 return xxx_messageInfo_Proposal.Marshal(b, m, deterministic) 267 } else { 268 b = b[:cap(b)] 269 n, err := m.MarshalToSizedBuffer(b) 270 if err != nil { 271 return nil, err 272 } 273 return b[:n], nil 274 } 275 } 276 func (m *Proposal) XXX_Merge(src proto.Message) { 277 xxx_messageInfo_Proposal.Merge(m, src) 278 } 279 func (m *Proposal) XXX_Size() int { 280 return m.Size() 281 } 282 func (m *Proposal) XXX_DiscardUnknown() { 283 xxx_messageInfo_Proposal.DiscardUnknown(m) 284 } 285 286 var xxx_messageInfo_Proposal proto.InternalMessageInfo 287 288 // TallyResult defines a standard tally for a governance proposal. 289 type TallyResult struct { 290 Yes github_com_Finschia_finschia_sdk_types.Int `protobuf:"bytes,1,opt,name=yes,proto3,customtype=github.com/Finschia/finschia-sdk/types.Int" json:"yes"` 291 Abstain github_com_Finschia_finschia_sdk_types.Int `protobuf:"bytes,2,opt,name=abstain,proto3,customtype=github.com/Finschia/finschia-sdk/types.Int" json:"abstain"` 292 No github_com_Finschia_finschia_sdk_types.Int `protobuf:"bytes,3,opt,name=no,proto3,customtype=github.com/Finschia/finschia-sdk/types.Int" json:"no"` 293 NoWithVeto github_com_Finschia_finschia_sdk_types.Int `protobuf:"bytes,4,opt,name=no_with_veto,json=noWithVeto,proto3,customtype=github.com/Finschia/finschia-sdk/types.Int" json:"no_with_veto" yaml:"no_with_veto"` 294 } 295 296 func (m *TallyResult) Reset() { *m = TallyResult{} } 297 func (*TallyResult) ProtoMessage() {} 298 func (*TallyResult) Descriptor() ([]byte, []int) { 299 return fileDescriptor_6e82113c1a9a4b7c, []int{4} 300 } 301 func (m *TallyResult) XXX_Unmarshal(b []byte) error { 302 return m.Unmarshal(b) 303 } 304 func (m *TallyResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 305 if deterministic { 306 return xxx_messageInfo_TallyResult.Marshal(b, m, deterministic) 307 } else { 308 b = b[:cap(b)] 309 n, err := m.MarshalToSizedBuffer(b) 310 if err != nil { 311 return nil, err 312 } 313 return b[:n], nil 314 } 315 } 316 func (m *TallyResult) XXX_Merge(src proto.Message) { 317 xxx_messageInfo_TallyResult.Merge(m, src) 318 } 319 func (m *TallyResult) XXX_Size() int { 320 return m.Size() 321 } 322 func (m *TallyResult) XXX_DiscardUnknown() { 323 xxx_messageInfo_TallyResult.DiscardUnknown(m) 324 } 325 326 var xxx_messageInfo_TallyResult proto.InternalMessageInfo 327 328 // Vote defines a vote on a governance proposal. 329 // A Vote consists of a proposal ID, the voter, and the vote option. 330 type Vote struct { 331 ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"` 332 Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` 333 // Deprecated: Prefer to use `options` instead. This field is set in queries 334 // if and only if `len(options) == 1` and that option has weight 1. In all 335 // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. 336 Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. 337 // Since: cosmos-sdk 0.43 338 Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"` 339 } 340 341 func (m *Vote) Reset() { *m = Vote{} } 342 func (*Vote) ProtoMessage() {} 343 func (*Vote) Descriptor() ([]byte, []int) { 344 return fileDescriptor_6e82113c1a9a4b7c, []int{5} 345 } 346 func (m *Vote) XXX_Unmarshal(b []byte) error { 347 return m.Unmarshal(b) 348 } 349 func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 350 if deterministic { 351 return xxx_messageInfo_Vote.Marshal(b, m, deterministic) 352 } else { 353 b = b[:cap(b)] 354 n, err := m.MarshalToSizedBuffer(b) 355 if err != nil { 356 return nil, err 357 } 358 return b[:n], nil 359 } 360 } 361 func (m *Vote) XXX_Merge(src proto.Message) { 362 xxx_messageInfo_Vote.Merge(m, src) 363 } 364 func (m *Vote) XXX_Size() int { 365 return m.Size() 366 } 367 func (m *Vote) XXX_DiscardUnknown() { 368 xxx_messageInfo_Vote.DiscardUnknown(m) 369 } 370 371 var xxx_messageInfo_Vote proto.InternalMessageInfo 372 373 // DepositParams defines the params for deposits on governance proposals. 374 type DepositParams struct { 375 // Minimum deposit for a proposal to enter voting period. 376 MinDeposit github_com_Finschia_finschia_sdk_types.Coins `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coins" json:"min_deposit,omitempty" yaml:"min_deposit"` 377 // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 378 // months. 379 MaxDepositPeriod time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period,omitempty" yaml:"max_deposit_period"` 380 } 381 382 func (m *DepositParams) Reset() { *m = DepositParams{} } 383 func (*DepositParams) ProtoMessage() {} 384 func (*DepositParams) Descriptor() ([]byte, []int) { 385 return fileDescriptor_6e82113c1a9a4b7c, []int{6} 386 } 387 func (m *DepositParams) XXX_Unmarshal(b []byte) error { 388 return m.Unmarshal(b) 389 } 390 func (m *DepositParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 391 if deterministic { 392 return xxx_messageInfo_DepositParams.Marshal(b, m, deterministic) 393 } else { 394 b = b[:cap(b)] 395 n, err := m.MarshalToSizedBuffer(b) 396 if err != nil { 397 return nil, err 398 } 399 return b[:n], nil 400 } 401 } 402 func (m *DepositParams) XXX_Merge(src proto.Message) { 403 xxx_messageInfo_DepositParams.Merge(m, src) 404 } 405 func (m *DepositParams) XXX_Size() int { 406 return m.Size() 407 } 408 func (m *DepositParams) XXX_DiscardUnknown() { 409 xxx_messageInfo_DepositParams.DiscardUnknown(m) 410 } 411 412 var xxx_messageInfo_DepositParams proto.InternalMessageInfo 413 414 // VotingParams defines the params for voting on governance proposals. 415 type VotingParams struct { 416 // Length of the voting period. 417 VotingPeriod time.Duration `protobuf:"bytes,1,opt,name=voting_period,json=votingPeriod,proto3,stdduration" json:"voting_period,omitempty" yaml:"voting_period"` 418 } 419 420 func (m *VotingParams) Reset() { *m = VotingParams{} } 421 func (*VotingParams) ProtoMessage() {} 422 func (*VotingParams) Descriptor() ([]byte, []int) { 423 return fileDescriptor_6e82113c1a9a4b7c, []int{7} 424 } 425 func (m *VotingParams) XXX_Unmarshal(b []byte) error { 426 return m.Unmarshal(b) 427 } 428 func (m *VotingParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 429 if deterministic { 430 return xxx_messageInfo_VotingParams.Marshal(b, m, deterministic) 431 } else { 432 b = b[:cap(b)] 433 n, err := m.MarshalToSizedBuffer(b) 434 if err != nil { 435 return nil, err 436 } 437 return b[:n], nil 438 } 439 } 440 func (m *VotingParams) XXX_Merge(src proto.Message) { 441 xxx_messageInfo_VotingParams.Merge(m, src) 442 } 443 func (m *VotingParams) XXX_Size() int { 444 return m.Size() 445 } 446 func (m *VotingParams) XXX_DiscardUnknown() { 447 xxx_messageInfo_VotingParams.DiscardUnknown(m) 448 } 449 450 var xxx_messageInfo_VotingParams proto.InternalMessageInfo 451 452 // TallyParams defines the params for tallying votes on governance proposals. 453 type TallyParams struct { 454 // Minimum percentage of total stake needed to vote for a result to be 455 // considered valid. 456 Quorum github_com_Finschia_finschia_sdk_types.Dec `protobuf:"bytes,1,opt,name=quorum,proto3,customtype=github.com/Finschia/finschia-sdk/types.Dec" json:"quorum,omitempty"` 457 // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. 458 Threshold github_com_Finschia_finschia_sdk_types.Dec `protobuf:"bytes,2,opt,name=threshold,proto3,customtype=github.com/Finschia/finschia-sdk/types.Dec" json:"threshold,omitempty"` 459 // Minimum value of Veto votes to Total votes ratio for proposal to be 460 // vetoed. Default value: 1/3. 461 VetoThreshold github_com_Finschia_finschia_sdk_types.Dec `protobuf:"bytes,3,opt,name=veto_threshold,json=vetoThreshold,proto3,customtype=github.com/Finschia/finschia-sdk/types.Dec" json:"veto_threshold,omitempty" yaml:"veto_threshold"` 462 } 463 464 func (m *TallyParams) Reset() { *m = TallyParams{} } 465 func (*TallyParams) ProtoMessage() {} 466 func (*TallyParams) Descriptor() ([]byte, []int) { 467 return fileDescriptor_6e82113c1a9a4b7c, []int{8} 468 } 469 func (m *TallyParams) XXX_Unmarshal(b []byte) error { 470 return m.Unmarshal(b) 471 } 472 func (m *TallyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 473 if deterministic { 474 return xxx_messageInfo_TallyParams.Marshal(b, m, deterministic) 475 } else { 476 b = b[:cap(b)] 477 n, err := m.MarshalToSizedBuffer(b) 478 if err != nil { 479 return nil, err 480 } 481 return b[:n], nil 482 } 483 } 484 func (m *TallyParams) XXX_Merge(src proto.Message) { 485 xxx_messageInfo_TallyParams.Merge(m, src) 486 } 487 func (m *TallyParams) XXX_Size() int { 488 return m.Size() 489 } 490 func (m *TallyParams) XXX_DiscardUnknown() { 491 xxx_messageInfo_TallyParams.DiscardUnknown(m) 492 } 493 494 var xxx_messageInfo_TallyParams proto.InternalMessageInfo 495 496 func init() { 497 proto.RegisterEnum("cosmos.gov.v1beta1.VoteOption", VoteOption_name, VoteOption_value) 498 proto.RegisterEnum("cosmos.gov.v1beta1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) 499 proto.RegisterType((*WeightedVoteOption)(nil), "cosmos.gov.v1beta1.WeightedVoteOption") 500 proto.RegisterType((*TextProposal)(nil), "cosmos.gov.v1beta1.TextProposal") 501 proto.RegisterType((*Deposit)(nil), "cosmos.gov.v1beta1.Deposit") 502 proto.RegisterType((*Proposal)(nil), "cosmos.gov.v1beta1.Proposal") 503 proto.RegisterType((*TallyResult)(nil), "cosmos.gov.v1beta1.TallyResult") 504 proto.RegisterType((*Vote)(nil), "cosmos.gov.v1beta1.Vote") 505 proto.RegisterType((*DepositParams)(nil), "cosmos.gov.v1beta1.DepositParams") 506 proto.RegisterType((*VotingParams)(nil), "cosmos.gov.v1beta1.VotingParams") 507 proto.RegisterType((*TallyParams)(nil), "cosmos.gov.v1beta1.TallyParams") 508 } 509 510 func init() { proto.RegisterFile("cosmos/gov/v1beta1/gov.proto", fileDescriptor_6e82113c1a9a4b7c) } 511 512 var fileDescriptor_6e82113c1a9a4b7c = []byte{ 513 // 1457 bytes of a gzipped FileDescriptorProto 514 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xc1, 0x6f, 0x1b, 0xc5, 515 0x17, 0xf6, 0xda, 0x8e, 0x13, 0x8f, 0x9d, 0x64, 0x3b, 0x49, 0x13, 0xc7, 0xbf, 0xfe, 0x76, 0xcd, 516 0x82, 0x50, 0x15, 0xa5, 0x36, 0x0d, 0x15, 0x88, 0xf4, 0xe4, 0x8d, 0x37, 0x60, 0x14, 0xc5, 0xd6, 517 0x7a, 0xeb, 0xa8, 0x54, 0x62, 0xb5, 0xb1, 0x27, 0xce, 0x52, 0xef, 0x8e, 0xf1, 0x8e, 0xd3, 0x44, 518 0x5c, 0x38, 0x56, 0x06, 0xa1, 0x1e, 0x7b, 0xb1, 0xa8, 0xc4, 0x09, 0xce, 0xfc, 0x05, 0x9c, 0x2a, 519 0xc4, 0xa1, 0x82, 0x4b, 0xc5, 0xc1, 0xa5, 0x89, 0x04, 0x55, 0x8f, 0x39, 0x72, 0x42, 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x4e, 0xb6, 0x86, 0xad, 0xdc, 0x86, 0x69, 0x3b, 0xb5, 0x3d, 0xd3, 0xc8, 0xed, 0xb2, 0x87, 532 0x1b, 0x4e, 0xfd, 0x7e, 0x8e, 0x1c, 0xb6, 0x90, 0x93, 0x2d, 0xa0, 0xda, 0x49, 0x5f, 0x9c, 0x3e, 533 0x34, 0xac, 0xe6, 0x9a, 0x44, 0x99, 0x24, 0x95, 0x51, 0x4a, 0xdb, 0x20, 0xa9, 0xa1, 0x03, 0x52, 534 0x6e, 0xe3, 0x16, 0x76, 0x8c, 0x26, 0x9c, 0x07, 0x13, 0xc4, 0x24, 0x4d, 0xe4, 0xd5, 0x18, 0x57, 535 0xe9, 0x0b, 0xcc, 0x80, 0x44, 0x1d, 0x39, 0xb5, 0xb6, 0x49, 0xeb, 0xf7, 0xea, 0x50, 0x83, 0xa1, 536 0xb5, 0xd9, 0x57, 0x4f, 0x44, 0xee, 0xf7, 0x9f, 0x6f, 0x4c, 0xae, 0x63, 0x9b, 0x20, 0x9b, 0x48, 537 0x7f, 0x70, 0x60, 0xb2, 0x80, 0x5a, 0xd8, 0x31, 0x09, 0xfc, 0x10, 0x24, 0x5a, 0x4c, 0x40, 0x37, 538 0xeb, 0x1e, 0x75, 0x54, 0x5e, 0x38, 0xe9, 0x8b, 0x90, 0x16, 0x15, 0x58, 0x94, 0x54, 0xe0, 0xbf, 539 0x15, 0xeb, 0xf0, 0x1a, 0x88, 0xd7, 0x29, 0x07, 0x6e, 0x33, 0xd5, 0x41, 0x00, 0x36, 0x40, 0xcc, 540 0xb0, 0x70, 0xc7, 0x26, 0xa9, 0x48, 0x26, 0x72, 0x3d, 0xb1, 0xba, 0xe4, 0x1b, 0xea, 0x9e, 0x92, 541 0x53, 0x47, 0xd7, 0xb1, 0x69, 0xcb, 0xb7, 0x5c, 0xcf, 0x7e, 0x7a, 0x21, 0xae, 0xbc, 0xa1, 0x67, 542 0x2e, 0xc8, 0x51, 0x19, 0xfd, 0xda, 0xd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, 0x23, 0xbb, 0x4e, 0x15, 0x62, 554 0xe7, 0x2a, 0xbc, 0xcd, 0x14, 0x16, 0xa9, 0xc2, 0x28, 0x03, 0x95, 0x99, 0x61, 0x61, 0xc5, 0xae, 555 0x7b, 0x52, 0xdf, 0x72, 0x60, 0x9a, 0x60, 0x62, 0x34, 0x75, 0xb6, 0x90, 0x9a, 0x3c, 0xef, 0x30, 556 0x6e, 0x32, 0x9d, 0x79, 0xaa, 0x33, 0x84, 0x96, 0x2e, 0x7c, 0x48, 0x93, 0x1e, 0xde, 0x6f, 0xb5, 557 0x26, 0xb8, 0xb2, 0x8f, 0x89, 0x69, 0x37, 0xdc, 0x9f, 0xb8, 0xcd, 0xcc, 0x9d, 0x3a, 0x77, 0xeb, 558 0xef, 0xb0, 0x92, 0x52, 0xb4, 0xa4, 0x31, 0x0a, 0xba, 0xf7, 0x59, 0x1a, 0xaf, 0xb8, 0x61, 0x6f, 559 0xf3, 0xbb, 0x80, 0x85, 0x06, 0x36, 0xc7, 0xcf, 0xd5, 0x92, 0x98, 0xd6, 0xc2, 0x90, 0xd6, 0xb0, 560 0xcb, 0xd3, 0x34, 0xca, 0x4c, 0x5e, 0x8b, 0xba, 0xd3, 0x45, 0x7a, 0x1e, 0x06, 0x89, 0xe0, 0x11, 561 0x2a, 0x80, 0xc8, 0x21, 0x72, 0xe8, 0xa4, 0x92, 0x57, 0x2f, 0x38, 0x15, 0x8b, 0x36, 0x51, 0x5d, 562 0x38, 0xdc, 0x04, 0x93, 0xc6, 0x8e, 0x43, 0x0c, 0x93, 0xcd, 0xb5, 0x4b, 0x31, 0xf9, 0x14, 0x50, 563 0x06, 0x61, 0x1b, 0x7b, 0xcd, 0x79, 0x39, 0xa2, 0xb0, 0x8d, 0xe1, 0x7d, 0x90, 0xb4, 0xb1, 0xfe, 564 0xc0, 0x24, 0x7b, 0xfa, 0x3e, 0x22, 0xd8, 0x6b, 0xc3, 0xb8, 0x5c, 0xbc, 0x38, 0xdb, 0x49, 0x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95, 0x4f, 0x95, 0x75, 0x4d, 0x29, 599 0xf0, 0xd1, 0x34, 0xec, 0xf6, 0x32, 0x33, 0x34, 0x5f, 0x45, 0x5f, 0xa0, 0x1a, 0x41, 0x67, 0xf2, 600 0x6f, 0xe4, 0x8b, 0x9b, 0x4a, 0x81, 0x9f, 0x08, 0xf2, 0x6f, 0x18, 0x66, 0x13, 0xd5, 0xa9, 0x9d, 601 0xb2, 0xfa, 0xf4, 0xa5, 0x10, 0x7a, 0xfe, 0x52, 0x08, 0x7d, 0x7d, 0x24, 0x84, 0x9e, 0x1e, 0x09, 602 0xdc, 0xb3, 0x23, 0x81, 0xfb, 0xeb, 0x48, 0xe0, 0x1e, 0x1d, 0x0b, 0xa1, 0x67, 0xc7, 0x42, 0xe8, 603 0xf9, 0xb1, 0x10, 0xfa, 0xec, 0xfc, 0x01, 0x79, 0xe0, 0xfd, 0x5d, 0xf4, 0xce, 0xf4, 0x4e, 0xcc, 604 0x9b, 0x29, 0xef, 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0x67, 0x1e, 0x7e, 0x9e, 0x49, 0x0e, 0x00, 605 0x00, 606 } 607 608 func (this *TextProposal) Equal(that interface{}) bool { 609 if that == nil { 610 return this == nil 611 } 612 613 that1, ok := that.(*TextProposal) 614 if !ok { 615 that2, ok := that.(TextProposal) 616 if ok { 617 that1 = &that2 618 } else { 619 return false 620 } 621 } 622 if that1 == nil { 623 return this == nil 624 } else if this == nil { 625 return false 626 } 627 if this.Title != that1.Title { 628 return false 629 } 630 if this.Description != that1.Description { 631 return false 632 } 633 return true 634 } 635 func (this *Proposal) Equal(that interface{}) bool { 636 if that == nil { 637 return this == nil 638 } 639 640 that1, ok := that.(*Proposal) 641 if !ok { 642 that2, ok := that.(Proposal) 643 if ok { 644 that1 = &that2 645 } else { 646 return false 647 } 648 } 649 if that1 == nil { 650 return this == nil 651 } else if this == nil { 652 return false 653 } 654 if this.ProposalId != that1.ProposalId { 655 return false 656 } 657 if !this.Content.Equal(that1.Content) { 658 return false 659 } 660 if this.Status != that1.Status { 661 return false 662 } 663 if !this.FinalTallyResult.Equal(&that1.FinalTallyResult) { 664 return false 665 } 666 if !this.SubmitTime.Equal(that1.SubmitTime) { 667 return false 668 } 669 if !this.DepositEndTime.Equal(that1.DepositEndTime) { 670 return false 671 } 672 if len(this.TotalDeposit) != len(that1.TotalDeposit) { 673 return false 674 } 675 for i := range this.TotalDeposit { 676 if !this.TotalDeposit[i].Equal(&that1.TotalDeposit[i]) { 677 return false 678 } 679 } 680 if !this.VotingStartTime.Equal(that1.VotingStartTime) { 681 return false 682 } 683 if !this.VotingEndTime.Equal(that1.VotingEndTime) { 684 return false 685 } 686 return true 687 } 688 func (this *TallyResult) Equal(that interface{}) bool { 689 if that == nil { 690 return this == nil 691 } 692 693 that1, ok := that.(*TallyResult) 694 if !ok { 695 that2, ok := that.(TallyResult) 696 if ok { 697 that1 = &that2 698 } else { 699 return false 700 } 701 } 702 if that1 == nil { 703 return this == nil 704 } else if this == nil { 705 return false 706 } 707 if !this.Yes.Equal(that1.Yes) { 708 return false 709 } 710 if !this.Abstain.Equal(that1.Abstain) { 711 return false 712 } 713 if !this.No.Equal(that1.No) { 714 return false 715 } 716 if !this.NoWithVeto.Equal(that1.NoWithVeto) { 717 return false 718 } 719 return true 720 } 721 func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { 722 size := m.Size() 723 dAtA = make([]byte, size) 724 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 725 if err != nil { 726 return nil, err 727 } 728 return dAtA[:n], nil 729 } 730 731 func (m *WeightedVoteOption) MarshalTo(dAtA []byte) (int, error) { 732 size := m.Size() 733 return m.MarshalToSizedBuffer(dAtA[:size]) 734 } 735 736 func (m *WeightedVoteOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { 737 i := len(dAtA) 738 _ = i 739 var l int 740 _ = l 741 { 742 size := m.Weight.Size() 743 i -= size 744 if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { 745 return 0, err 746 } 747 i = encodeVarintGov(dAtA, i, uint64(size)) 748 } 749 i-- 750 dAtA[i] = 0x12 751 if m.Option != 0 { 752 i = encodeVarintGov(dAtA, i, uint64(m.Option)) 753 i-- 754 dAtA[i] = 0x8 755 } 756 return len(dAtA) - i, nil 757 } 758 759 func (m *TextProposal) Marshal() (dAtA []byte, err error) { 760 size := m.Size() 761 dAtA = make([]byte, size) 762 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 763 if err != nil { 764 return nil, err 765 } 766 return dAtA[:n], nil 767 } 768 769 func (m *TextProposal) MarshalTo(dAtA []byte) (int, error) { 770 size := m.Size() 771 return m.MarshalToSizedBuffer(dAtA[:size]) 772 } 773 774 func (m *TextProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { 775 i := len(dAtA) 776 _ = i 777 var l int 778 _ = l 779 if len(m.Description) > 0 { 780 i -= len(m.Description) 781 copy(dAtA[i:], m.Description) 782 i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) 783 i-- 784 dAtA[i] = 0x12 785 } 786 if len(m.Title) > 0 { 787 i -= len(m.Title) 788 copy(dAtA[i:], m.Title) 789 i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) 790 i-- 791 dAtA[i] = 0xa 792 } 793 return len(dAtA) - i, nil 794 } 795 796 func (m *Deposit) Marshal() (dAtA []byte, err error) { 797 size := m.Size() 798 dAtA = make([]byte, size) 799 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 800 if err != nil { 801 return nil, err 802 } 803 return dAtA[:n], nil 804 } 805 806 func (m *Deposit) MarshalTo(dAtA []byte) (int, error) { 807 size := m.Size() 808 return m.MarshalToSizedBuffer(dAtA[:size]) 809 } 810 811 func (m *Deposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { 812 i := len(dAtA) 813 _ = i 814 var l int 815 _ = l 816 if len(m.Amount) > 0 { 817 for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { 818 { 819 size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 820 if err != nil { 821 return 0, err 822 } 823 i -= size 824 i = encodeVarintGov(dAtA, i, uint64(size)) 825 } 826 i-- 827 dAtA[i] = 0x1a 828 } 829 } 830 if len(m.Depositor) > 0 { 831 i -= len(m.Depositor) 832 copy(dAtA[i:], m.Depositor) 833 i = encodeVarintGov(dAtA, i, uint64(len(m.Depositor))) 834 i-- 835 dAtA[i] = 0x12 836 } 837 if m.ProposalId != 0 { 838 i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) 839 i-- 840 dAtA[i] = 0x8 841 } 842 return len(dAtA) - i, nil 843 } 844 845 func (m *Proposal) Marshal() (dAtA []byte, err error) { 846 size := m.Size() 847 dAtA = make([]byte, size) 848 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 849 if err != nil { 850 return nil, err 851 } 852 return dAtA[:n], nil 853 } 854 855 func (m *Proposal) MarshalTo(dAtA []byte) (int, error) { 856 size := m.Size() 857 return m.MarshalToSizedBuffer(dAtA[:size]) 858 } 859 860 func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { 861 i := len(dAtA) 862 _ = i 863 var l int 864 _ = l 865 n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.VotingEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingEndTime):]) 866 if err1 != nil { 867 return 0, err1 868 } 869 i -= n1 870 i = encodeVarintGov(dAtA, i, uint64(n1)) 871 i-- 872 dAtA[i] = 0x4a 873 n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.VotingStartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingStartTime):]) 874 if err2 != nil { 875 return 0, err2 876 } 877 i -= n2 878 i = encodeVarintGov(dAtA, i, uint64(n2)) 879 i-- 880 dAtA[i] = 0x42 881 if len(m.TotalDeposit) > 0 { 882 for iNdEx := len(m.TotalDeposit) - 1; iNdEx >= 0; iNdEx-- { 883 { 884 size, err := m.TotalDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 885 if err != nil { 886 return 0, err 887 } 888 i -= size 889 i = encodeVarintGov(dAtA, i, uint64(size)) 890 } 891 i-- 892 dAtA[i] = 0x3a 893 } 894 } 895 n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.DepositEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.DepositEndTime):]) 896 if err3 != nil { 897 return 0, err3 898 } 899 i -= n3 900 i = encodeVarintGov(dAtA, i, uint64(n3)) 901 i-- 902 dAtA[i] = 0x32 903 n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.SubmitTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.SubmitTime):]) 904 if err4 != nil { 905 return 0, err4 906 } 907 i -= n4 908 i = encodeVarintGov(dAtA, i, uint64(n4)) 909 i-- 910 dAtA[i] = 0x2a 911 { 912 size, err := m.FinalTallyResult.MarshalToSizedBuffer(dAtA[:i]) 913 if err != nil { 914 return 0, err 915 } 916 i -= size 917 i = encodeVarintGov(dAtA, i, uint64(size)) 918 } 919 i-- 920 dAtA[i] = 0x22 921 if m.Status != 0 { 922 i = encodeVarintGov(dAtA, i, uint64(m.Status)) 923 i-- 924 dAtA[i] = 0x18 925 } 926 if m.Content != nil { 927 { 928 size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) 929 if err != nil { 930 return 0, err 931 } 932 i -= size 933 i = encodeVarintGov(dAtA, i, uint64(size)) 934 } 935 i-- 936 dAtA[i] = 0x12 937 } 938 if m.ProposalId != 0 { 939 i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) 940 i-- 941 dAtA[i] = 0x8 942 } 943 return len(dAtA) - i, nil 944 } 945 946 func (m *TallyResult) Marshal() (dAtA []byte, err error) { 947 size := m.Size() 948 dAtA = make([]byte, size) 949 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 950 if err != nil { 951 return nil, err 952 } 953 return dAtA[:n], nil 954 } 955 956 func (m *TallyResult) MarshalTo(dAtA []byte) (int, error) { 957 size := m.Size() 958 return m.MarshalToSizedBuffer(dAtA[:size]) 959 } 960 961 func (m *TallyResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { 962 i := len(dAtA) 963 _ = i 964 var l int 965 _ = l 966 { 967 size := m.NoWithVeto.Size() 968 i -= size 969 if _, err := m.NoWithVeto.MarshalTo(dAtA[i:]); err != nil { 970 return 0, err 971 } 972 i = encodeVarintGov(dAtA, i, uint64(size)) 973 } 974 i-- 975 dAtA[i] = 0x22 976 { 977 size := m.No.Size() 978 i -= size 979 if _, err := m.No.MarshalTo(dAtA[i:]); err != nil { 980 return 0, err 981 } 982 i = encodeVarintGov(dAtA, i, uint64(size)) 983 } 984 i-- 985 dAtA[i] = 0x1a 986 { 987 size := m.Abstain.Size() 988 i -= size 989 if _, err := m.Abstain.MarshalTo(dAtA[i:]); err != nil { 990 return 0, err 991 } 992 i = encodeVarintGov(dAtA, i, uint64(size)) 993 } 994 i-- 995 dAtA[i] = 0x12 996 { 997 size := m.Yes.Size() 998 i -= size 999 if _, err := m.Yes.MarshalTo(dAtA[i:]); err != nil { 1000 return 0, err 1001 } 1002 i = encodeVarintGov(dAtA, i, uint64(size)) 1003 } 1004 i-- 1005 dAtA[i] = 0xa 1006 return len(dAtA) - i, nil 1007 } 1008 1009 func (m *Vote) Marshal() (dAtA []byte, err error) { 1010 size := m.Size() 1011 dAtA = make([]byte, size) 1012 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1013 if err != nil { 1014 return nil, err 1015 } 1016 return dAtA[:n], nil 1017 } 1018 1019 func (m *Vote) MarshalTo(dAtA []byte) (int, error) { 1020 size := m.Size() 1021 return m.MarshalToSizedBuffer(dAtA[:size]) 1022 } 1023 1024 func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1025 i := len(dAtA) 1026 _ = i 1027 var l int 1028 _ = l 1029 if len(m.Options) > 0 { 1030 for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { 1031 { 1032 size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 1033 if err != nil { 1034 return 0, err 1035 } 1036 i -= size 1037 i = encodeVarintGov(dAtA, i, uint64(size)) 1038 } 1039 i-- 1040 dAtA[i] = 0x22 1041 } 1042 } 1043 if m.Option != 0 { 1044 i = encodeVarintGov(dAtA, i, uint64(m.Option)) 1045 i-- 1046 dAtA[i] = 0x18 1047 } 1048 if len(m.Voter) > 0 { 1049 i -= len(m.Voter) 1050 copy(dAtA[i:], m.Voter) 1051 i = encodeVarintGov(dAtA, i, uint64(len(m.Voter))) 1052 i-- 1053 dAtA[i] = 0x12 1054 } 1055 if m.ProposalId != 0 { 1056 i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) 1057 i-- 1058 dAtA[i] = 0x8 1059 } 1060 return len(dAtA) - i, nil 1061 } 1062 1063 func (m *DepositParams) Marshal() (dAtA []byte, err error) { 1064 size := m.Size() 1065 dAtA = make([]byte, size) 1066 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1067 if err != nil { 1068 return nil, err 1069 } 1070 return dAtA[:n], nil 1071 } 1072 1073 func (m *DepositParams) MarshalTo(dAtA []byte) (int, error) { 1074 size := m.Size() 1075 return m.MarshalToSizedBuffer(dAtA[:size]) 1076 } 1077 1078 func (m *DepositParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1079 i := len(dAtA) 1080 _ = i 1081 var l int 1082 _ = l 1083 n7, err7 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxDepositPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxDepositPeriod):]) 1084 if err7 != nil { 1085 return 0, err7 1086 } 1087 i -= n7 1088 i = encodeVarintGov(dAtA, i, uint64(n7)) 1089 i-- 1090 dAtA[i] = 0x12 1091 if len(m.MinDeposit) > 0 { 1092 for iNdEx := len(m.MinDeposit) - 1; iNdEx >= 0; iNdEx-- { 1093 { 1094 size, err := m.MinDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 1095 if err != nil { 1096 return 0, err 1097 } 1098 i -= size 1099 i = encodeVarintGov(dAtA, i, uint64(size)) 1100 } 1101 i-- 1102 dAtA[i] = 0xa 1103 } 1104 } 1105 return len(dAtA) - i, nil 1106 } 1107 1108 func (m *VotingParams) Marshal() (dAtA []byte, err error) { 1109 size := m.Size() 1110 dAtA = make([]byte, size) 1111 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1112 if err != nil { 1113 return nil, err 1114 } 1115 return dAtA[:n], nil 1116 } 1117 1118 func (m *VotingParams) MarshalTo(dAtA []byte) (int, error) { 1119 size := m.Size() 1120 return m.MarshalToSizedBuffer(dAtA[:size]) 1121 } 1122 1123 func (m *VotingParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1124 i := len(dAtA) 1125 _ = i 1126 var l int 1127 _ = l 1128 n8, err8 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.VotingPeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.VotingPeriod):]) 1129 if err8 != nil { 1130 return 0, err8 1131 } 1132 i -= n8 1133 i = encodeVarintGov(dAtA, i, uint64(n8)) 1134 i-- 1135 dAtA[i] = 0xa 1136 return len(dAtA) - i, nil 1137 } 1138 1139 func (m *TallyParams) Marshal() (dAtA []byte, err error) { 1140 size := m.Size() 1141 dAtA = make([]byte, size) 1142 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1143 if err != nil { 1144 return nil, err 1145 } 1146 return dAtA[:n], nil 1147 } 1148 1149 func (m *TallyParams) MarshalTo(dAtA []byte) (int, error) { 1150 size := m.Size() 1151 return m.MarshalToSizedBuffer(dAtA[:size]) 1152 } 1153 1154 func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1155 i := len(dAtA) 1156 _ = i 1157 var l int 1158 _ = l 1159 { 1160 size := m.VetoThreshold.Size() 1161 i -= size 1162 if _, err := m.VetoThreshold.MarshalTo(dAtA[i:]); err != nil { 1163 return 0, err 1164 } 1165 i = encodeVarintGov(dAtA, i, uint64(size)) 1166 } 1167 i-- 1168 dAtA[i] = 0x1a 1169 { 1170 size := m.Threshold.Size() 1171 i -= size 1172 if _, err := m.Threshold.MarshalTo(dAtA[i:]); err != nil { 1173 return 0, err 1174 } 1175 i = encodeVarintGov(dAtA, i, uint64(size)) 1176 } 1177 i-- 1178 dAtA[i] = 0x12 1179 { 1180 size := m.Quorum.Size() 1181 i -= size 1182 if _, err := m.Quorum.MarshalTo(dAtA[i:]); err != nil { 1183 return 0, err 1184 } 1185 i = encodeVarintGov(dAtA, i, uint64(size)) 1186 } 1187 i-- 1188 dAtA[i] = 0xa 1189 return len(dAtA) - i, nil 1190 } 1191 1192 func encodeVarintGov(dAtA []byte, offset int, v uint64) int { 1193 offset -= sovGov(v) 1194 base := offset 1195 for v >= 1<<7 { 1196 dAtA[offset] = uint8(v&0x7f | 0x80) 1197 v >>= 7 1198 offset++ 1199 } 1200 dAtA[offset] = uint8(v) 1201 return base 1202 } 1203 func (m *WeightedVoteOption) Size() (n int) { 1204 if m == nil { 1205 return 0 1206 } 1207 var l int 1208 _ = l 1209 if m.Option != 0 { 1210 n += 1 + sovGov(uint64(m.Option)) 1211 } 1212 l = m.Weight.Size() 1213 n += 1 + l + sovGov(uint64(l)) 1214 return n 1215 } 1216 1217 func (m *TextProposal) Size() (n int) { 1218 if m == nil { 1219 return 0 1220 } 1221 var l int 1222 _ = l 1223 l = len(m.Title) 1224 if l > 0 { 1225 n += 1 + l + sovGov(uint64(l)) 1226 } 1227 l = len(m.Description) 1228 if l > 0 { 1229 n += 1 + l + sovGov(uint64(l)) 1230 } 1231 return n 1232 } 1233 1234 func (m *Deposit) Size() (n int) { 1235 if m == nil { 1236 return 0 1237 } 1238 var l int 1239 _ = l 1240 if m.ProposalId != 0 { 1241 n += 1 + sovGov(uint64(m.ProposalId)) 1242 } 1243 l = len(m.Depositor) 1244 if l > 0 { 1245 n += 1 + l + sovGov(uint64(l)) 1246 } 1247 if len(m.Amount) > 0 { 1248 for _, e := range m.Amount { 1249 l = e.Size() 1250 n += 1 + l + sovGov(uint64(l)) 1251 } 1252 } 1253 return n 1254 } 1255 1256 func (m *Proposal) Size() (n int) { 1257 if m == nil { 1258 return 0 1259 } 1260 var l int 1261 _ = l 1262 if m.ProposalId != 0 { 1263 n += 1 + sovGov(uint64(m.ProposalId)) 1264 } 1265 if m.Content != nil { 1266 l = m.Content.Size() 1267 n += 1 + l + sovGov(uint64(l)) 1268 } 1269 if m.Status != 0 { 1270 n += 1 + sovGov(uint64(m.Status)) 1271 } 1272 l = m.FinalTallyResult.Size() 1273 n += 1 + l + sovGov(uint64(l)) 1274 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.SubmitTime) 1275 n += 1 + l + sovGov(uint64(l)) 1276 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.DepositEndTime) 1277 n += 1 + l + sovGov(uint64(l)) 1278 if len(m.TotalDeposit) > 0 { 1279 for _, e := range m.TotalDeposit { 1280 l = e.Size() 1281 n += 1 + l + sovGov(uint64(l)) 1282 } 1283 } 1284 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingStartTime) 1285 n += 1 + l + sovGov(uint64(l)) 1286 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.VotingEndTime) 1287 n += 1 + l + sovGov(uint64(l)) 1288 return n 1289 } 1290 1291 func (m *TallyResult) Size() (n int) { 1292 if m == nil { 1293 return 0 1294 } 1295 var l int 1296 _ = l 1297 l = m.Yes.Size() 1298 n += 1 + l + sovGov(uint64(l)) 1299 l = m.Abstain.Size() 1300 n += 1 + l + sovGov(uint64(l)) 1301 l = m.No.Size() 1302 n += 1 + l + sovGov(uint64(l)) 1303 l = m.NoWithVeto.Size() 1304 n += 1 + l + sovGov(uint64(l)) 1305 return n 1306 } 1307 1308 func (m *Vote) Size() (n int) { 1309 if m == nil { 1310 return 0 1311 } 1312 var l int 1313 _ = l 1314 if m.ProposalId != 0 { 1315 n += 1 + sovGov(uint64(m.ProposalId)) 1316 } 1317 l = len(m.Voter) 1318 if l > 0 { 1319 n += 1 + l + sovGov(uint64(l)) 1320 } 1321 if m.Option != 0 { 1322 n += 1 + sovGov(uint64(m.Option)) 1323 } 1324 if len(m.Options) > 0 { 1325 for _, e := range m.Options { 1326 l = e.Size() 1327 n += 1 + l + sovGov(uint64(l)) 1328 } 1329 } 1330 return n 1331 } 1332 1333 func (m *DepositParams) Size() (n int) { 1334 if m == nil { 1335 return 0 1336 } 1337 var l int 1338 _ = l 1339 if len(m.MinDeposit) > 0 { 1340 for _, e := range m.MinDeposit { 1341 l = e.Size() 1342 n += 1 + l + sovGov(uint64(l)) 1343 } 1344 } 1345 l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxDepositPeriod) 1346 n += 1 + l + sovGov(uint64(l)) 1347 return n 1348 } 1349 1350 func (m *VotingParams) Size() (n int) { 1351 if m == nil { 1352 return 0 1353 } 1354 var l int 1355 _ = l 1356 l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.VotingPeriod) 1357 n += 1 + l + sovGov(uint64(l)) 1358 return n 1359 } 1360 1361 func (m *TallyParams) Size() (n int) { 1362 if m == nil { 1363 return 0 1364 } 1365 var l int 1366 _ = l 1367 l = m.Quorum.Size() 1368 n += 1 + l + sovGov(uint64(l)) 1369 l = m.Threshold.Size() 1370 n += 1 + l + sovGov(uint64(l)) 1371 l = m.VetoThreshold.Size() 1372 n += 1 + l + sovGov(uint64(l)) 1373 return n 1374 } 1375 1376 func sovGov(x uint64) (n int) { 1377 return (math_bits.Len64(x|1) + 6) / 7 1378 } 1379 func sozGov(x uint64) (n int) { 1380 return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 1381 } 1382 func (m *WeightedVoteOption) Unmarshal(dAtA []byte) error { 1383 l := len(dAtA) 1384 iNdEx := 0 1385 for iNdEx < l { 1386 preIndex := iNdEx 1387 var wire uint64 1388 for shift := uint(0); ; shift += 7 { 1389 if shift >= 64 { 1390 return ErrIntOverflowGov 1391 } 1392 if iNdEx >= l { 1393 return io.ErrUnexpectedEOF 1394 } 1395 b := dAtA[iNdEx] 1396 iNdEx++ 1397 wire |= uint64(b&0x7F) << shift 1398 if b < 0x80 { 1399 break 1400 } 1401 } 1402 fieldNum := int32(wire >> 3) 1403 wireType := int(wire & 0x7) 1404 if wireType == 4 { 1405 return fmt.Errorf("proto: WeightedVoteOption: wiretype end group for non-group") 1406 } 1407 if fieldNum <= 0 { 1408 return fmt.Errorf("proto: WeightedVoteOption: illegal tag %d (wire type %d)", fieldNum, wire) 1409 } 1410 switch fieldNum { 1411 case 1: 1412 if wireType != 0 { 1413 return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) 1414 } 1415 m.Option = 0 1416 for shift := uint(0); ; shift += 7 { 1417 if shift >= 64 { 1418 return ErrIntOverflowGov 1419 } 1420 if iNdEx >= l { 1421 return io.ErrUnexpectedEOF 1422 } 1423 b := dAtA[iNdEx] 1424 iNdEx++ 1425 m.Option |= VoteOption(b&0x7F) << shift 1426 if b < 0x80 { 1427 break 1428 } 1429 } 1430 case 2: 1431 if wireType != 2 { 1432 return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) 1433 } 1434 var stringLen uint64 1435 for shift := uint(0); ; shift += 7 { 1436 if shift >= 64 { 1437 return ErrIntOverflowGov 1438 } 1439 if iNdEx >= l { 1440 return io.ErrUnexpectedEOF 1441 } 1442 b := dAtA[iNdEx] 1443 iNdEx++ 1444 stringLen |= uint64(b&0x7F) << shift 1445 if b < 0x80 { 1446 break 1447 } 1448 } 1449 intStringLen := int(stringLen) 1450 if intStringLen < 0 { 1451 return ErrInvalidLengthGov 1452 } 1453 postIndex := iNdEx + intStringLen 1454 if postIndex < 0 { 1455 return ErrInvalidLengthGov 1456 } 1457 if postIndex > l { 1458 return io.ErrUnexpectedEOF 1459 } 1460 if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1461 return err 1462 } 1463 iNdEx = postIndex 1464 default: 1465 iNdEx = preIndex 1466 skippy, err := skipGov(dAtA[iNdEx:]) 1467 if err != nil { 1468 return err 1469 } 1470 if (skippy < 0) || (iNdEx+skippy) < 0 { 1471 return ErrInvalidLengthGov 1472 } 1473 if (iNdEx + skippy) > l { 1474 return io.ErrUnexpectedEOF 1475 } 1476 iNdEx += skippy 1477 } 1478 } 1479 1480 if iNdEx > l { 1481 return io.ErrUnexpectedEOF 1482 } 1483 return nil 1484 } 1485 func (m *TextProposal) Unmarshal(dAtA []byte) error { 1486 l := len(dAtA) 1487 iNdEx := 0 1488 for iNdEx < l { 1489 preIndex := iNdEx 1490 var wire uint64 1491 for shift := uint(0); ; shift += 7 { 1492 if shift >= 64 { 1493 return ErrIntOverflowGov 1494 } 1495 if iNdEx >= l { 1496 return io.ErrUnexpectedEOF 1497 } 1498 b := dAtA[iNdEx] 1499 iNdEx++ 1500 wire |= uint64(b&0x7F) << shift 1501 if b < 0x80 { 1502 break 1503 } 1504 } 1505 fieldNum := int32(wire >> 3) 1506 wireType := int(wire & 0x7) 1507 if wireType == 4 { 1508 return fmt.Errorf("proto: TextProposal: wiretype end group for non-group") 1509 } 1510 if fieldNum <= 0 { 1511 return fmt.Errorf("proto: TextProposal: illegal tag %d (wire type %d)", fieldNum, wire) 1512 } 1513 switch fieldNum { 1514 case 1: 1515 if wireType != 2 { 1516 return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) 1517 } 1518 var stringLen uint64 1519 for shift := uint(0); ; shift += 7 { 1520 if shift >= 64 { 1521 return ErrIntOverflowGov 1522 } 1523 if iNdEx >= l { 1524 return io.ErrUnexpectedEOF 1525 } 1526 b := dAtA[iNdEx] 1527 iNdEx++ 1528 stringLen |= uint64(b&0x7F) << shift 1529 if b < 0x80 { 1530 break 1531 } 1532 } 1533 intStringLen := int(stringLen) 1534 if intStringLen < 0 { 1535 return ErrInvalidLengthGov 1536 } 1537 postIndex := iNdEx + intStringLen 1538 if postIndex < 0 { 1539 return ErrInvalidLengthGov 1540 } 1541 if postIndex > l { 1542 return io.ErrUnexpectedEOF 1543 } 1544 m.Title = string(dAtA[iNdEx:postIndex]) 1545 iNdEx = postIndex 1546 case 2: 1547 if wireType != 2 { 1548 return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) 1549 } 1550 var stringLen uint64 1551 for shift := uint(0); ; shift += 7 { 1552 if shift >= 64 { 1553 return ErrIntOverflowGov 1554 } 1555 if iNdEx >= l { 1556 return io.ErrUnexpectedEOF 1557 } 1558 b := dAtA[iNdEx] 1559 iNdEx++ 1560 stringLen |= uint64(b&0x7F) << shift 1561 if b < 0x80 { 1562 break 1563 } 1564 } 1565 intStringLen := int(stringLen) 1566 if intStringLen < 0 { 1567 return ErrInvalidLengthGov 1568 } 1569 postIndex := iNdEx + intStringLen 1570 if postIndex < 0 { 1571 return ErrInvalidLengthGov 1572 } 1573 if postIndex > l { 1574 return io.ErrUnexpectedEOF 1575 } 1576 m.Description = string(dAtA[iNdEx:postIndex]) 1577 iNdEx = postIndex 1578 default: 1579 iNdEx = preIndex 1580 skippy, err := skipGov(dAtA[iNdEx:]) 1581 if err != nil { 1582 return err 1583 } 1584 if (skippy < 0) || (iNdEx+skippy) < 0 { 1585 return ErrInvalidLengthGov 1586 } 1587 if (iNdEx + skippy) > l { 1588 return io.ErrUnexpectedEOF 1589 } 1590 iNdEx += skippy 1591 } 1592 } 1593 1594 if iNdEx > l { 1595 return io.ErrUnexpectedEOF 1596 } 1597 return nil 1598 } 1599 func (m *Deposit) Unmarshal(dAtA []byte) error { 1600 l := len(dAtA) 1601 iNdEx := 0 1602 for iNdEx < l { 1603 preIndex := iNdEx 1604 var wire uint64 1605 for shift := uint(0); ; shift += 7 { 1606 if shift >= 64 { 1607 return ErrIntOverflowGov 1608 } 1609 if iNdEx >= l { 1610 return io.ErrUnexpectedEOF 1611 } 1612 b := dAtA[iNdEx] 1613 iNdEx++ 1614 wire |= uint64(b&0x7F) << shift 1615 if b < 0x80 { 1616 break 1617 } 1618 } 1619 fieldNum := int32(wire >> 3) 1620 wireType := int(wire & 0x7) 1621 if wireType == 4 { 1622 return fmt.Errorf("proto: Deposit: wiretype end group for non-group") 1623 } 1624 if fieldNum <= 0 { 1625 return fmt.Errorf("proto: Deposit: illegal tag %d (wire type %d)", fieldNum, wire) 1626 } 1627 switch fieldNum { 1628 case 1: 1629 if wireType != 0 { 1630 return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) 1631 } 1632 m.ProposalId = 0 1633 for shift := uint(0); ; shift += 7 { 1634 if shift >= 64 { 1635 return ErrIntOverflowGov 1636 } 1637 if iNdEx >= l { 1638 return io.ErrUnexpectedEOF 1639 } 1640 b := dAtA[iNdEx] 1641 iNdEx++ 1642 m.ProposalId |= uint64(b&0x7F) << shift 1643 if b < 0x80 { 1644 break 1645 } 1646 } 1647 case 2: 1648 if wireType != 2 { 1649 return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) 1650 } 1651 var stringLen uint64 1652 for shift := uint(0); ; shift += 7 { 1653 if shift >= 64 { 1654 return ErrIntOverflowGov 1655 } 1656 if iNdEx >= l { 1657 return io.ErrUnexpectedEOF 1658 } 1659 b := dAtA[iNdEx] 1660 iNdEx++ 1661 stringLen |= uint64(b&0x7F) << shift 1662 if b < 0x80 { 1663 break 1664 } 1665 } 1666 intStringLen := int(stringLen) 1667 if intStringLen < 0 { 1668 return ErrInvalidLengthGov 1669 } 1670 postIndex := iNdEx + intStringLen 1671 if postIndex < 0 { 1672 return ErrInvalidLengthGov 1673 } 1674 if postIndex > l { 1675 return io.ErrUnexpectedEOF 1676 } 1677 m.Depositor = string(dAtA[iNdEx:postIndex]) 1678 iNdEx = postIndex 1679 case 3: 1680 if wireType != 2 { 1681 return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) 1682 } 1683 var msglen int 1684 for shift := uint(0); ; shift += 7 { 1685 if shift >= 64 { 1686 return ErrIntOverflowGov 1687 } 1688 if iNdEx >= l { 1689 return io.ErrUnexpectedEOF 1690 } 1691 b := dAtA[iNdEx] 1692 iNdEx++ 1693 msglen |= int(b&0x7F) << shift 1694 if b < 0x80 { 1695 break 1696 } 1697 } 1698 if msglen < 0 { 1699 return ErrInvalidLengthGov 1700 } 1701 postIndex := iNdEx + msglen 1702 if postIndex < 0 { 1703 return ErrInvalidLengthGov 1704 } 1705 if postIndex > l { 1706 return io.ErrUnexpectedEOF 1707 } 1708 m.Amount = append(m.Amount, types.Coin{}) 1709 if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1710 return err 1711 } 1712 iNdEx = postIndex 1713 default: 1714 iNdEx = preIndex 1715 skippy, err := skipGov(dAtA[iNdEx:]) 1716 if err != nil { 1717 return err 1718 } 1719 if (skippy < 0) || (iNdEx+skippy) < 0 { 1720 return ErrInvalidLengthGov 1721 } 1722 if (iNdEx + skippy) > l { 1723 return io.ErrUnexpectedEOF 1724 } 1725 iNdEx += skippy 1726 } 1727 } 1728 1729 if iNdEx > l { 1730 return io.ErrUnexpectedEOF 1731 } 1732 return nil 1733 } 1734 func (m *Proposal) Unmarshal(dAtA []byte) error { 1735 l := len(dAtA) 1736 iNdEx := 0 1737 for iNdEx < l { 1738 preIndex := iNdEx 1739 var wire uint64 1740 for shift := uint(0); ; shift += 7 { 1741 if shift >= 64 { 1742 return ErrIntOverflowGov 1743 } 1744 if iNdEx >= l { 1745 return io.ErrUnexpectedEOF 1746 } 1747 b := dAtA[iNdEx] 1748 iNdEx++ 1749 wire |= uint64(b&0x7F) << shift 1750 if b < 0x80 { 1751 break 1752 } 1753 } 1754 fieldNum := int32(wire >> 3) 1755 wireType := int(wire & 0x7) 1756 if wireType == 4 { 1757 return fmt.Errorf("proto: Proposal: wiretype end group for non-group") 1758 } 1759 if fieldNum <= 0 { 1760 return fmt.Errorf("proto: Proposal: illegal tag %d (wire type %d)", fieldNum, wire) 1761 } 1762 switch fieldNum { 1763 case 1: 1764 if wireType != 0 { 1765 return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) 1766 } 1767 m.ProposalId = 0 1768 for shift := uint(0); ; shift += 7 { 1769 if shift >= 64 { 1770 return ErrIntOverflowGov 1771 } 1772 if iNdEx >= l { 1773 return io.ErrUnexpectedEOF 1774 } 1775 b := dAtA[iNdEx] 1776 iNdEx++ 1777 m.ProposalId |= uint64(b&0x7F) << shift 1778 if b < 0x80 { 1779 break 1780 } 1781 } 1782 case 2: 1783 if wireType != 2 { 1784 return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) 1785 } 1786 var msglen int 1787 for shift := uint(0); ; shift += 7 { 1788 if shift >= 64 { 1789 return ErrIntOverflowGov 1790 } 1791 if iNdEx >= l { 1792 return io.ErrUnexpectedEOF 1793 } 1794 b := dAtA[iNdEx] 1795 iNdEx++ 1796 msglen |= int(b&0x7F) << shift 1797 if b < 0x80 { 1798 break 1799 } 1800 } 1801 if msglen < 0 { 1802 return ErrInvalidLengthGov 1803 } 1804 postIndex := iNdEx + msglen 1805 if postIndex < 0 { 1806 return ErrInvalidLengthGov 1807 } 1808 if postIndex > l { 1809 return io.ErrUnexpectedEOF 1810 } 1811 if m.Content == nil { 1812 m.Content = &types1.Any{} 1813 } 1814 if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1815 return err 1816 } 1817 iNdEx = postIndex 1818 case 3: 1819 if wireType != 0 { 1820 return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) 1821 } 1822 m.Status = 0 1823 for shift := uint(0); ; shift += 7 { 1824 if shift >= 64 { 1825 return ErrIntOverflowGov 1826 } 1827 if iNdEx >= l { 1828 return io.ErrUnexpectedEOF 1829 } 1830 b := dAtA[iNdEx] 1831 iNdEx++ 1832 m.Status |= ProposalStatus(b&0x7F) << shift 1833 if b < 0x80 { 1834 break 1835 } 1836 } 1837 case 4: 1838 if wireType != 2 { 1839 return fmt.Errorf("proto: wrong wireType = %d for field FinalTallyResult", wireType) 1840 } 1841 var msglen int 1842 for shift := uint(0); ; shift += 7 { 1843 if shift >= 64 { 1844 return ErrIntOverflowGov 1845 } 1846 if iNdEx >= l { 1847 return io.ErrUnexpectedEOF 1848 } 1849 b := dAtA[iNdEx] 1850 iNdEx++ 1851 msglen |= int(b&0x7F) << shift 1852 if b < 0x80 { 1853 break 1854 } 1855 } 1856 if msglen < 0 { 1857 return ErrInvalidLengthGov 1858 } 1859 postIndex := iNdEx + msglen 1860 if postIndex < 0 { 1861 return ErrInvalidLengthGov 1862 } 1863 if postIndex > l { 1864 return io.ErrUnexpectedEOF 1865 } 1866 if err := m.FinalTallyResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1867 return err 1868 } 1869 iNdEx = postIndex 1870 case 5: 1871 if wireType != 2 { 1872 return fmt.Errorf("proto: wrong wireType = %d for field SubmitTime", wireType) 1873 } 1874 var msglen int 1875 for shift := uint(0); ; shift += 7 { 1876 if shift >= 64 { 1877 return ErrIntOverflowGov 1878 } 1879 if iNdEx >= l { 1880 return io.ErrUnexpectedEOF 1881 } 1882 b := dAtA[iNdEx] 1883 iNdEx++ 1884 msglen |= int(b&0x7F) << shift 1885 if b < 0x80 { 1886 break 1887 } 1888 } 1889 if msglen < 0 { 1890 return ErrInvalidLengthGov 1891 } 1892 postIndex := iNdEx + msglen 1893 if postIndex < 0 { 1894 return ErrInvalidLengthGov 1895 } 1896 if postIndex > l { 1897 return io.ErrUnexpectedEOF 1898 } 1899 if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.SubmitTime, dAtA[iNdEx:postIndex]); err != nil { 1900 return err 1901 } 1902 iNdEx = postIndex 1903 case 6: 1904 if wireType != 2 { 1905 return fmt.Errorf("proto: wrong wireType = %d for field DepositEndTime", wireType) 1906 } 1907 var msglen int 1908 for shift := uint(0); ; shift += 7 { 1909 if shift >= 64 { 1910 return ErrIntOverflowGov 1911 } 1912 if iNdEx >= l { 1913 return io.ErrUnexpectedEOF 1914 } 1915 b := dAtA[iNdEx] 1916 iNdEx++ 1917 msglen |= int(b&0x7F) << shift 1918 if b < 0x80 { 1919 break 1920 } 1921 } 1922 if msglen < 0 { 1923 return ErrInvalidLengthGov 1924 } 1925 postIndex := iNdEx + msglen 1926 if postIndex < 0 { 1927 return ErrInvalidLengthGov 1928 } 1929 if postIndex > l { 1930 return io.ErrUnexpectedEOF 1931 } 1932 if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.DepositEndTime, dAtA[iNdEx:postIndex]); err != nil { 1933 return err 1934 } 1935 iNdEx = postIndex 1936 case 7: 1937 if wireType != 2 { 1938 return fmt.Errorf("proto: wrong wireType = %d for field TotalDeposit", wireType) 1939 } 1940 var msglen int 1941 for shift := uint(0); ; shift += 7 { 1942 if shift >= 64 { 1943 return ErrIntOverflowGov 1944 } 1945 if iNdEx >= l { 1946 return io.ErrUnexpectedEOF 1947 } 1948 b := dAtA[iNdEx] 1949 iNdEx++ 1950 msglen |= int(b&0x7F) << shift 1951 if b < 0x80 { 1952 break 1953 } 1954 } 1955 if msglen < 0 { 1956 return ErrInvalidLengthGov 1957 } 1958 postIndex := iNdEx + msglen 1959 if postIndex < 0 { 1960 return ErrInvalidLengthGov 1961 } 1962 if postIndex > l { 1963 return io.ErrUnexpectedEOF 1964 } 1965 m.TotalDeposit = append(m.TotalDeposit, types.Coin{}) 1966 if err := m.TotalDeposit[len(m.TotalDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1967 return err 1968 } 1969 iNdEx = postIndex 1970 case 8: 1971 if wireType != 2 { 1972 return fmt.Errorf("proto: wrong wireType = %d for field VotingStartTime", wireType) 1973 } 1974 var msglen int 1975 for shift := uint(0); ; shift += 7 { 1976 if shift >= 64 { 1977 return ErrIntOverflowGov 1978 } 1979 if iNdEx >= l { 1980 return io.ErrUnexpectedEOF 1981 } 1982 b := dAtA[iNdEx] 1983 iNdEx++ 1984 msglen |= int(b&0x7F) << shift 1985 if b < 0x80 { 1986 break 1987 } 1988 } 1989 if msglen < 0 { 1990 return ErrInvalidLengthGov 1991 } 1992 postIndex := iNdEx + msglen 1993 if postIndex < 0 { 1994 return ErrInvalidLengthGov 1995 } 1996 if postIndex > l { 1997 return io.ErrUnexpectedEOF 1998 } 1999 if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.VotingStartTime, dAtA[iNdEx:postIndex]); err != nil { 2000 return err 2001 } 2002 iNdEx = postIndex 2003 case 9: 2004 if wireType != 2 { 2005 return fmt.Errorf("proto: wrong wireType = %d for field VotingEndTime", wireType) 2006 } 2007 var msglen int 2008 for shift := uint(0); ; shift += 7 { 2009 if shift >= 64 { 2010 return ErrIntOverflowGov 2011 } 2012 if iNdEx >= l { 2013 return io.ErrUnexpectedEOF 2014 } 2015 b := dAtA[iNdEx] 2016 iNdEx++ 2017 msglen |= int(b&0x7F) << shift 2018 if b < 0x80 { 2019 break 2020 } 2021 } 2022 if msglen < 0 { 2023 return ErrInvalidLengthGov 2024 } 2025 postIndex := iNdEx + msglen 2026 if postIndex < 0 { 2027 return ErrInvalidLengthGov 2028 } 2029 if postIndex > l { 2030 return io.ErrUnexpectedEOF 2031 } 2032 if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.VotingEndTime, dAtA[iNdEx:postIndex]); err != nil { 2033 return err 2034 } 2035 iNdEx = postIndex 2036 default: 2037 iNdEx = preIndex 2038 skippy, err := skipGov(dAtA[iNdEx:]) 2039 if err != nil { 2040 return err 2041 } 2042 if (skippy < 0) || (iNdEx+skippy) < 0 { 2043 return ErrInvalidLengthGov 2044 } 2045 if (iNdEx + skippy) > l { 2046 return io.ErrUnexpectedEOF 2047 } 2048 iNdEx += skippy 2049 } 2050 } 2051 2052 if iNdEx > l { 2053 return io.ErrUnexpectedEOF 2054 } 2055 return nil 2056 } 2057 func (m *TallyResult) Unmarshal(dAtA []byte) error { 2058 l := len(dAtA) 2059 iNdEx := 0 2060 for iNdEx < l { 2061 preIndex := iNdEx 2062 var wire uint64 2063 for shift := uint(0); ; shift += 7 { 2064 if shift >= 64 { 2065 return ErrIntOverflowGov 2066 } 2067 if iNdEx >= l { 2068 return io.ErrUnexpectedEOF 2069 } 2070 b := dAtA[iNdEx] 2071 iNdEx++ 2072 wire |= uint64(b&0x7F) << shift 2073 if b < 0x80 { 2074 break 2075 } 2076 } 2077 fieldNum := int32(wire >> 3) 2078 wireType := int(wire & 0x7) 2079 if wireType == 4 { 2080 return fmt.Errorf("proto: TallyResult: wiretype end group for non-group") 2081 } 2082 if fieldNum <= 0 { 2083 return fmt.Errorf("proto: TallyResult: illegal tag %d (wire type %d)", fieldNum, wire) 2084 } 2085 switch fieldNum { 2086 case 1: 2087 if wireType != 2 { 2088 return fmt.Errorf("proto: wrong wireType = %d for field Yes", wireType) 2089 } 2090 var stringLen uint64 2091 for shift := uint(0); ; shift += 7 { 2092 if shift >= 64 { 2093 return ErrIntOverflowGov 2094 } 2095 if iNdEx >= l { 2096 return io.ErrUnexpectedEOF 2097 } 2098 b := dAtA[iNdEx] 2099 iNdEx++ 2100 stringLen |= uint64(b&0x7F) << shift 2101 if b < 0x80 { 2102 break 2103 } 2104 } 2105 intStringLen := int(stringLen) 2106 if intStringLen < 0 { 2107 return ErrInvalidLengthGov 2108 } 2109 postIndex := iNdEx + intStringLen 2110 if postIndex < 0 { 2111 return ErrInvalidLengthGov 2112 } 2113 if postIndex > l { 2114 return io.ErrUnexpectedEOF 2115 } 2116 if err := m.Yes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2117 return err 2118 } 2119 iNdEx = postIndex 2120 case 2: 2121 if wireType != 2 { 2122 return fmt.Errorf("proto: wrong wireType = %d for field Abstain", wireType) 2123 } 2124 var stringLen uint64 2125 for shift := uint(0); ; shift += 7 { 2126 if shift >= 64 { 2127 return ErrIntOverflowGov 2128 } 2129 if iNdEx >= l { 2130 return io.ErrUnexpectedEOF 2131 } 2132 b := dAtA[iNdEx] 2133 iNdEx++ 2134 stringLen |= uint64(b&0x7F) << shift 2135 if b < 0x80 { 2136 break 2137 } 2138 } 2139 intStringLen := int(stringLen) 2140 if intStringLen < 0 { 2141 return ErrInvalidLengthGov 2142 } 2143 postIndex := iNdEx + intStringLen 2144 if postIndex < 0 { 2145 return ErrInvalidLengthGov 2146 } 2147 if postIndex > l { 2148 return io.ErrUnexpectedEOF 2149 } 2150 if err := m.Abstain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2151 return err 2152 } 2153 iNdEx = postIndex 2154 case 3: 2155 if wireType != 2 { 2156 return fmt.Errorf("proto: wrong wireType = %d for field No", wireType) 2157 } 2158 var stringLen uint64 2159 for shift := uint(0); ; shift += 7 { 2160 if shift >= 64 { 2161 return ErrIntOverflowGov 2162 } 2163 if iNdEx >= l { 2164 return io.ErrUnexpectedEOF 2165 } 2166 b := dAtA[iNdEx] 2167 iNdEx++ 2168 stringLen |= uint64(b&0x7F) << shift 2169 if b < 0x80 { 2170 break 2171 } 2172 } 2173 intStringLen := int(stringLen) 2174 if intStringLen < 0 { 2175 return ErrInvalidLengthGov 2176 } 2177 postIndex := iNdEx + intStringLen 2178 if postIndex < 0 { 2179 return ErrInvalidLengthGov 2180 } 2181 if postIndex > l { 2182 return io.ErrUnexpectedEOF 2183 } 2184 if err := m.No.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2185 return err 2186 } 2187 iNdEx = postIndex 2188 case 4: 2189 if wireType != 2 { 2190 return fmt.Errorf("proto: wrong wireType = %d for field NoWithVeto", wireType) 2191 } 2192 var stringLen uint64 2193 for shift := uint(0); ; shift += 7 { 2194 if shift >= 64 { 2195 return ErrIntOverflowGov 2196 } 2197 if iNdEx >= l { 2198 return io.ErrUnexpectedEOF 2199 } 2200 b := dAtA[iNdEx] 2201 iNdEx++ 2202 stringLen |= uint64(b&0x7F) << shift 2203 if b < 0x80 { 2204 break 2205 } 2206 } 2207 intStringLen := int(stringLen) 2208 if intStringLen < 0 { 2209 return ErrInvalidLengthGov 2210 } 2211 postIndex := iNdEx + intStringLen 2212 if postIndex < 0 { 2213 return ErrInvalidLengthGov 2214 } 2215 if postIndex > l { 2216 return io.ErrUnexpectedEOF 2217 } 2218 if err := m.NoWithVeto.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2219 return err 2220 } 2221 iNdEx = postIndex 2222 default: 2223 iNdEx = preIndex 2224 skippy, err := skipGov(dAtA[iNdEx:]) 2225 if err != nil { 2226 return err 2227 } 2228 if (skippy < 0) || (iNdEx+skippy) < 0 { 2229 return ErrInvalidLengthGov 2230 } 2231 if (iNdEx + skippy) > l { 2232 return io.ErrUnexpectedEOF 2233 } 2234 iNdEx += skippy 2235 } 2236 } 2237 2238 if iNdEx > l { 2239 return io.ErrUnexpectedEOF 2240 } 2241 return nil 2242 } 2243 func (m *Vote) Unmarshal(dAtA []byte) error { 2244 l := len(dAtA) 2245 iNdEx := 0 2246 for iNdEx < l { 2247 preIndex := iNdEx 2248 var wire uint64 2249 for shift := uint(0); ; shift += 7 { 2250 if shift >= 64 { 2251 return ErrIntOverflowGov 2252 } 2253 if iNdEx >= l { 2254 return io.ErrUnexpectedEOF 2255 } 2256 b := dAtA[iNdEx] 2257 iNdEx++ 2258 wire |= uint64(b&0x7F) << shift 2259 if b < 0x80 { 2260 break 2261 } 2262 } 2263 fieldNum := int32(wire >> 3) 2264 wireType := int(wire & 0x7) 2265 if wireType == 4 { 2266 return fmt.Errorf("proto: Vote: wiretype end group for non-group") 2267 } 2268 if fieldNum <= 0 { 2269 return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire) 2270 } 2271 switch fieldNum { 2272 case 1: 2273 if wireType != 0 { 2274 return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) 2275 } 2276 m.ProposalId = 0 2277 for shift := uint(0); ; shift += 7 { 2278 if shift >= 64 { 2279 return ErrIntOverflowGov 2280 } 2281 if iNdEx >= l { 2282 return io.ErrUnexpectedEOF 2283 } 2284 b := dAtA[iNdEx] 2285 iNdEx++ 2286 m.ProposalId |= uint64(b&0x7F) << shift 2287 if b < 0x80 { 2288 break 2289 } 2290 } 2291 case 2: 2292 if wireType != 2 { 2293 return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) 2294 } 2295 var stringLen uint64 2296 for shift := uint(0); ; shift += 7 { 2297 if shift >= 64 { 2298 return ErrIntOverflowGov 2299 } 2300 if iNdEx >= l { 2301 return io.ErrUnexpectedEOF 2302 } 2303 b := dAtA[iNdEx] 2304 iNdEx++ 2305 stringLen |= uint64(b&0x7F) << shift 2306 if b < 0x80 { 2307 break 2308 } 2309 } 2310 intStringLen := int(stringLen) 2311 if intStringLen < 0 { 2312 return ErrInvalidLengthGov 2313 } 2314 postIndex := iNdEx + intStringLen 2315 if postIndex < 0 { 2316 return ErrInvalidLengthGov 2317 } 2318 if postIndex > l { 2319 return io.ErrUnexpectedEOF 2320 } 2321 m.Voter = string(dAtA[iNdEx:postIndex]) 2322 iNdEx = postIndex 2323 case 3: 2324 if wireType != 0 { 2325 return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) 2326 } 2327 m.Option = 0 2328 for shift := uint(0); ; shift += 7 { 2329 if shift >= 64 { 2330 return ErrIntOverflowGov 2331 } 2332 if iNdEx >= l { 2333 return io.ErrUnexpectedEOF 2334 } 2335 b := dAtA[iNdEx] 2336 iNdEx++ 2337 m.Option |= VoteOption(b&0x7F) << shift 2338 if b < 0x80 { 2339 break 2340 } 2341 } 2342 case 4: 2343 if wireType != 2 { 2344 return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) 2345 } 2346 var msglen int 2347 for shift := uint(0); ; shift += 7 { 2348 if shift >= 64 { 2349 return ErrIntOverflowGov 2350 } 2351 if iNdEx >= l { 2352 return io.ErrUnexpectedEOF 2353 } 2354 b := dAtA[iNdEx] 2355 iNdEx++ 2356 msglen |= int(b&0x7F) << shift 2357 if b < 0x80 { 2358 break 2359 } 2360 } 2361 if msglen < 0 { 2362 return ErrInvalidLengthGov 2363 } 2364 postIndex := iNdEx + msglen 2365 if postIndex < 0 { 2366 return ErrInvalidLengthGov 2367 } 2368 if postIndex > l { 2369 return io.ErrUnexpectedEOF 2370 } 2371 m.Options = append(m.Options, WeightedVoteOption{}) 2372 if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2373 return err 2374 } 2375 iNdEx = postIndex 2376 default: 2377 iNdEx = preIndex 2378 skippy, err := skipGov(dAtA[iNdEx:]) 2379 if err != nil { 2380 return err 2381 } 2382 if (skippy < 0) || (iNdEx+skippy) < 0 { 2383 return ErrInvalidLengthGov 2384 } 2385 if (iNdEx + skippy) > l { 2386 return io.ErrUnexpectedEOF 2387 } 2388 iNdEx += skippy 2389 } 2390 } 2391 2392 if iNdEx > l { 2393 return io.ErrUnexpectedEOF 2394 } 2395 return nil 2396 } 2397 func (m *DepositParams) Unmarshal(dAtA []byte) error { 2398 l := len(dAtA) 2399 iNdEx := 0 2400 for iNdEx < l { 2401 preIndex := iNdEx 2402 var wire uint64 2403 for shift := uint(0); ; shift += 7 { 2404 if shift >= 64 { 2405 return ErrIntOverflowGov 2406 } 2407 if iNdEx >= l { 2408 return io.ErrUnexpectedEOF 2409 } 2410 b := dAtA[iNdEx] 2411 iNdEx++ 2412 wire |= uint64(b&0x7F) << shift 2413 if b < 0x80 { 2414 break 2415 } 2416 } 2417 fieldNum := int32(wire >> 3) 2418 wireType := int(wire & 0x7) 2419 if wireType == 4 { 2420 return fmt.Errorf("proto: DepositParams: wiretype end group for non-group") 2421 } 2422 if fieldNum <= 0 { 2423 return fmt.Errorf("proto: DepositParams: illegal tag %d (wire type %d)", fieldNum, wire) 2424 } 2425 switch fieldNum { 2426 case 1: 2427 if wireType != 2 { 2428 return fmt.Errorf("proto: wrong wireType = %d for field MinDeposit", wireType) 2429 } 2430 var msglen int 2431 for shift := uint(0); ; shift += 7 { 2432 if shift >= 64 { 2433 return ErrIntOverflowGov 2434 } 2435 if iNdEx >= l { 2436 return io.ErrUnexpectedEOF 2437 } 2438 b := dAtA[iNdEx] 2439 iNdEx++ 2440 msglen |= int(b&0x7F) << shift 2441 if b < 0x80 { 2442 break 2443 } 2444 } 2445 if msglen < 0 { 2446 return ErrInvalidLengthGov 2447 } 2448 postIndex := iNdEx + msglen 2449 if postIndex < 0 { 2450 return ErrInvalidLengthGov 2451 } 2452 if postIndex > l { 2453 return io.ErrUnexpectedEOF 2454 } 2455 m.MinDeposit = append(m.MinDeposit, types.Coin{}) 2456 if err := m.MinDeposit[len(m.MinDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2457 return err 2458 } 2459 iNdEx = postIndex 2460 case 2: 2461 if wireType != 2 { 2462 return fmt.Errorf("proto: wrong wireType = %d for field MaxDepositPeriod", wireType) 2463 } 2464 var msglen int 2465 for shift := uint(0); ; shift += 7 { 2466 if shift >= 64 { 2467 return ErrIntOverflowGov 2468 } 2469 if iNdEx >= l { 2470 return io.ErrUnexpectedEOF 2471 } 2472 b := dAtA[iNdEx] 2473 iNdEx++ 2474 msglen |= int(b&0x7F) << shift 2475 if b < 0x80 { 2476 break 2477 } 2478 } 2479 if msglen < 0 { 2480 return ErrInvalidLengthGov 2481 } 2482 postIndex := iNdEx + msglen 2483 if postIndex < 0 { 2484 return ErrInvalidLengthGov 2485 } 2486 if postIndex > l { 2487 return io.ErrUnexpectedEOF 2488 } 2489 if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.MaxDepositPeriod, dAtA[iNdEx:postIndex]); err != nil { 2490 return err 2491 } 2492 iNdEx = postIndex 2493 default: 2494 iNdEx = preIndex 2495 skippy, err := skipGov(dAtA[iNdEx:]) 2496 if err != nil { 2497 return err 2498 } 2499 if (skippy < 0) || (iNdEx+skippy) < 0 { 2500 return ErrInvalidLengthGov 2501 } 2502 if (iNdEx + skippy) > l { 2503 return io.ErrUnexpectedEOF 2504 } 2505 iNdEx += skippy 2506 } 2507 } 2508 2509 if iNdEx > l { 2510 return io.ErrUnexpectedEOF 2511 } 2512 return nil 2513 } 2514 func (m *VotingParams) Unmarshal(dAtA []byte) error { 2515 l := len(dAtA) 2516 iNdEx := 0 2517 for iNdEx < l { 2518 preIndex := iNdEx 2519 var wire uint64 2520 for shift := uint(0); ; shift += 7 { 2521 if shift >= 64 { 2522 return ErrIntOverflowGov 2523 } 2524 if iNdEx >= l { 2525 return io.ErrUnexpectedEOF 2526 } 2527 b := dAtA[iNdEx] 2528 iNdEx++ 2529 wire |= uint64(b&0x7F) << shift 2530 if b < 0x80 { 2531 break 2532 } 2533 } 2534 fieldNum := int32(wire >> 3) 2535 wireType := int(wire & 0x7) 2536 if wireType == 4 { 2537 return fmt.Errorf("proto: VotingParams: wiretype end group for non-group") 2538 } 2539 if fieldNum <= 0 { 2540 return fmt.Errorf("proto: VotingParams: illegal tag %d (wire type %d)", fieldNum, wire) 2541 } 2542 switch fieldNum { 2543 case 1: 2544 if wireType != 2 { 2545 return fmt.Errorf("proto: wrong wireType = %d for field VotingPeriod", wireType) 2546 } 2547 var msglen int 2548 for shift := uint(0); ; shift += 7 { 2549 if shift >= 64 { 2550 return ErrIntOverflowGov 2551 } 2552 if iNdEx >= l { 2553 return io.ErrUnexpectedEOF 2554 } 2555 b := dAtA[iNdEx] 2556 iNdEx++ 2557 msglen |= int(b&0x7F) << shift 2558 if b < 0x80 { 2559 break 2560 } 2561 } 2562 if msglen < 0 { 2563 return ErrInvalidLengthGov 2564 } 2565 postIndex := iNdEx + msglen 2566 if postIndex < 0 { 2567 return ErrInvalidLengthGov 2568 } 2569 if postIndex > l { 2570 return io.ErrUnexpectedEOF 2571 } 2572 if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.VotingPeriod, dAtA[iNdEx:postIndex]); err != nil { 2573 return err 2574 } 2575 iNdEx = postIndex 2576 default: 2577 iNdEx = preIndex 2578 skippy, err := skipGov(dAtA[iNdEx:]) 2579 if err != nil { 2580 return err 2581 } 2582 if (skippy < 0) || (iNdEx+skippy) < 0 { 2583 return ErrInvalidLengthGov 2584 } 2585 if (iNdEx + skippy) > l { 2586 return io.ErrUnexpectedEOF 2587 } 2588 iNdEx += skippy 2589 } 2590 } 2591 2592 if iNdEx > l { 2593 return io.ErrUnexpectedEOF 2594 } 2595 return nil 2596 } 2597 func (m *TallyParams) Unmarshal(dAtA []byte) error { 2598 l := len(dAtA) 2599 iNdEx := 0 2600 for iNdEx < l { 2601 preIndex := iNdEx 2602 var wire uint64 2603 for shift := uint(0); ; shift += 7 { 2604 if shift >= 64 { 2605 return ErrIntOverflowGov 2606 } 2607 if iNdEx >= l { 2608 return io.ErrUnexpectedEOF 2609 } 2610 b := dAtA[iNdEx] 2611 iNdEx++ 2612 wire |= uint64(b&0x7F) << shift 2613 if b < 0x80 { 2614 break 2615 } 2616 } 2617 fieldNum := int32(wire >> 3) 2618 wireType := int(wire & 0x7) 2619 if wireType == 4 { 2620 return fmt.Errorf("proto: TallyParams: wiretype end group for non-group") 2621 } 2622 if fieldNum <= 0 { 2623 return fmt.Errorf("proto: TallyParams: illegal tag %d (wire type %d)", fieldNum, wire) 2624 } 2625 switch fieldNum { 2626 case 1: 2627 if wireType != 2 { 2628 return fmt.Errorf("proto: wrong wireType = %d for field Quorum", wireType) 2629 } 2630 var byteLen int 2631 for shift := uint(0); ; shift += 7 { 2632 if shift >= 64 { 2633 return ErrIntOverflowGov 2634 } 2635 if iNdEx >= l { 2636 return io.ErrUnexpectedEOF 2637 } 2638 b := dAtA[iNdEx] 2639 iNdEx++ 2640 byteLen |= int(b&0x7F) << shift 2641 if b < 0x80 { 2642 break 2643 } 2644 } 2645 if byteLen < 0 { 2646 return ErrInvalidLengthGov 2647 } 2648 postIndex := iNdEx + byteLen 2649 if postIndex < 0 { 2650 return ErrInvalidLengthGov 2651 } 2652 if postIndex > l { 2653 return io.ErrUnexpectedEOF 2654 } 2655 if err := m.Quorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2656 return err 2657 } 2658 iNdEx = postIndex 2659 case 2: 2660 if wireType != 2 { 2661 return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) 2662 } 2663 var byteLen int 2664 for shift := uint(0); ; shift += 7 { 2665 if shift >= 64 { 2666 return ErrIntOverflowGov 2667 } 2668 if iNdEx >= l { 2669 return io.ErrUnexpectedEOF 2670 } 2671 b := dAtA[iNdEx] 2672 iNdEx++ 2673 byteLen |= int(b&0x7F) << shift 2674 if b < 0x80 { 2675 break 2676 } 2677 } 2678 if byteLen < 0 { 2679 return ErrInvalidLengthGov 2680 } 2681 postIndex := iNdEx + byteLen 2682 if postIndex < 0 { 2683 return ErrInvalidLengthGov 2684 } 2685 if postIndex > l { 2686 return io.ErrUnexpectedEOF 2687 } 2688 if err := m.Threshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2689 return err 2690 } 2691 iNdEx = postIndex 2692 case 3: 2693 if wireType != 2 { 2694 return fmt.Errorf("proto: wrong wireType = %d for field VetoThreshold", wireType) 2695 } 2696 var byteLen int 2697 for shift := uint(0); ; shift += 7 { 2698 if shift >= 64 { 2699 return ErrIntOverflowGov 2700 } 2701 if iNdEx >= l { 2702 return io.ErrUnexpectedEOF 2703 } 2704 b := dAtA[iNdEx] 2705 iNdEx++ 2706 byteLen |= int(b&0x7F) << shift 2707 if b < 0x80 { 2708 break 2709 } 2710 } 2711 if byteLen < 0 { 2712 return ErrInvalidLengthGov 2713 } 2714 postIndex := iNdEx + byteLen 2715 if postIndex < 0 { 2716 return ErrInvalidLengthGov 2717 } 2718 if postIndex > l { 2719 return io.ErrUnexpectedEOF 2720 } 2721 if err := m.VetoThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2722 return err 2723 } 2724 iNdEx = postIndex 2725 default: 2726 iNdEx = preIndex 2727 skippy, err := skipGov(dAtA[iNdEx:]) 2728 if err != nil { 2729 return err 2730 } 2731 if (skippy < 0) || (iNdEx+skippy) < 0 { 2732 return ErrInvalidLengthGov 2733 } 2734 if (iNdEx + skippy) > l { 2735 return io.ErrUnexpectedEOF 2736 } 2737 iNdEx += skippy 2738 } 2739 } 2740 2741 if iNdEx > l { 2742 return io.ErrUnexpectedEOF 2743 } 2744 return nil 2745 } 2746 func skipGov(dAtA []byte) (n int, err error) { 2747 l := len(dAtA) 2748 iNdEx := 0 2749 depth := 0 2750 for iNdEx < l { 2751 var wire uint64 2752 for shift := uint(0); ; shift += 7 { 2753 if shift >= 64 { 2754 return 0, ErrIntOverflowGov 2755 } 2756 if iNdEx >= l { 2757 return 0, io.ErrUnexpectedEOF 2758 } 2759 b := dAtA[iNdEx] 2760 iNdEx++ 2761 wire |= (uint64(b) & 0x7F) << shift 2762 if b < 0x80 { 2763 break 2764 } 2765 } 2766 wireType := int(wire & 0x7) 2767 switch wireType { 2768 case 0: 2769 for shift := uint(0); ; shift += 7 { 2770 if shift >= 64 { 2771 return 0, ErrIntOverflowGov 2772 } 2773 if iNdEx >= l { 2774 return 0, io.ErrUnexpectedEOF 2775 } 2776 iNdEx++ 2777 if dAtA[iNdEx-1] < 0x80 { 2778 break 2779 } 2780 } 2781 case 1: 2782 iNdEx += 8 2783 case 2: 2784 var length int 2785 for shift := uint(0); ; shift += 7 { 2786 if shift >= 64 { 2787 return 0, ErrIntOverflowGov 2788 } 2789 if iNdEx >= l { 2790 return 0, io.ErrUnexpectedEOF 2791 } 2792 b := dAtA[iNdEx] 2793 iNdEx++ 2794 length |= (int(b) & 0x7F) << shift 2795 if b < 0x80 { 2796 break 2797 } 2798 } 2799 if length < 0 { 2800 return 0, ErrInvalidLengthGov 2801 } 2802 iNdEx += length 2803 case 3: 2804 depth++ 2805 case 4: 2806 if depth == 0 { 2807 return 0, ErrUnexpectedEndOfGroupGov 2808 } 2809 depth-- 2810 case 5: 2811 iNdEx += 4 2812 default: 2813 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 2814 } 2815 if iNdEx < 0 { 2816 return 0, ErrInvalidLengthGov 2817 } 2818 if depth == 0 { 2819 return iNdEx, nil 2820 } 2821 } 2822 return 0, io.ErrUnexpectedEOF 2823 } 2824 2825 var ( 2826 ErrInvalidLengthGov = fmt.Errorf("proto: negative length found during unmarshaling") 2827 ErrIntOverflowGov = fmt.Errorf("proto: integer overflow") 2828 ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group") 2829 )