github.com/adoriasoft/tendermint@v0.34.0-dev1.0.20200722151356-96d84601a75a/proto/tendermint/types/params.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: tendermint/types/params.proto 3 4 package types 5 6 import ( 7 fmt "fmt" 8 _ "github.com/gogo/protobuf/gogoproto" 9 proto "github.com/gogo/protobuf/proto" 10 github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" 11 _ "github.com/golang/protobuf/ptypes/duration" 12 io "io" 13 math "math" 14 math_bits "math/bits" 15 time "time" 16 ) 17 18 // Reference imports to suppress errors if they are not otherwise used. 19 var _ = proto.Marshal 20 var _ = fmt.Errorf 21 var _ = math.Inf 22 var _ = time.Kitchen 23 24 // This is a compile-time assertion to ensure that this generated file 25 // is compatible with the proto package it is being compiled against. 26 // A compilation error at this line likely means your copy of the 27 // proto package needs to be updated. 28 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 29 30 // ConsensusParams contains consensus critical parameters that determine the 31 // validity of blocks. 32 type ConsensusParams struct { 33 Block BlockParams `protobuf:"bytes,1,opt,name=block,proto3" json:"block"` 34 Evidence EvidenceParams `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence"` 35 Validator ValidatorParams `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator"` 36 Version VersionParams `protobuf:"bytes,4,opt,name=version,proto3" json:"version"` 37 } 38 39 func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } 40 func (m *ConsensusParams) String() string { return proto.CompactTextString(m) } 41 func (*ConsensusParams) ProtoMessage() {} 42 func (*ConsensusParams) Descriptor() ([]byte, []int) { 43 return fileDescriptor_e12598271a686f57, []int{0} 44 } 45 func (m *ConsensusParams) XXX_Unmarshal(b []byte) error { 46 return m.Unmarshal(b) 47 } 48 func (m *ConsensusParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 49 if deterministic { 50 return xxx_messageInfo_ConsensusParams.Marshal(b, m, deterministic) 51 } else { 52 b = b[:cap(b)] 53 n, err := m.MarshalToSizedBuffer(b) 54 if err != nil { 55 return nil, err 56 } 57 return b[:n], nil 58 } 59 } 60 func (m *ConsensusParams) XXX_Merge(src proto.Message) { 61 xxx_messageInfo_ConsensusParams.Merge(m, src) 62 } 63 func (m *ConsensusParams) XXX_Size() int { 64 return m.Size() 65 } 66 func (m *ConsensusParams) XXX_DiscardUnknown() { 67 xxx_messageInfo_ConsensusParams.DiscardUnknown(m) 68 } 69 70 var xxx_messageInfo_ConsensusParams proto.InternalMessageInfo 71 72 func (m *ConsensusParams) GetBlock() BlockParams { 73 if m != nil { 74 return m.Block 75 } 76 return BlockParams{} 77 } 78 79 func (m *ConsensusParams) GetEvidence() EvidenceParams { 80 if m != nil { 81 return m.Evidence 82 } 83 return EvidenceParams{} 84 } 85 86 func (m *ConsensusParams) GetValidator() ValidatorParams { 87 if m != nil { 88 return m.Validator 89 } 90 return ValidatorParams{} 91 } 92 93 func (m *ConsensusParams) GetVersion() VersionParams { 94 if m != nil { 95 return m.Version 96 } 97 return VersionParams{} 98 } 99 100 // BlockParams contains limits on the block size. 101 type BlockParams struct { 102 // Note: must be greater than 0 103 MaxBytes int64 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` 104 // Note: must be greater or equal to -1 105 MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` 106 // Minimum time increment between consecutive blocks (in milliseconds) 107 // Not exposed to the application. 108 TimeIotaMs int64 `protobuf:"varint,3,opt,name=time_iota_ms,json=timeIotaMs,proto3" json:"time_iota_ms,omitempty"` 109 } 110 111 func (m *BlockParams) Reset() { *m = BlockParams{} } 112 func (m *BlockParams) String() string { return proto.CompactTextString(m) } 113 func (*BlockParams) ProtoMessage() {} 114 func (*BlockParams) Descriptor() ([]byte, []int) { 115 return fileDescriptor_e12598271a686f57, []int{1} 116 } 117 func (m *BlockParams) XXX_Unmarshal(b []byte) error { 118 return m.Unmarshal(b) 119 } 120 func (m *BlockParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 121 if deterministic { 122 return xxx_messageInfo_BlockParams.Marshal(b, m, deterministic) 123 } else { 124 b = b[:cap(b)] 125 n, err := m.MarshalToSizedBuffer(b) 126 if err != nil { 127 return nil, err 128 } 129 return b[:n], nil 130 } 131 } 132 func (m *BlockParams) XXX_Merge(src proto.Message) { 133 xxx_messageInfo_BlockParams.Merge(m, src) 134 } 135 func (m *BlockParams) XXX_Size() int { 136 return m.Size() 137 } 138 func (m *BlockParams) XXX_DiscardUnknown() { 139 xxx_messageInfo_BlockParams.DiscardUnknown(m) 140 } 141 142 var xxx_messageInfo_BlockParams proto.InternalMessageInfo 143 144 func (m *BlockParams) GetMaxBytes() int64 { 145 if m != nil { 146 return m.MaxBytes 147 } 148 return 0 149 } 150 151 func (m *BlockParams) GetMaxGas() int64 { 152 if m != nil { 153 return m.MaxGas 154 } 155 return 0 156 } 157 158 func (m *BlockParams) GetTimeIotaMs() int64 { 159 if m != nil { 160 return m.TimeIotaMs 161 } 162 return 0 163 } 164 165 // EvidenceParams determine how we handle evidence of malfeasance. 166 type EvidenceParams struct { 167 // Max age of evidence, in blocks. 168 // 169 // The basic formula for calculating this is: MaxAgeDuration / {average block 170 // time}. 171 MaxAgeNumBlocks int64 `protobuf:"varint,1,opt,name=max_age_num_blocks,json=maxAgeNumBlocks,proto3" json:"max_age_num_blocks,omitempty"` 172 // Max age of evidence, in time. 173 // 174 // It should correspond with an app's "unbonding period" or other similar 175 // mechanism for handling [Nothing-At-Stake 176 // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). 177 MaxAgeDuration time.Duration `protobuf:"bytes,2,opt,name=max_age_duration,json=maxAgeDuration,proto3,stdduration" json:"max_age_duration"` 178 // This sets the maximum number of evidence that can be committed in a single block. 179 // and should fall comfortably under the max block bytes when we consider the size of 180 // each evidence (See MaxEvidenceBytes). The maximum number is MaxEvidencePerBlock. 181 // Default is 50 182 MaxNum uint32 `protobuf:"varint,3,opt,name=max_num,json=maxNum,proto3" json:"max_num,omitempty"` 183 // Proof trial period dictates the time given for nodes accused of amnesia evidence, incorrectly 184 // voting twice in two different rounds to respond with their respective proofs. 185 // Default is half the max age in blocks: 50,000 186 ProofTrialPeriod int64 `protobuf:"varint,4,opt,name=proof_trial_period,json=proofTrialPeriod,proto3" json:"proof_trial_period,omitempty"` 187 } 188 189 func (m *EvidenceParams) Reset() { *m = EvidenceParams{} } 190 func (m *EvidenceParams) String() string { return proto.CompactTextString(m) } 191 func (*EvidenceParams) ProtoMessage() {} 192 func (*EvidenceParams) Descriptor() ([]byte, []int) { 193 return fileDescriptor_e12598271a686f57, []int{2} 194 } 195 func (m *EvidenceParams) XXX_Unmarshal(b []byte) error { 196 return m.Unmarshal(b) 197 } 198 func (m *EvidenceParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 199 if deterministic { 200 return xxx_messageInfo_EvidenceParams.Marshal(b, m, deterministic) 201 } else { 202 b = b[:cap(b)] 203 n, err := m.MarshalToSizedBuffer(b) 204 if err != nil { 205 return nil, err 206 } 207 return b[:n], nil 208 } 209 } 210 func (m *EvidenceParams) XXX_Merge(src proto.Message) { 211 xxx_messageInfo_EvidenceParams.Merge(m, src) 212 } 213 func (m *EvidenceParams) XXX_Size() int { 214 return m.Size() 215 } 216 func (m *EvidenceParams) XXX_DiscardUnknown() { 217 xxx_messageInfo_EvidenceParams.DiscardUnknown(m) 218 } 219 220 var xxx_messageInfo_EvidenceParams proto.InternalMessageInfo 221 222 func (m *EvidenceParams) GetMaxAgeNumBlocks() int64 { 223 if m != nil { 224 return m.MaxAgeNumBlocks 225 } 226 return 0 227 } 228 229 func (m *EvidenceParams) GetMaxAgeDuration() time.Duration { 230 if m != nil { 231 return m.MaxAgeDuration 232 } 233 return 0 234 } 235 236 func (m *EvidenceParams) GetMaxNum() uint32 { 237 if m != nil { 238 return m.MaxNum 239 } 240 return 0 241 } 242 243 func (m *EvidenceParams) GetProofTrialPeriod() int64 { 244 if m != nil { 245 return m.ProofTrialPeriod 246 } 247 return 0 248 } 249 250 // ValidatorParams restrict the public key types validators can use. 251 // NOTE: uses ABCI pubkey naming, not Amino names. 252 type ValidatorParams struct { 253 PubKeyTypes []string `protobuf:"bytes,1,rep,name=pub_key_types,json=pubKeyTypes,proto3" json:"pub_key_types,omitempty"` 254 } 255 256 func (m *ValidatorParams) Reset() { *m = ValidatorParams{} } 257 func (m *ValidatorParams) String() string { return proto.CompactTextString(m) } 258 func (*ValidatorParams) ProtoMessage() {} 259 func (*ValidatorParams) Descriptor() ([]byte, []int) { 260 return fileDescriptor_e12598271a686f57, []int{3} 261 } 262 func (m *ValidatorParams) XXX_Unmarshal(b []byte) error { 263 return m.Unmarshal(b) 264 } 265 func (m *ValidatorParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 266 if deterministic { 267 return xxx_messageInfo_ValidatorParams.Marshal(b, m, deterministic) 268 } else { 269 b = b[:cap(b)] 270 n, err := m.MarshalToSizedBuffer(b) 271 if err != nil { 272 return nil, err 273 } 274 return b[:n], nil 275 } 276 } 277 func (m *ValidatorParams) XXX_Merge(src proto.Message) { 278 xxx_messageInfo_ValidatorParams.Merge(m, src) 279 } 280 func (m *ValidatorParams) XXX_Size() int { 281 return m.Size() 282 } 283 func (m *ValidatorParams) XXX_DiscardUnknown() { 284 xxx_messageInfo_ValidatorParams.DiscardUnknown(m) 285 } 286 287 var xxx_messageInfo_ValidatorParams proto.InternalMessageInfo 288 289 func (m *ValidatorParams) GetPubKeyTypes() []string { 290 if m != nil { 291 return m.PubKeyTypes 292 } 293 return nil 294 } 295 296 // VersionParams contains the ABCI application version. 297 type VersionParams struct { 298 AppVersion uint64 `protobuf:"varint,1,opt,name=app_version,json=appVersion,proto3" json:"app_version,omitempty"` 299 } 300 301 func (m *VersionParams) Reset() { *m = VersionParams{} } 302 func (m *VersionParams) String() string { return proto.CompactTextString(m) } 303 func (*VersionParams) ProtoMessage() {} 304 func (*VersionParams) Descriptor() ([]byte, []int) { 305 return fileDescriptor_e12598271a686f57, []int{4} 306 } 307 func (m *VersionParams) XXX_Unmarshal(b []byte) error { 308 return m.Unmarshal(b) 309 } 310 func (m *VersionParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 311 if deterministic { 312 return xxx_messageInfo_VersionParams.Marshal(b, m, deterministic) 313 } else { 314 b = b[:cap(b)] 315 n, err := m.MarshalToSizedBuffer(b) 316 if err != nil { 317 return nil, err 318 } 319 return b[:n], nil 320 } 321 } 322 func (m *VersionParams) XXX_Merge(src proto.Message) { 323 xxx_messageInfo_VersionParams.Merge(m, src) 324 } 325 func (m *VersionParams) XXX_Size() int { 326 return m.Size() 327 } 328 func (m *VersionParams) XXX_DiscardUnknown() { 329 xxx_messageInfo_VersionParams.DiscardUnknown(m) 330 } 331 332 var xxx_messageInfo_VersionParams proto.InternalMessageInfo 333 334 func (m *VersionParams) GetAppVersion() uint64 { 335 if m != nil { 336 return m.AppVersion 337 } 338 return 0 339 } 340 341 // HashedParams is a subset of ConsensusParams. 342 // It is amino encoded and hashed into 343 // the Header.ConsensusHash. 344 type HashedParams struct { 345 BlockMaxBytes int64 `protobuf:"varint,1,opt,name=block_max_bytes,json=blockMaxBytes,proto3" json:"block_max_bytes,omitempty"` 346 BlockMaxGas int64 `protobuf:"varint,2,opt,name=block_max_gas,json=blockMaxGas,proto3" json:"block_max_gas,omitempty"` 347 } 348 349 func (m *HashedParams) Reset() { *m = HashedParams{} } 350 func (m *HashedParams) String() string { return proto.CompactTextString(m) } 351 func (*HashedParams) ProtoMessage() {} 352 func (*HashedParams) Descriptor() ([]byte, []int) { 353 return fileDescriptor_e12598271a686f57, []int{5} 354 } 355 func (m *HashedParams) XXX_Unmarshal(b []byte) error { 356 return m.Unmarshal(b) 357 } 358 func (m *HashedParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 359 if deterministic { 360 return xxx_messageInfo_HashedParams.Marshal(b, m, deterministic) 361 } else { 362 b = b[:cap(b)] 363 n, err := m.MarshalToSizedBuffer(b) 364 if err != nil { 365 return nil, err 366 } 367 return b[:n], nil 368 } 369 } 370 func (m *HashedParams) XXX_Merge(src proto.Message) { 371 xxx_messageInfo_HashedParams.Merge(m, src) 372 } 373 func (m *HashedParams) XXX_Size() int { 374 return m.Size() 375 } 376 func (m *HashedParams) XXX_DiscardUnknown() { 377 xxx_messageInfo_HashedParams.DiscardUnknown(m) 378 } 379 380 var xxx_messageInfo_HashedParams proto.InternalMessageInfo 381 382 func (m *HashedParams) GetBlockMaxBytes() int64 { 383 if m != nil { 384 return m.BlockMaxBytes 385 } 386 return 0 387 } 388 389 func (m *HashedParams) GetBlockMaxGas() int64 { 390 if m != nil { 391 return m.BlockMaxGas 392 } 393 return 0 394 } 395 396 func init() { 397 proto.RegisterType((*ConsensusParams)(nil), "tendermint.types.ConsensusParams") 398 proto.RegisterType((*BlockParams)(nil), "tendermint.types.BlockParams") 399 proto.RegisterType((*EvidenceParams)(nil), "tendermint.types.EvidenceParams") 400 proto.RegisterType((*ValidatorParams)(nil), "tendermint.types.ValidatorParams") 401 proto.RegisterType((*VersionParams)(nil), "tendermint.types.VersionParams") 402 proto.RegisterType((*HashedParams)(nil), "tendermint.types.HashedParams") 403 } 404 405 func init() { proto.RegisterFile("tendermint/types/params.proto", fileDescriptor_e12598271a686f57) } 406 407 var fileDescriptor_e12598271a686f57 = []byte{ 408 // 577 bytes of a gzipped FileDescriptorProto 409 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x53, 0x3d, 0x6f, 0xd3, 0x40, 410 0x18, 0x8e, 0xeb, 0xd0, 0x26, 0x6f, 0x9a, 0x26, 0x3a, 0x21, 0x11, 0x8a, 0x6a, 0x07, 0x0f, 0xa8, 411 0x12, 0xc8, 0x96, 0x60, 0x40, 0x74, 0xa9, 0x30, 0x54, 0x05, 0xa1, 0x54, 0x95, 0x55, 0x18, 0xba, 412 0x58, 0xe7, 0xf8, 0xe2, 0x5a, 0xcd, 0xf9, 0x2c, 0xdf, 0x39, 0x4a, 0xfe, 0x05, 0x63, 0xc7, 0x8e, 413 0xfc, 0x04, 0x7e, 0x42, 0xc7, 0x4a, 0x2c, 0x4c, 0x80, 0x92, 0x85, 0x9f, 0x81, 0x7c, 0xce, 0x91, 414 0x8f, 0x76, 0xb3, 0xdf, 0xe7, 0xe3, 0xee, 0x7d, 0x1e, 0x1d, 0xec, 0x09, 0x92, 0x84, 0x24, 0xa3, 415 0x71, 0x22, 0x1c, 0x31, 0x49, 0x09, 0x77, 0x52, 0x9c, 0x61, 0xca, 0xed, 0x34, 0x63, 0x82, 0xa1, 416 0xf6, 0x02, 0xb6, 0x25, 0xbc, 0xfb, 0x30, 0x62, 0x11, 0x93, 0xa0, 0x53, 0x7c, 0x95, 0xbc, 0x5d, 417 0x23, 0x62, 0x2c, 0x1a, 0x12, 0x47, 0xfe, 0x05, 0xf9, 0xc0, 0x09, 0xf3, 0x0c, 0x8b, 0x98, 0x25, 418 0x25, 0x6e, 0x5d, 0x6d, 0x40, 0xeb, 0x1d, 0x4b, 0x38, 0x49, 0x78, 0xce, 0x4f, 0xe5, 0x09, 0xe8, 419 0x0d, 0x3c, 0x08, 0x86, 0xac, 0x7f, 0xd9, 0xd1, 0xba, 0xda, 0x7e, 0xe3, 0xe5, 0x9e, 0xbd, 0x7e, 420 0x96, 0xed, 0x16, 0x70, 0xc9, 0x76, 0xab, 0x37, 0xbf, 0xcc, 0x8a, 0x57, 0x2a, 0x90, 0x0b, 0x35, 421 0x32, 0x8a, 0x43, 0x92, 0xf4, 0x49, 0x67, 0x43, 0xaa, 0xbb, 0x77, 0xd5, 0x47, 0x73, 0xc6, 0x8a, 422 0xc1, 0x7f, 0x1d, 0x3a, 0x82, 0xfa, 0x08, 0x0f, 0xe3, 0x10, 0x0b, 0x96, 0x75, 0x74, 0x69, 0xf2, 423 0xf4, 0xae, 0xc9, 0x17, 0x45, 0x59, 0x71, 0x59, 0x28, 0xd1, 0x21, 0x6c, 0x8d, 0x48, 0xc6, 0x63, 424 0x96, 0x74, 0xaa, 0xd2, 0xc4, 0xbc, 0xc7, 0xa4, 0x24, 0xac, 0x58, 0x28, 0x95, 0x45, 0xa0, 0xb1, 425 0xb4, 0x27, 0x7a, 0x02, 0x75, 0x8a, 0xc7, 0x7e, 0x30, 0x11, 0x84, 0xcb, 0x64, 0x74, 0xaf, 0x46, 426 0xf1, 0xd8, 0x2d, 0xfe, 0xd1, 0x23, 0xd8, 0x2a, 0xc0, 0x08, 0x73, 0xb9, 0xb6, 0xee, 0x6d, 0x52, 427 0x3c, 0x3e, 0xc6, 0x1c, 0x75, 0x61, 0x5b, 0xc4, 0x94, 0xf8, 0x31, 0x13, 0xd8, 0xa7, 0x5c, 0xee, 428 0xa3, 0x7b, 0x50, 0xcc, 0x3e, 0x32, 0x81, 0x7b, 0xdc, 0xfa, 0xa1, 0xc1, 0xce, 0x6a, 0x22, 0xe8, 429 0x39, 0xa0, 0xc2, 0x0d, 0x47, 0xc4, 0x4f, 0x72, 0xea, 0xcb, 0x68, 0xd5, 0x99, 0x2d, 0x8a, 0xc7, 430 0x6f, 0x23, 0x72, 0x92, 0x53, 0x79, 0x39, 0x8e, 0x7a, 0xd0, 0x56, 0x64, 0xd5, 0xed, 0x3c, 0xfa, 431 0xc7, 0x76, 0x59, 0xbe, 0xad, 0xca, 0xb7, 0xdf, 0xcf, 0x09, 0x6e, 0xad, 0x58, 0xf5, 0xea, 0xb7, 432 0xa9, 0x79, 0x3b, 0xa5, 0x9f, 0x42, 0xd4, 0x26, 0x49, 0x4e, 0xe5, 0x5d, 0x9b, 0x72, 0x93, 0x93, 433 0x9c, 0xa2, 0x17, 0x80, 0xd2, 0x8c, 0xb1, 0x81, 0x2f, 0xb2, 0x18, 0x0f, 0xfd, 0x94, 0x64, 0x31, 434 0x0b, 0x65, 0xb4, 0xba, 0xd7, 0x96, 0xc8, 0x59, 0x01, 0x9c, 0xca, 0xb9, 0x75, 0x08, 0xad, 0xb5, 435 0x86, 0x90, 0x05, 0xcd, 0x34, 0x0f, 0xfc, 0x4b, 0x32, 0xf1, 0x65, 0xfa, 0x1d, 0xad, 0xab, 0xef, 436 0xd7, 0xbd, 0x46, 0x9a, 0x07, 0x9f, 0xc8, 0xe4, 0xac, 0x18, 0x1d, 0xd4, 0xbe, 0x5f, 0x9b, 0xda, 437 0xdf, 0x6b, 0x53, 0xb3, 0x0e, 0xa0, 0xb9, 0xd2, 0x0e, 0x32, 0xa1, 0x81, 0xd3, 0xd4, 0x57, 0x9d, 438 0x16, 0x69, 0x54, 0x3d, 0xc0, 0x69, 0x3a, 0xa7, 0x2d, 0x69, 0xcf, 0x61, 0xfb, 0x03, 0xe6, 0x17, 439 0x24, 0x9c, 0x4b, 0x9f, 0x41, 0x4b, 0x66, 0xe8, 0xaf, 0x17, 0xd8, 0x94, 0xe3, 0x9e, 0x6a, 0xd1, 440 0x82, 0xe6, 0x82, 0xb7, 0xe8, 0xb2, 0xa1, 0x58, 0xc7, 0x98, 0xbb, 0x9f, 0xbf, 0x4d, 0x0d, 0xed, 441 0x66, 0x6a, 0x68, 0xb7, 0x53, 0x43, 0xfb, 0x33, 0x35, 0xb4, 0xaf, 0x33, 0xa3, 0x72, 0x3b, 0x33, 442 0x2a, 0x3f, 0x67, 0x46, 0xe5, 0xfc, 0x75, 0x14, 0x8b, 0x8b, 0x3c, 0xb0, 0xfb, 0x8c, 0x3a, 0x38, 443 0x64, 0x59, 0x8c, 0x39, 0x1b, 0x08, 0x67, 0xe9, 0x2d, 0x97, 0x2f, 0x74, 0xfd, 0x71, 0x07, 0x9b, 444 0x72, 0xfe, 0xea, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfb, 0xa0, 0x79, 0x3e, 0xf7, 0x03, 0x00, 445 0x00, 446 } 447 448 func (this *ConsensusParams) Equal(that interface{}) bool { 449 if that == nil { 450 return this == nil 451 } 452 453 that1, ok := that.(*ConsensusParams) 454 if !ok { 455 that2, ok := that.(ConsensusParams) 456 if ok { 457 that1 = &that2 458 } else { 459 return false 460 } 461 } 462 if that1 == nil { 463 return this == nil 464 } else if this == nil { 465 return false 466 } 467 if !this.Block.Equal(&that1.Block) { 468 return false 469 } 470 if !this.Evidence.Equal(&that1.Evidence) { 471 return false 472 } 473 if !this.Validator.Equal(&that1.Validator) { 474 return false 475 } 476 if !this.Version.Equal(&that1.Version) { 477 return false 478 } 479 return true 480 } 481 func (this *BlockParams) Equal(that interface{}) bool { 482 if that == nil { 483 return this == nil 484 } 485 486 that1, ok := that.(*BlockParams) 487 if !ok { 488 that2, ok := that.(BlockParams) 489 if ok { 490 that1 = &that2 491 } else { 492 return false 493 } 494 } 495 if that1 == nil { 496 return this == nil 497 } else if this == nil { 498 return false 499 } 500 if this.MaxBytes != that1.MaxBytes { 501 return false 502 } 503 if this.MaxGas != that1.MaxGas { 504 return false 505 } 506 if this.TimeIotaMs != that1.TimeIotaMs { 507 return false 508 } 509 return true 510 } 511 func (this *EvidenceParams) Equal(that interface{}) bool { 512 if that == nil { 513 return this == nil 514 } 515 516 that1, ok := that.(*EvidenceParams) 517 if !ok { 518 that2, ok := that.(EvidenceParams) 519 if ok { 520 that1 = &that2 521 } else { 522 return false 523 } 524 } 525 if that1 == nil { 526 return this == nil 527 } else if this == nil { 528 return false 529 } 530 if this.MaxAgeNumBlocks != that1.MaxAgeNumBlocks { 531 return false 532 } 533 if this.MaxAgeDuration != that1.MaxAgeDuration { 534 return false 535 } 536 if this.MaxNum != that1.MaxNum { 537 return false 538 } 539 if this.ProofTrialPeriod != that1.ProofTrialPeriod { 540 return false 541 } 542 return true 543 } 544 func (this *ValidatorParams) Equal(that interface{}) bool { 545 if that == nil { 546 return this == nil 547 } 548 549 that1, ok := that.(*ValidatorParams) 550 if !ok { 551 that2, ok := that.(ValidatorParams) 552 if ok { 553 that1 = &that2 554 } else { 555 return false 556 } 557 } 558 if that1 == nil { 559 return this == nil 560 } else if this == nil { 561 return false 562 } 563 if len(this.PubKeyTypes) != len(that1.PubKeyTypes) { 564 return false 565 } 566 for i := range this.PubKeyTypes { 567 if this.PubKeyTypes[i] != that1.PubKeyTypes[i] { 568 return false 569 } 570 } 571 return true 572 } 573 func (this *VersionParams) Equal(that interface{}) bool { 574 if that == nil { 575 return this == nil 576 } 577 578 that1, ok := that.(*VersionParams) 579 if !ok { 580 that2, ok := that.(VersionParams) 581 if ok { 582 that1 = &that2 583 } else { 584 return false 585 } 586 } 587 if that1 == nil { 588 return this == nil 589 } else if this == nil { 590 return false 591 } 592 if this.AppVersion != that1.AppVersion { 593 return false 594 } 595 return true 596 } 597 func (this *HashedParams) Equal(that interface{}) bool { 598 if that == nil { 599 return this == nil 600 } 601 602 that1, ok := that.(*HashedParams) 603 if !ok { 604 that2, ok := that.(HashedParams) 605 if ok { 606 that1 = &that2 607 } else { 608 return false 609 } 610 } 611 if that1 == nil { 612 return this == nil 613 } else if this == nil { 614 return false 615 } 616 if this.BlockMaxBytes != that1.BlockMaxBytes { 617 return false 618 } 619 if this.BlockMaxGas != that1.BlockMaxGas { 620 return false 621 } 622 return true 623 } 624 func (m *ConsensusParams) Marshal() (dAtA []byte, err error) { 625 size := m.Size() 626 dAtA = make([]byte, size) 627 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 628 if err != nil { 629 return nil, err 630 } 631 return dAtA[:n], nil 632 } 633 634 func (m *ConsensusParams) MarshalTo(dAtA []byte) (int, error) { 635 size := m.Size() 636 return m.MarshalToSizedBuffer(dAtA[:size]) 637 } 638 639 func (m *ConsensusParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { 640 i := len(dAtA) 641 _ = i 642 var l int 643 _ = l 644 { 645 size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) 646 if err != nil { 647 return 0, err 648 } 649 i -= size 650 i = encodeVarintParams(dAtA, i, uint64(size)) 651 } 652 i-- 653 dAtA[i] = 0x22 654 { 655 size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) 656 if err != nil { 657 return 0, err 658 } 659 i -= size 660 i = encodeVarintParams(dAtA, i, uint64(size)) 661 } 662 i-- 663 dAtA[i] = 0x1a 664 { 665 size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) 666 if err != nil { 667 return 0, err 668 } 669 i -= size 670 i = encodeVarintParams(dAtA, i, uint64(size)) 671 } 672 i-- 673 dAtA[i] = 0x12 674 { 675 size, err := m.Block.MarshalToSizedBuffer(dAtA[:i]) 676 if err != nil { 677 return 0, err 678 } 679 i -= size 680 i = encodeVarintParams(dAtA, i, uint64(size)) 681 } 682 i-- 683 dAtA[i] = 0xa 684 return len(dAtA) - i, nil 685 } 686 687 func (m *BlockParams) Marshal() (dAtA []byte, err error) { 688 size := m.Size() 689 dAtA = make([]byte, size) 690 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 691 if err != nil { 692 return nil, err 693 } 694 return dAtA[:n], nil 695 } 696 697 func (m *BlockParams) MarshalTo(dAtA []byte) (int, error) { 698 size := m.Size() 699 return m.MarshalToSizedBuffer(dAtA[:size]) 700 } 701 702 func (m *BlockParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { 703 i := len(dAtA) 704 _ = i 705 var l int 706 _ = l 707 if m.TimeIotaMs != 0 { 708 i = encodeVarintParams(dAtA, i, uint64(m.TimeIotaMs)) 709 i-- 710 dAtA[i] = 0x18 711 } 712 if m.MaxGas != 0 { 713 i = encodeVarintParams(dAtA, i, uint64(m.MaxGas)) 714 i-- 715 dAtA[i] = 0x10 716 } 717 if m.MaxBytes != 0 { 718 i = encodeVarintParams(dAtA, i, uint64(m.MaxBytes)) 719 i-- 720 dAtA[i] = 0x8 721 } 722 return len(dAtA) - i, nil 723 } 724 725 func (m *EvidenceParams) Marshal() (dAtA []byte, err error) { 726 size := m.Size() 727 dAtA = make([]byte, size) 728 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 729 if err != nil { 730 return nil, err 731 } 732 return dAtA[:n], nil 733 } 734 735 func (m *EvidenceParams) MarshalTo(dAtA []byte) (int, error) { 736 size := m.Size() 737 return m.MarshalToSizedBuffer(dAtA[:size]) 738 } 739 740 func (m *EvidenceParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { 741 i := len(dAtA) 742 _ = i 743 var l int 744 _ = l 745 if m.ProofTrialPeriod != 0 { 746 i = encodeVarintParams(dAtA, i, uint64(m.ProofTrialPeriod)) 747 i-- 748 dAtA[i] = 0x20 749 } 750 if m.MaxNum != 0 { 751 i = encodeVarintParams(dAtA, i, uint64(m.MaxNum)) 752 i-- 753 dAtA[i] = 0x18 754 } 755 n5, err5 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxAgeDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxAgeDuration):]) 756 if err5 != nil { 757 return 0, err5 758 } 759 i -= n5 760 i = encodeVarintParams(dAtA, i, uint64(n5)) 761 i-- 762 dAtA[i] = 0x12 763 if m.MaxAgeNumBlocks != 0 { 764 i = encodeVarintParams(dAtA, i, uint64(m.MaxAgeNumBlocks)) 765 i-- 766 dAtA[i] = 0x8 767 } 768 return len(dAtA) - i, nil 769 } 770 771 func (m *ValidatorParams) Marshal() (dAtA []byte, err error) { 772 size := m.Size() 773 dAtA = make([]byte, size) 774 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 775 if err != nil { 776 return nil, err 777 } 778 return dAtA[:n], nil 779 } 780 781 func (m *ValidatorParams) MarshalTo(dAtA []byte) (int, error) { 782 size := m.Size() 783 return m.MarshalToSizedBuffer(dAtA[:size]) 784 } 785 786 func (m *ValidatorParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { 787 i := len(dAtA) 788 _ = i 789 var l int 790 _ = l 791 if len(m.PubKeyTypes) > 0 { 792 for iNdEx := len(m.PubKeyTypes) - 1; iNdEx >= 0; iNdEx-- { 793 i -= len(m.PubKeyTypes[iNdEx]) 794 copy(dAtA[i:], m.PubKeyTypes[iNdEx]) 795 i = encodeVarintParams(dAtA, i, uint64(len(m.PubKeyTypes[iNdEx]))) 796 i-- 797 dAtA[i] = 0xa 798 } 799 } 800 return len(dAtA) - i, nil 801 } 802 803 func (m *VersionParams) Marshal() (dAtA []byte, err error) { 804 size := m.Size() 805 dAtA = make([]byte, size) 806 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 807 if err != nil { 808 return nil, err 809 } 810 return dAtA[:n], nil 811 } 812 813 func (m *VersionParams) MarshalTo(dAtA []byte) (int, error) { 814 size := m.Size() 815 return m.MarshalToSizedBuffer(dAtA[:size]) 816 } 817 818 func (m *VersionParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { 819 i := len(dAtA) 820 _ = i 821 var l int 822 _ = l 823 if m.AppVersion != 0 { 824 i = encodeVarintParams(dAtA, i, uint64(m.AppVersion)) 825 i-- 826 dAtA[i] = 0x8 827 } 828 return len(dAtA) - i, nil 829 } 830 831 func (m *HashedParams) Marshal() (dAtA []byte, err error) { 832 size := m.Size() 833 dAtA = make([]byte, size) 834 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 835 if err != nil { 836 return nil, err 837 } 838 return dAtA[:n], nil 839 } 840 841 func (m *HashedParams) MarshalTo(dAtA []byte) (int, error) { 842 size := m.Size() 843 return m.MarshalToSizedBuffer(dAtA[:size]) 844 } 845 846 func (m *HashedParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { 847 i := len(dAtA) 848 _ = i 849 var l int 850 _ = l 851 if m.BlockMaxGas != 0 { 852 i = encodeVarintParams(dAtA, i, uint64(m.BlockMaxGas)) 853 i-- 854 dAtA[i] = 0x10 855 } 856 if m.BlockMaxBytes != 0 { 857 i = encodeVarintParams(dAtA, i, uint64(m.BlockMaxBytes)) 858 i-- 859 dAtA[i] = 0x8 860 } 861 return len(dAtA) - i, nil 862 } 863 864 func encodeVarintParams(dAtA []byte, offset int, v uint64) int { 865 offset -= sovParams(v) 866 base := offset 867 for v >= 1<<7 { 868 dAtA[offset] = uint8(v&0x7f | 0x80) 869 v >>= 7 870 offset++ 871 } 872 dAtA[offset] = uint8(v) 873 return base 874 } 875 func NewPopulatedValidatorParams(r randyParams, easy bool) *ValidatorParams { 876 this := &ValidatorParams{} 877 v1 := r.Intn(10) 878 this.PubKeyTypes = make([]string, v1) 879 for i := 0; i < v1; i++ { 880 this.PubKeyTypes[i] = string(randStringParams(r)) 881 } 882 if !easy && r.Intn(10) != 0 { 883 } 884 return this 885 } 886 887 func NewPopulatedVersionParams(r randyParams, easy bool) *VersionParams { 888 this := &VersionParams{} 889 this.AppVersion = uint64(uint64(r.Uint32())) 890 if !easy && r.Intn(10) != 0 { 891 } 892 return this 893 } 894 895 type randyParams interface { 896 Float32() float32 897 Float64() float64 898 Int63() int64 899 Int31() int32 900 Uint32() uint32 901 Intn(n int) int 902 } 903 904 func randUTF8RuneParams(r randyParams) rune { 905 ru := r.Intn(62) 906 if ru < 10 { 907 return rune(ru + 48) 908 } else if ru < 36 { 909 return rune(ru + 55) 910 } 911 return rune(ru + 61) 912 } 913 func randStringParams(r randyParams) string { 914 v2 := r.Intn(100) 915 tmps := make([]rune, v2) 916 for i := 0; i < v2; i++ { 917 tmps[i] = randUTF8RuneParams(r) 918 } 919 return string(tmps) 920 } 921 func randUnrecognizedParams(r randyParams, maxFieldNumber int) (dAtA []byte) { 922 l := r.Intn(5) 923 for i := 0; i < l; i++ { 924 wire := r.Intn(4) 925 if wire == 3 { 926 wire = 5 927 } 928 fieldNumber := maxFieldNumber + r.Intn(100) 929 dAtA = randFieldParams(dAtA, r, fieldNumber, wire) 930 } 931 return dAtA 932 } 933 func randFieldParams(dAtA []byte, r randyParams, fieldNumber int, wire int) []byte { 934 key := uint32(fieldNumber)<<3 | uint32(wire) 935 switch wire { 936 case 0: 937 dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) 938 v3 := r.Int63() 939 if r.Intn(2) == 0 { 940 v3 *= -1 941 } 942 dAtA = encodeVarintPopulateParams(dAtA, uint64(v3)) 943 case 1: 944 dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) 945 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) 946 case 2: 947 dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) 948 ll := r.Intn(100) 949 dAtA = encodeVarintPopulateParams(dAtA, uint64(ll)) 950 for j := 0; j < ll; j++ { 951 dAtA = append(dAtA, byte(r.Intn(256))) 952 } 953 default: 954 dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) 955 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) 956 } 957 return dAtA 958 } 959 func encodeVarintPopulateParams(dAtA []byte, v uint64) []byte { 960 for v >= 1<<7 { 961 dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) 962 v >>= 7 963 } 964 dAtA = append(dAtA, uint8(v)) 965 return dAtA 966 } 967 func (m *ConsensusParams) Size() (n int) { 968 if m == nil { 969 return 0 970 } 971 var l int 972 _ = l 973 l = m.Block.Size() 974 n += 1 + l + sovParams(uint64(l)) 975 l = m.Evidence.Size() 976 n += 1 + l + sovParams(uint64(l)) 977 l = m.Validator.Size() 978 n += 1 + l + sovParams(uint64(l)) 979 l = m.Version.Size() 980 n += 1 + l + sovParams(uint64(l)) 981 return n 982 } 983 984 func (m *BlockParams) Size() (n int) { 985 if m == nil { 986 return 0 987 } 988 var l int 989 _ = l 990 if m.MaxBytes != 0 { 991 n += 1 + sovParams(uint64(m.MaxBytes)) 992 } 993 if m.MaxGas != 0 { 994 n += 1 + sovParams(uint64(m.MaxGas)) 995 } 996 if m.TimeIotaMs != 0 { 997 n += 1 + sovParams(uint64(m.TimeIotaMs)) 998 } 999 return n 1000 } 1001 1002 func (m *EvidenceParams) Size() (n int) { 1003 if m == nil { 1004 return 0 1005 } 1006 var l int 1007 _ = l 1008 if m.MaxAgeNumBlocks != 0 { 1009 n += 1 + sovParams(uint64(m.MaxAgeNumBlocks)) 1010 } 1011 l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxAgeDuration) 1012 n += 1 + l + sovParams(uint64(l)) 1013 if m.MaxNum != 0 { 1014 n += 1 + sovParams(uint64(m.MaxNum)) 1015 } 1016 if m.ProofTrialPeriod != 0 { 1017 n += 1 + sovParams(uint64(m.ProofTrialPeriod)) 1018 } 1019 return n 1020 } 1021 1022 func (m *ValidatorParams) Size() (n int) { 1023 if m == nil { 1024 return 0 1025 } 1026 var l int 1027 _ = l 1028 if len(m.PubKeyTypes) > 0 { 1029 for _, s := range m.PubKeyTypes { 1030 l = len(s) 1031 n += 1 + l + sovParams(uint64(l)) 1032 } 1033 } 1034 return n 1035 } 1036 1037 func (m *VersionParams) Size() (n int) { 1038 if m == nil { 1039 return 0 1040 } 1041 var l int 1042 _ = l 1043 if m.AppVersion != 0 { 1044 n += 1 + sovParams(uint64(m.AppVersion)) 1045 } 1046 return n 1047 } 1048 1049 func (m *HashedParams) Size() (n int) { 1050 if m == nil { 1051 return 0 1052 } 1053 var l int 1054 _ = l 1055 if m.BlockMaxBytes != 0 { 1056 n += 1 + sovParams(uint64(m.BlockMaxBytes)) 1057 } 1058 if m.BlockMaxGas != 0 { 1059 n += 1 + sovParams(uint64(m.BlockMaxGas)) 1060 } 1061 return n 1062 } 1063 1064 func sovParams(x uint64) (n int) { 1065 return (math_bits.Len64(x|1) + 6) / 7 1066 } 1067 func sozParams(x uint64) (n int) { 1068 return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 1069 } 1070 func (m *ConsensusParams) Unmarshal(dAtA []byte) error { 1071 l := len(dAtA) 1072 iNdEx := 0 1073 for iNdEx < l { 1074 preIndex := iNdEx 1075 var wire uint64 1076 for shift := uint(0); ; shift += 7 { 1077 if shift >= 64 { 1078 return ErrIntOverflowParams 1079 } 1080 if iNdEx >= l { 1081 return io.ErrUnexpectedEOF 1082 } 1083 b := dAtA[iNdEx] 1084 iNdEx++ 1085 wire |= uint64(b&0x7F) << shift 1086 if b < 0x80 { 1087 break 1088 } 1089 } 1090 fieldNum := int32(wire >> 3) 1091 wireType := int(wire & 0x7) 1092 if wireType == 4 { 1093 return fmt.Errorf("proto: ConsensusParams: wiretype end group for non-group") 1094 } 1095 if fieldNum <= 0 { 1096 return fmt.Errorf("proto: ConsensusParams: illegal tag %d (wire type %d)", fieldNum, wire) 1097 } 1098 switch fieldNum { 1099 case 1: 1100 if wireType != 2 { 1101 return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) 1102 } 1103 var msglen int 1104 for shift := uint(0); ; shift += 7 { 1105 if shift >= 64 { 1106 return ErrIntOverflowParams 1107 } 1108 if iNdEx >= l { 1109 return io.ErrUnexpectedEOF 1110 } 1111 b := dAtA[iNdEx] 1112 iNdEx++ 1113 msglen |= int(b&0x7F) << shift 1114 if b < 0x80 { 1115 break 1116 } 1117 } 1118 if msglen < 0 { 1119 return ErrInvalidLengthParams 1120 } 1121 postIndex := iNdEx + msglen 1122 if postIndex < 0 { 1123 return ErrInvalidLengthParams 1124 } 1125 if postIndex > l { 1126 return io.ErrUnexpectedEOF 1127 } 1128 if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1129 return err 1130 } 1131 iNdEx = postIndex 1132 case 2: 1133 if wireType != 2 { 1134 return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) 1135 } 1136 var msglen int 1137 for shift := uint(0); ; shift += 7 { 1138 if shift >= 64 { 1139 return ErrIntOverflowParams 1140 } 1141 if iNdEx >= l { 1142 return io.ErrUnexpectedEOF 1143 } 1144 b := dAtA[iNdEx] 1145 iNdEx++ 1146 msglen |= int(b&0x7F) << shift 1147 if b < 0x80 { 1148 break 1149 } 1150 } 1151 if msglen < 0 { 1152 return ErrInvalidLengthParams 1153 } 1154 postIndex := iNdEx + msglen 1155 if postIndex < 0 { 1156 return ErrInvalidLengthParams 1157 } 1158 if postIndex > l { 1159 return io.ErrUnexpectedEOF 1160 } 1161 if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1162 return err 1163 } 1164 iNdEx = postIndex 1165 case 3: 1166 if wireType != 2 { 1167 return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) 1168 } 1169 var msglen int 1170 for shift := uint(0); ; shift += 7 { 1171 if shift >= 64 { 1172 return ErrIntOverflowParams 1173 } 1174 if iNdEx >= l { 1175 return io.ErrUnexpectedEOF 1176 } 1177 b := dAtA[iNdEx] 1178 iNdEx++ 1179 msglen |= int(b&0x7F) << shift 1180 if b < 0x80 { 1181 break 1182 } 1183 } 1184 if msglen < 0 { 1185 return ErrInvalidLengthParams 1186 } 1187 postIndex := iNdEx + msglen 1188 if postIndex < 0 { 1189 return ErrInvalidLengthParams 1190 } 1191 if postIndex > l { 1192 return io.ErrUnexpectedEOF 1193 } 1194 if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1195 return err 1196 } 1197 iNdEx = postIndex 1198 case 4: 1199 if wireType != 2 { 1200 return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) 1201 } 1202 var msglen int 1203 for shift := uint(0); ; shift += 7 { 1204 if shift >= 64 { 1205 return ErrIntOverflowParams 1206 } 1207 if iNdEx >= l { 1208 return io.ErrUnexpectedEOF 1209 } 1210 b := dAtA[iNdEx] 1211 iNdEx++ 1212 msglen |= int(b&0x7F) << shift 1213 if b < 0x80 { 1214 break 1215 } 1216 } 1217 if msglen < 0 { 1218 return ErrInvalidLengthParams 1219 } 1220 postIndex := iNdEx + msglen 1221 if postIndex < 0 { 1222 return ErrInvalidLengthParams 1223 } 1224 if postIndex > l { 1225 return io.ErrUnexpectedEOF 1226 } 1227 if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1228 return err 1229 } 1230 iNdEx = postIndex 1231 default: 1232 iNdEx = preIndex 1233 skippy, err := skipParams(dAtA[iNdEx:]) 1234 if err != nil { 1235 return err 1236 } 1237 if skippy < 0 { 1238 return ErrInvalidLengthParams 1239 } 1240 if (iNdEx + skippy) < 0 { 1241 return ErrInvalidLengthParams 1242 } 1243 if (iNdEx + skippy) > l { 1244 return io.ErrUnexpectedEOF 1245 } 1246 iNdEx += skippy 1247 } 1248 } 1249 1250 if iNdEx > l { 1251 return io.ErrUnexpectedEOF 1252 } 1253 return nil 1254 } 1255 func (m *BlockParams) Unmarshal(dAtA []byte) error { 1256 l := len(dAtA) 1257 iNdEx := 0 1258 for iNdEx < l { 1259 preIndex := iNdEx 1260 var wire uint64 1261 for shift := uint(0); ; shift += 7 { 1262 if shift >= 64 { 1263 return ErrIntOverflowParams 1264 } 1265 if iNdEx >= l { 1266 return io.ErrUnexpectedEOF 1267 } 1268 b := dAtA[iNdEx] 1269 iNdEx++ 1270 wire |= uint64(b&0x7F) << shift 1271 if b < 0x80 { 1272 break 1273 } 1274 } 1275 fieldNum := int32(wire >> 3) 1276 wireType := int(wire & 0x7) 1277 if wireType == 4 { 1278 return fmt.Errorf("proto: BlockParams: wiretype end group for non-group") 1279 } 1280 if fieldNum <= 0 { 1281 return fmt.Errorf("proto: BlockParams: illegal tag %d (wire type %d)", fieldNum, wire) 1282 } 1283 switch fieldNum { 1284 case 1: 1285 if wireType != 0 { 1286 return fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) 1287 } 1288 m.MaxBytes = 0 1289 for shift := uint(0); ; shift += 7 { 1290 if shift >= 64 { 1291 return ErrIntOverflowParams 1292 } 1293 if iNdEx >= l { 1294 return io.ErrUnexpectedEOF 1295 } 1296 b := dAtA[iNdEx] 1297 iNdEx++ 1298 m.MaxBytes |= int64(b&0x7F) << shift 1299 if b < 0x80 { 1300 break 1301 } 1302 } 1303 case 2: 1304 if wireType != 0 { 1305 return fmt.Errorf("proto: wrong wireType = %d for field MaxGas", wireType) 1306 } 1307 m.MaxGas = 0 1308 for shift := uint(0); ; shift += 7 { 1309 if shift >= 64 { 1310 return ErrIntOverflowParams 1311 } 1312 if iNdEx >= l { 1313 return io.ErrUnexpectedEOF 1314 } 1315 b := dAtA[iNdEx] 1316 iNdEx++ 1317 m.MaxGas |= int64(b&0x7F) << shift 1318 if b < 0x80 { 1319 break 1320 } 1321 } 1322 case 3: 1323 if wireType != 0 { 1324 return fmt.Errorf("proto: wrong wireType = %d for field TimeIotaMs", wireType) 1325 } 1326 m.TimeIotaMs = 0 1327 for shift := uint(0); ; shift += 7 { 1328 if shift >= 64 { 1329 return ErrIntOverflowParams 1330 } 1331 if iNdEx >= l { 1332 return io.ErrUnexpectedEOF 1333 } 1334 b := dAtA[iNdEx] 1335 iNdEx++ 1336 m.TimeIotaMs |= int64(b&0x7F) << shift 1337 if b < 0x80 { 1338 break 1339 } 1340 } 1341 default: 1342 iNdEx = preIndex 1343 skippy, err := skipParams(dAtA[iNdEx:]) 1344 if err != nil { 1345 return err 1346 } 1347 if skippy < 0 { 1348 return ErrInvalidLengthParams 1349 } 1350 if (iNdEx + skippy) < 0 { 1351 return ErrInvalidLengthParams 1352 } 1353 if (iNdEx + skippy) > l { 1354 return io.ErrUnexpectedEOF 1355 } 1356 iNdEx += skippy 1357 } 1358 } 1359 1360 if iNdEx > l { 1361 return io.ErrUnexpectedEOF 1362 } 1363 return nil 1364 } 1365 func (m *EvidenceParams) Unmarshal(dAtA []byte) error { 1366 l := len(dAtA) 1367 iNdEx := 0 1368 for iNdEx < l { 1369 preIndex := iNdEx 1370 var wire uint64 1371 for shift := uint(0); ; shift += 7 { 1372 if shift >= 64 { 1373 return ErrIntOverflowParams 1374 } 1375 if iNdEx >= l { 1376 return io.ErrUnexpectedEOF 1377 } 1378 b := dAtA[iNdEx] 1379 iNdEx++ 1380 wire |= uint64(b&0x7F) << shift 1381 if b < 0x80 { 1382 break 1383 } 1384 } 1385 fieldNum := int32(wire >> 3) 1386 wireType := int(wire & 0x7) 1387 if wireType == 4 { 1388 return fmt.Errorf("proto: EvidenceParams: wiretype end group for non-group") 1389 } 1390 if fieldNum <= 0 { 1391 return fmt.Errorf("proto: EvidenceParams: illegal tag %d (wire type %d)", fieldNum, wire) 1392 } 1393 switch fieldNum { 1394 case 1: 1395 if wireType != 0 { 1396 return fmt.Errorf("proto: wrong wireType = %d for field MaxAgeNumBlocks", wireType) 1397 } 1398 m.MaxAgeNumBlocks = 0 1399 for shift := uint(0); ; shift += 7 { 1400 if shift >= 64 { 1401 return ErrIntOverflowParams 1402 } 1403 if iNdEx >= l { 1404 return io.ErrUnexpectedEOF 1405 } 1406 b := dAtA[iNdEx] 1407 iNdEx++ 1408 m.MaxAgeNumBlocks |= int64(b&0x7F) << shift 1409 if b < 0x80 { 1410 break 1411 } 1412 } 1413 case 2: 1414 if wireType != 2 { 1415 return fmt.Errorf("proto: wrong wireType = %d for field MaxAgeDuration", wireType) 1416 } 1417 var msglen int 1418 for shift := uint(0); ; shift += 7 { 1419 if shift >= 64 { 1420 return ErrIntOverflowParams 1421 } 1422 if iNdEx >= l { 1423 return io.ErrUnexpectedEOF 1424 } 1425 b := dAtA[iNdEx] 1426 iNdEx++ 1427 msglen |= int(b&0x7F) << shift 1428 if b < 0x80 { 1429 break 1430 } 1431 } 1432 if msglen < 0 { 1433 return ErrInvalidLengthParams 1434 } 1435 postIndex := iNdEx + msglen 1436 if postIndex < 0 { 1437 return ErrInvalidLengthParams 1438 } 1439 if postIndex > l { 1440 return io.ErrUnexpectedEOF 1441 } 1442 if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.MaxAgeDuration, dAtA[iNdEx:postIndex]); err != nil { 1443 return err 1444 } 1445 iNdEx = postIndex 1446 case 3: 1447 if wireType != 0 { 1448 return fmt.Errorf("proto: wrong wireType = %d for field MaxNum", wireType) 1449 } 1450 m.MaxNum = 0 1451 for shift := uint(0); ; shift += 7 { 1452 if shift >= 64 { 1453 return ErrIntOverflowParams 1454 } 1455 if iNdEx >= l { 1456 return io.ErrUnexpectedEOF 1457 } 1458 b := dAtA[iNdEx] 1459 iNdEx++ 1460 m.MaxNum |= uint32(b&0x7F) << shift 1461 if b < 0x80 { 1462 break 1463 } 1464 } 1465 case 4: 1466 if wireType != 0 { 1467 return fmt.Errorf("proto: wrong wireType = %d for field ProofTrialPeriod", wireType) 1468 } 1469 m.ProofTrialPeriod = 0 1470 for shift := uint(0); ; shift += 7 { 1471 if shift >= 64 { 1472 return ErrIntOverflowParams 1473 } 1474 if iNdEx >= l { 1475 return io.ErrUnexpectedEOF 1476 } 1477 b := dAtA[iNdEx] 1478 iNdEx++ 1479 m.ProofTrialPeriod |= int64(b&0x7F) << shift 1480 if b < 0x80 { 1481 break 1482 } 1483 } 1484 default: 1485 iNdEx = preIndex 1486 skippy, err := skipParams(dAtA[iNdEx:]) 1487 if err != nil { 1488 return err 1489 } 1490 if skippy < 0 { 1491 return ErrInvalidLengthParams 1492 } 1493 if (iNdEx + skippy) < 0 { 1494 return ErrInvalidLengthParams 1495 } 1496 if (iNdEx + skippy) > l { 1497 return io.ErrUnexpectedEOF 1498 } 1499 iNdEx += skippy 1500 } 1501 } 1502 1503 if iNdEx > l { 1504 return io.ErrUnexpectedEOF 1505 } 1506 return nil 1507 } 1508 func (m *ValidatorParams) Unmarshal(dAtA []byte) error { 1509 l := len(dAtA) 1510 iNdEx := 0 1511 for iNdEx < l { 1512 preIndex := iNdEx 1513 var wire uint64 1514 for shift := uint(0); ; shift += 7 { 1515 if shift >= 64 { 1516 return ErrIntOverflowParams 1517 } 1518 if iNdEx >= l { 1519 return io.ErrUnexpectedEOF 1520 } 1521 b := dAtA[iNdEx] 1522 iNdEx++ 1523 wire |= uint64(b&0x7F) << shift 1524 if b < 0x80 { 1525 break 1526 } 1527 } 1528 fieldNum := int32(wire >> 3) 1529 wireType := int(wire & 0x7) 1530 if wireType == 4 { 1531 return fmt.Errorf("proto: ValidatorParams: wiretype end group for non-group") 1532 } 1533 if fieldNum <= 0 { 1534 return fmt.Errorf("proto: ValidatorParams: illegal tag %d (wire type %d)", fieldNum, wire) 1535 } 1536 switch fieldNum { 1537 case 1: 1538 if wireType != 2 { 1539 return fmt.Errorf("proto: wrong wireType = %d for field PubKeyTypes", wireType) 1540 } 1541 var stringLen uint64 1542 for shift := uint(0); ; shift += 7 { 1543 if shift >= 64 { 1544 return ErrIntOverflowParams 1545 } 1546 if iNdEx >= l { 1547 return io.ErrUnexpectedEOF 1548 } 1549 b := dAtA[iNdEx] 1550 iNdEx++ 1551 stringLen |= uint64(b&0x7F) << shift 1552 if b < 0x80 { 1553 break 1554 } 1555 } 1556 intStringLen := int(stringLen) 1557 if intStringLen < 0 { 1558 return ErrInvalidLengthParams 1559 } 1560 postIndex := iNdEx + intStringLen 1561 if postIndex < 0 { 1562 return ErrInvalidLengthParams 1563 } 1564 if postIndex > l { 1565 return io.ErrUnexpectedEOF 1566 } 1567 m.PubKeyTypes = append(m.PubKeyTypes, string(dAtA[iNdEx:postIndex])) 1568 iNdEx = postIndex 1569 default: 1570 iNdEx = preIndex 1571 skippy, err := skipParams(dAtA[iNdEx:]) 1572 if err != nil { 1573 return err 1574 } 1575 if skippy < 0 { 1576 return ErrInvalidLengthParams 1577 } 1578 if (iNdEx + skippy) < 0 { 1579 return ErrInvalidLengthParams 1580 } 1581 if (iNdEx + skippy) > l { 1582 return io.ErrUnexpectedEOF 1583 } 1584 iNdEx += skippy 1585 } 1586 } 1587 1588 if iNdEx > l { 1589 return io.ErrUnexpectedEOF 1590 } 1591 return nil 1592 } 1593 func (m *VersionParams) Unmarshal(dAtA []byte) error { 1594 l := len(dAtA) 1595 iNdEx := 0 1596 for iNdEx < l { 1597 preIndex := iNdEx 1598 var wire uint64 1599 for shift := uint(0); ; shift += 7 { 1600 if shift >= 64 { 1601 return ErrIntOverflowParams 1602 } 1603 if iNdEx >= l { 1604 return io.ErrUnexpectedEOF 1605 } 1606 b := dAtA[iNdEx] 1607 iNdEx++ 1608 wire |= uint64(b&0x7F) << shift 1609 if b < 0x80 { 1610 break 1611 } 1612 } 1613 fieldNum := int32(wire >> 3) 1614 wireType := int(wire & 0x7) 1615 if wireType == 4 { 1616 return fmt.Errorf("proto: VersionParams: wiretype end group for non-group") 1617 } 1618 if fieldNum <= 0 { 1619 return fmt.Errorf("proto: VersionParams: illegal tag %d (wire type %d)", fieldNum, wire) 1620 } 1621 switch fieldNum { 1622 case 1: 1623 if wireType != 0 { 1624 return fmt.Errorf("proto: wrong wireType = %d for field AppVersion", wireType) 1625 } 1626 m.AppVersion = 0 1627 for shift := uint(0); ; shift += 7 { 1628 if shift >= 64 { 1629 return ErrIntOverflowParams 1630 } 1631 if iNdEx >= l { 1632 return io.ErrUnexpectedEOF 1633 } 1634 b := dAtA[iNdEx] 1635 iNdEx++ 1636 m.AppVersion |= uint64(b&0x7F) << shift 1637 if b < 0x80 { 1638 break 1639 } 1640 } 1641 default: 1642 iNdEx = preIndex 1643 skippy, err := skipParams(dAtA[iNdEx:]) 1644 if err != nil { 1645 return err 1646 } 1647 if skippy < 0 { 1648 return ErrInvalidLengthParams 1649 } 1650 if (iNdEx + skippy) < 0 { 1651 return ErrInvalidLengthParams 1652 } 1653 if (iNdEx + skippy) > l { 1654 return io.ErrUnexpectedEOF 1655 } 1656 iNdEx += skippy 1657 } 1658 } 1659 1660 if iNdEx > l { 1661 return io.ErrUnexpectedEOF 1662 } 1663 return nil 1664 } 1665 func (m *HashedParams) Unmarshal(dAtA []byte) error { 1666 l := len(dAtA) 1667 iNdEx := 0 1668 for iNdEx < l { 1669 preIndex := iNdEx 1670 var wire uint64 1671 for shift := uint(0); ; shift += 7 { 1672 if shift >= 64 { 1673 return ErrIntOverflowParams 1674 } 1675 if iNdEx >= l { 1676 return io.ErrUnexpectedEOF 1677 } 1678 b := dAtA[iNdEx] 1679 iNdEx++ 1680 wire |= uint64(b&0x7F) << shift 1681 if b < 0x80 { 1682 break 1683 } 1684 } 1685 fieldNum := int32(wire >> 3) 1686 wireType := int(wire & 0x7) 1687 if wireType == 4 { 1688 return fmt.Errorf("proto: HashedParams: wiretype end group for non-group") 1689 } 1690 if fieldNum <= 0 { 1691 return fmt.Errorf("proto: HashedParams: illegal tag %d (wire type %d)", fieldNum, wire) 1692 } 1693 switch fieldNum { 1694 case 1: 1695 if wireType != 0 { 1696 return fmt.Errorf("proto: wrong wireType = %d for field BlockMaxBytes", wireType) 1697 } 1698 m.BlockMaxBytes = 0 1699 for shift := uint(0); ; shift += 7 { 1700 if shift >= 64 { 1701 return ErrIntOverflowParams 1702 } 1703 if iNdEx >= l { 1704 return io.ErrUnexpectedEOF 1705 } 1706 b := dAtA[iNdEx] 1707 iNdEx++ 1708 m.BlockMaxBytes |= int64(b&0x7F) << shift 1709 if b < 0x80 { 1710 break 1711 } 1712 } 1713 case 2: 1714 if wireType != 0 { 1715 return fmt.Errorf("proto: wrong wireType = %d for field BlockMaxGas", wireType) 1716 } 1717 m.BlockMaxGas = 0 1718 for shift := uint(0); ; shift += 7 { 1719 if shift >= 64 { 1720 return ErrIntOverflowParams 1721 } 1722 if iNdEx >= l { 1723 return io.ErrUnexpectedEOF 1724 } 1725 b := dAtA[iNdEx] 1726 iNdEx++ 1727 m.BlockMaxGas |= int64(b&0x7F) << shift 1728 if b < 0x80 { 1729 break 1730 } 1731 } 1732 default: 1733 iNdEx = preIndex 1734 skippy, err := skipParams(dAtA[iNdEx:]) 1735 if err != nil { 1736 return err 1737 } 1738 if skippy < 0 { 1739 return ErrInvalidLengthParams 1740 } 1741 if (iNdEx + skippy) < 0 { 1742 return ErrInvalidLengthParams 1743 } 1744 if (iNdEx + skippy) > l { 1745 return io.ErrUnexpectedEOF 1746 } 1747 iNdEx += skippy 1748 } 1749 } 1750 1751 if iNdEx > l { 1752 return io.ErrUnexpectedEOF 1753 } 1754 return nil 1755 } 1756 func skipParams(dAtA []byte) (n int, err error) { 1757 l := len(dAtA) 1758 iNdEx := 0 1759 depth := 0 1760 for iNdEx < l { 1761 var wire uint64 1762 for shift := uint(0); ; shift += 7 { 1763 if shift >= 64 { 1764 return 0, ErrIntOverflowParams 1765 } 1766 if iNdEx >= l { 1767 return 0, io.ErrUnexpectedEOF 1768 } 1769 b := dAtA[iNdEx] 1770 iNdEx++ 1771 wire |= (uint64(b) & 0x7F) << shift 1772 if b < 0x80 { 1773 break 1774 } 1775 } 1776 wireType := int(wire & 0x7) 1777 switch wireType { 1778 case 0: 1779 for shift := uint(0); ; shift += 7 { 1780 if shift >= 64 { 1781 return 0, ErrIntOverflowParams 1782 } 1783 if iNdEx >= l { 1784 return 0, io.ErrUnexpectedEOF 1785 } 1786 iNdEx++ 1787 if dAtA[iNdEx-1] < 0x80 { 1788 break 1789 } 1790 } 1791 case 1: 1792 iNdEx += 8 1793 case 2: 1794 var length int 1795 for shift := uint(0); ; shift += 7 { 1796 if shift >= 64 { 1797 return 0, ErrIntOverflowParams 1798 } 1799 if iNdEx >= l { 1800 return 0, io.ErrUnexpectedEOF 1801 } 1802 b := dAtA[iNdEx] 1803 iNdEx++ 1804 length |= (int(b) & 0x7F) << shift 1805 if b < 0x80 { 1806 break 1807 } 1808 } 1809 if length < 0 { 1810 return 0, ErrInvalidLengthParams 1811 } 1812 iNdEx += length 1813 case 3: 1814 depth++ 1815 case 4: 1816 if depth == 0 { 1817 return 0, ErrUnexpectedEndOfGroupParams 1818 } 1819 depth-- 1820 case 5: 1821 iNdEx += 4 1822 default: 1823 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1824 } 1825 if iNdEx < 0 { 1826 return 0, ErrInvalidLengthParams 1827 } 1828 if depth == 0 { 1829 return iNdEx, nil 1830 } 1831 } 1832 return 0, io.ErrUnexpectedEOF 1833 } 1834 1835 var ( 1836 ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") 1837 ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") 1838 ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") 1839 )