github.com/cosmos/cosmos-sdk@v0.50.10/x/slashing/types/genesis.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: cosmos/slashing/v1beta1/genesis.proto 3 4 package types 5 6 import ( 7 fmt "fmt" 8 _ "github.com/cosmos/cosmos-proto" 9 _ "github.com/cosmos/cosmos-sdk/types/tx/amino" 10 _ "github.com/cosmos/gogoproto/gogoproto" 11 proto "github.com/cosmos/gogoproto/proto" 12 io "io" 13 math "math" 14 math_bits "math/bits" 15 ) 16 17 // Reference imports to suppress errors if they are not otherwise used. 18 var _ = proto.Marshal 19 var _ = fmt.Errorf 20 var _ = math.Inf 21 22 // This is a compile-time assertion to ensure that this generated file 23 // is compatible with the proto package it is being compiled against. 24 // A compilation error at this line likely means your copy of the 25 // proto package needs to be updated. 26 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 27 28 // GenesisState defines the slashing module's genesis state. 29 type GenesisState struct { 30 // params defines all the parameters of the module. 31 Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` 32 // signing_infos represents a map between validator addresses and their 33 // signing infos. 34 SigningInfos []SigningInfo `protobuf:"bytes,2,rep,name=signing_infos,json=signingInfos,proto3" json:"signing_infos"` 35 // missed_blocks represents a map between validator addresses and their 36 // missed blocks. 37 MissedBlocks []ValidatorMissedBlocks `protobuf:"bytes,3,rep,name=missed_blocks,json=missedBlocks,proto3" json:"missed_blocks"` 38 } 39 40 func (m *GenesisState) Reset() { *m = GenesisState{} } 41 func (m *GenesisState) String() string { return proto.CompactTextString(m) } 42 func (*GenesisState) ProtoMessage() {} 43 func (*GenesisState) Descriptor() ([]byte, []int) { 44 return fileDescriptor_1923b9188b635394, []int{0} 45 } 46 func (m *GenesisState) XXX_Unmarshal(b []byte) error { 47 return m.Unmarshal(b) 48 } 49 func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 50 if deterministic { 51 return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) 52 } else { 53 b = b[:cap(b)] 54 n, err := m.MarshalToSizedBuffer(b) 55 if err != nil { 56 return nil, err 57 } 58 return b[:n], nil 59 } 60 } 61 func (m *GenesisState) XXX_Merge(src proto.Message) { 62 xxx_messageInfo_GenesisState.Merge(m, src) 63 } 64 func (m *GenesisState) XXX_Size() int { 65 return m.Size() 66 } 67 func (m *GenesisState) XXX_DiscardUnknown() { 68 xxx_messageInfo_GenesisState.DiscardUnknown(m) 69 } 70 71 var xxx_messageInfo_GenesisState proto.InternalMessageInfo 72 73 func (m *GenesisState) GetParams() Params { 74 if m != nil { 75 return m.Params 76 } 77 return Params{} 78 } 79 80 func (m *GenesisState) GetSigningInfos() []SigningInfo { 81 if m != nil { 82 return m.SigningInfos 83 } 84 return nil 85 } 86 87 func (m *GenesisState) GetMissedBlocks() []ValidatorMissedBlocks { 88 if m != nil { 89 return m.MissedBlocks 90 } 91 return nil 92 } 93 94 // SigningInfo stores validator signing info of corresponding address. 95 type SigningInfo struct { 96 // address is the validator address. 97 Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` 98 // validator_signing_info represents the signing info of this validator. 99 ValidatorSigningInfo ValidatorSigningInfo `protobuf:"bytes,2,opt,name=validator_signing_info,json=validatorSigningInfo,proto3" json:"validator_signing_info"` 100 } 101 102 func (m *SigningInfo) Reset() { *m = SigningInfo{} } 103 func (m *SigningInfo) String() string { return proto.CompactTextString(m) } 104 func (*SigningInfo) ProtoMessage() {} 105 func (*SigningInfo) Descriptor() ([]byte, []int) { 106 return fileDescriptor_1923b9188b635394, []int{1} 107 } 108 func (m *SigningInfo) XXX_Unmarshal(b []byte) error { 109 return m.Unmarshal(b) 110 } 111 func (m *SigningInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 112 if deterministic { 113 return xxx_messageInfo_SigningInfo.Marshal(b, m, deterministic) 114 } else { 115 b = b[:cap(b)] 116 n, err := m.MarshalToSizedBuffer(b) 117 if err != nil { 118 return nil, err 119 } 120 return b[:n], nil 121 } 122 } 123 func (m *SigningInfo) XXX_Merge(src proto.Message) { 124 xxx_messageInfo_SigningInfo.Merge(m, src) 125 } 126 func (m *SigningInfo) XXX_Size() int { 127 return m.Size() 128 } 129 func (m *SigningInfo) XXX_DiscardUnknown() { 130 xxx_messageInfo_SigningInfo.DiscardUnknown(m) 131 } 132 133 var xxx_messageInfo_SigningInfo proto.InternalMessageInfo 134 135 func (m *SigningInfo) GetAddress() string { 136 if m != nil { 137 return m.Address 138 } 139 return "" 140 } 141 142 func (m *SigningInfo) GetValidatorSigningInfo() ValidatorSigningInfo { 143 if m != nil { 144 return m.ValidatorSigningInfo 145 } 146 return ValidatorSigningInfo{} 147 } 148 149 // ValidatorMissedBlocks contains array of missed blocks of corresponding 150 // address. 151 type ValidatorMissedBlocks struct { 152 // address is the validator address. 153 Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` 154 // missed_blocks is an array of missed blocks by the validator. 155 MissedBlocks []MissedBlock `protobuf:"bytes,2,rep,name=missed_blocks,json=missedBlocks,proto3" json:"missed_blocks"` 156 } 157 158 func (m *ValidatorMissedBlocks) Reset() { *m = ValidatorMissedBlocks{} } 159 func (m *ValidatorMissedBlocks) String() string { return proto.CompactTextString(m) } 160 func (*ValidatorMissedBlocks) ProtoMessage() {} 161 func (*ValidatorMissedBlocks) Descriptor() ([]byte, []int) { 162 return fileDescriptor_1923b9188b635394, []int{2} 163 } 164 func (m *ValidatorMissedBlocks) XXX_Unmarshal(b []byte) error { 165 return m.Unmarshal(b) 166 } 167 func (m *ValidatorMissedBlocks) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 168 if deterministic { 169 return xxx_messageInfo_ValidatorMissedBlocks.Marshal(b, m, deterministic) 170 } else { 171 b = b[:cap(b)] 172 n, err := m.MarshalToSizedBuffer(b) 173 if err != nil { 174 return nil, err 175 } 176 return b[:n], nil 177 } 178 } 179 func (m *ValidatorMissedBlocks) XXX_Merge(src proto.Message) { 180 xxx_messageInfo_ValidatorMissedBlocks.Merge(m, src) 181 } 182 func (m *ValidatorMissedBlocks) XXX_Size() int { 183 return m.Size() 184 } 185 func (m *ValidatorMissedBlocks) XXX_DiscardUnknown() { 186 xxx_messageInfo_ValidatorMissedBlocks.DiscardUnknown(m) 187 } 188 189 var xxx_messageInfo_ValidatorMissedBlocks proto.InternalMessageInfo 190 191 func (m *ValidatorMissedBlocks) GetAddress() string { 192 if m != nil { 193 return m.Address 194 } 195 return "" 196 } 197 198 func (m *ValidatorMissedBlocks) GetMissedBlocks() []MissedBlock { 199 if m != nil { 200 return m.MissedBlocks 201 } 202 return nil 203 } 204 205 // MissedBlock contains height and missed status as boolean. 206 type MissedBlock struct { 207 // index is the height at which the block was missed. 208 Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` 209 // missed is the missed status. 210 Missed bool `protobuf:"varint,2,opt,name=missed,proto3" json:"missed,omitempty"` 211 } 212 213 func (m *MissedBlock) Reset() { *m = MissedBlock{} } 214 func (m *MissedBlock) String() string { return proto.CompactTextString(m) } 215 func (*MissedBlock) ProtoMessage() {} 216 func (*MissedBlock) Descriptor() ([]byte, []int) { 217 return fileDescriptor_1923b9188b635394, []int{3} 218 } 219 func (m *MissedBlock) XXX_Unmarshal(b []byte) error { 220 return m.Unmarshal(b) 221 } 222 func (m *MissedBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 223 if deterministic { 224 return xxx_messageInfo_MissedBlock.Marshal(b, m, deterministic) 225 } else { 226 b = b[:cap(b)] 227 n, err := m.MarshalToSizedBuffer(b) 228 if err != nil { 229 return nil, err 230 } 231 return b[:n], nil 232 } 233 } 234 func (m *MissedBlock) XXX_Merge(src proto.Message) { 235 xxx_messageInfo_MissedBlock.Merge(m, src) 236 } 237 func (m *MissedBlock) XXX_Size() int { 238 return m.Size() 239 } 240 func (m *MissedBlock) XXX_DiscardUnknown() { 241 xxx_messageInfo_MissedBlock.DiscardUnknown(m) 242 } 243 244 var xxx_messageInfo_MissedBlock proto.InternalMessageInfo 245 246 func (m *MissedBlock) GetIndex() int64 { 247 if m != nil { 248 return m.Index 249 } 250 return 0 251 } 252 253 func (m *MissedBlock) GetMissed() bool { 254 if m != nil { 255 return m.Missed 256 } 257 return false 258 } 259 260 func init() { 261 proto.RegisterType((*GenesisState)(nil), "cosmos.slashing.v1beta1.GenesisState") 262 proto.RegisterType((*SigningInfo)(nil), "cosmos.slashing.v1beta1.SigningInfo") 263 proto.RegisterType((*ValidatorMissedBlocks)(nil), "cosmos.slashing.v1beta1.ValidatorMissedBlocks") 264 proto.RegisterType((*MissedBlock)(nil), "cosmos.slashing.v1beta1.MissedBlock") 265 } 266 267 func init() { 268 proto.RegisterFile("cosmos/slashing/v1beta1/genesis.proto", fileDescriptor_1923b9188b635394) 269 } 270 271 var fileDescriptor_1923b9188b635394 = []byte{ 272 // 444 bytes of a gzipped FileDescriptorProto 273 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xc1, 0x6e, 0xd3, 0x30, 274 0x18, 0xc7, 0xe3, 0x56, 0x14, 0xe6, 0x6c, 0x07, 0xac, 0x32, 0xc2, 0x24, 0xb2, 0x51, 0x01, 0x9a, 275 0x90, 0x92, 0x68, 0xe3, 0xb8, 0x13, 0xe1, 0x30, 0x71, 0x40, 0x42, 0xe9, 0xc4, 0x81, 0x03, 0x91, 276 0xd3, 0x78, 0x9e, 0xb5, 0xc6, 0xae, 0xf2, 0x79, 0x55, 0x79, 0x03, 0x8e, 0x3c, 0x06, 0xe2, 0xc4, 277 0x81, 0x13, 0x4f, 0xd0, 0x63, 0xc5, 0x89, 0x13, 0x42, 0xed, 0x81, 0xd7, 0x40, 0xd8, 0x29, 0x0d, 278 0xa8, 0x51, 0x0f, 0xbb, 0x24, 0xb1, 0xfd, 0xfb, 0xff, 0xbf, 0xcf, 0xff, 0xd8, 0xf8, 0xd1, 0x40, 279 0x41, 0xa1, 0x20, 0x82, 0x21, 0x85, 0x0b, 0x21, 0x79, 0x34, 0x3e, 0xca, 0x98, 0xa6, 0x47, 0x11, 280 0x67, 0x92, 0x81, 0x80, 0x70, 0x54, 0x2a, 0xad, 0xc8, 0x5d, 0x8b, 0x85, 0x4b, 0x2c, 0xac, 0xb0, 281 0xbd, 0x2e, 0x57, 0x5c, 0x19, 0x26, 0xfa, 0xf3, 0x65, 0xf1, 0xbd, 0xc7, 0x4d, 0xae, 0x7f, 0xf5, 282 0x96, 0xbb, 0x67, 0xb9, 0xd4, 0x1a, 0x54, 0x35, 0xec, 0xd2, 0x6d, 0x5a, 0x08, 0xa9, 0x22, 0xf3, 283 0xb4, 0x53, 0xbd, 0xf7, 0x2d, 0xbc, 0x7d, 0x6a, 0xdb, 0xea, 0x6b, 0xaa, 0x19, 0x89, 0x71, 0x67, 284 0x44, 0x4b, 0x5a, 0x80, 0x87, 0x0e, 0xd0, 0xa1, 0x7b, 0xbc, 0x1f, 0x36, 0xb4, 0x19, 0xbe, 0x32, 285 0x58, 0xbc, 0x35, 0xfd, 0xb1, 0xef, 0x7c, 0xfc, 0xf5, 0xf9, 0x09, 0x4a, 0x2a, 0x25, 0x39, 0xc3, 286 0x3b, 0x20, 0xb8, 0x14, 0x92, 0xa7, 0x42, 0x9e, 0x2b, 0xf0, 0x5a, 0x07, 0xed, 0x43, 0xf7, 0xf8, 287 0x61, 0xa3, 0x55, 0xdf, 0xd2, 0x2f, 0xe4, 0xb9, 0xaa, 0xfb, 0x6d, 0xc3, 0x6a, 0x1e, 0xc8, 0x5b, 288 0xbc, 0x53, 0x08, 0x00, 0x96, 0xa7, 0xd9, 0x50, 0x0d, 0x2e, 0xc1, 0x6b, 0x1b, 0xd7, 0xb0, 0xd1, 289 0xf5, 0x35, 0x1d, 0x8a, 0x9c, 0x6a, 0x55, 0xbe, 0x34, 0xb2, 0xd8, 0xa8, 0xfe, 0xf1, 0x2f, 0x6a, 290 0x0b, 0xbd, 0xaf, 0x08, 0xbb, 0xb5, 0x46, 0xc8, 0x09, 0xbe, 0x49, 0xf3, 0xbc, 0x64, 0x60, 0xa3, 291 0xd8, 0x8a, 0x1f, 0x7c, 0xfb, 0x12, 0xdc, 0xaf, 0x8a, 0x3d, 0x57, 0x12, 0x98, 0x84, 0x2b, 0x78, 292 0x66, 0x91, 0xbe, 0x2e, 0x85, 0xe4, 0xc9, 0x52, 0x41, 0x24, 0xde, 0x1d, 0x2f, 0xcb, 0xa7, 0xf5, 293 0x30, 0xbc, 0x96, 0x89, 0x35, 0xd8, 0xdc, 0x75, 0x43, 0x28, 0xdd, 0xf1, 0x1a, 0xa0, 0xf7, 0x09, 294 0xe1, 0x3b, 0x6b, 0xf7, 0x7b, 0xbd, 0x6d, 0x9c, 0xfd, 0x9f, 0xf9, 0xa6, 0x3f, 0x59, 0x2b, 0xdd, 295 0x9c, 0xf4, 0x09, 0x76, 0x6b, 0x1c, 0xe9, 0xe2, 0x1b, 0x42, 0xe6, 0x6c, 0x62, 0xfa, 0x6b, 0x27, 296 0x76, 0x40, 0x76, 0x71, 0xc7, 0x8a, 0x4c, 0x62, 0xb7, 0x92, 0x6a, 0x14, 0x9f, 0x4e, 0xe7, 0x3e, 297 0x9a, 0xcd, 0x7d, 0xf4, 0x73, 0xee, 0xa3, 0x0f, 0x0b, 0xdf, 0x99, 0x2d, 0x7c, 0xe7, 0xfb, 0xc2, 298 0x77, 0xde, 0x04, 0x5c, 0xe8, 0x8b, 0xab, 0x2c, 0x1c, 0xa8, 0xa2, 0x3a, 0xf7, 0xd5, 0x2b, 0x80, 299 0xfc, 0x32, 0x9a, 0xac, 0x6e, 0x8e, 0x7e, 0x37, 0x62, 0x90, 0x75, 0xcc, 0x0d, 0x78, 0xfa, 0x3b, 300 0x00, 0x00, 0xff, 0xff, 0xc1, 0xf1, 0x72, 0x89, 0xaf, 0x03, 0x00, 0x00, 301 } 302 303 func (m *GenesisState) Marshal() (dAtA []byte, err error) { 304 size := m.Size() 305 dAtA = make([]byte, size) 306 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 307 if err != nil { 308 return nil, err 309 } 310 return dAtA[:n], nil 311 } 312 313 func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { 314 size := m.Size() 315 return m.MarshalToSizedBuffer(dAtA[:size]) 316 } 317 318 func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { 319 i := len(dAtA) 320 _ = i 321 var l int 322 _ = l 323 if len(m.MissedBlocks) > 0 { 324 for iNdEx := len(m.MissedBlocks) - 1; iNdEx >= 0; iNdEx-- { 325 { 326 size, err := m.MissedBlocks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 327 if err != nil { 328 return 0, err 329 } 330 i -= size 331 i = encodeVarintGenesis(dAtA, i, uint64(size)) 332 } 333 i-- 334 dAtA[i] = 0x1a 335 } 336 } 337 if len(m.SigningInfos) > 0 { 338 for iNdEx := len(m.SigningInfos) - 1; iNdEx >= 0; iNdEx-- { 339 { 340 size, err := m.SigningInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 341 if err != nil { 342 return 0, err 343 } 344 i -= size 345 i = encodeVarintGenesis(dAtA, i, uint64(size)) 346 } 347 i-- 348 dAtA[i] = 0x12 349 } 350 } 351 { 352 size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) 353 if err != nil { 354 return 0, err 355 } 356 i -= size 357 i = encodeVarintGenesis(dAtA, i, uint64(size)) 358 } 359 i-- 360 dAtA[i] = 0xa 361 return len(dAtA) - i, nil 362 } 363 364 func (m *SigningInfo) Marshal() (dAtA []byte, err error) { 365 size := m.Size() 366 dAtA = make([]byte, size) 367 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 368 if err != nil { 369 return nil, err 370 } 371 return dAtA[:n], nil 372 } 373 374 func (m *SigningInfo) MarshalTo(dAtA []byte) (int, error) { 375 size := m.Size() 376 return m.MarshalToSizedBuffer(dAtA[:size]) 377 } 378 379 func (m *SigningInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { 380 i := len(dAtA) 381 _ = i 382 var l int 383 _ = l 384 { 385 size, err := m.ValidatorSigningInfo.MarshalToSizedBuffer(dAtA[:i]) 386 if err != nil { 387 return 0, err 388 } 389 i -= size 390 i = encodeVarintGenesis(dAtA, i, uint64(size)) 391 } 392 i-- 393 dAtA[i] = 0x12 394 if len(m.Address) > 0 { 395 i -= len(m.Address) 396 copy(dAtA[i:], m.Address) 397 i = encodeVarintGenesis(dAtA, i, uint64(len(m.Address))) 398 i-- 399 dAtA[i] = 0xa 400 } 401 return len(dAtA) - i, nil 402 } 403 404 func (m *ValidatorMissedBlocks) Marshal() (dAtA []byte, err error) { 405 size := m.Size() 406 dAtA = make([]byte, size) 407 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 408 if err != nil { 409 return nil, err 410 } 411 return dAtA[:n], nil 412 } 413 414 func (m *ValidatorMissedBlocks) MarshalTo(dAtA []byte) (int, error) { 415 size := m.Size() 416 return m.MarshalToSizedBuffer(dAtA[:size]) 417 } 418 419 func (m *ValidatorMissedBlocks) MarshalToSizedBuffer(dAtA []byte) (int, error) { 420 i := len(dAtA) 421 _ = i 422 var l int 423 _ = l 424 if len(m.MissedBlocks) > 0 { 425 for iNdEx := len(m.MissedBlocks) - 1; iNdEx >= 0; iNdEx-- { 426 { 427 size, err := m.MissedBlocks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 428 if err != nil { 429 return 0, err 430 } 431 i -= size 432 i = encodeVarintGenesis(dAtA, i, uint64(size)) 433 } 434 i-- 435 dAtA[i] = 0x12 436 } 437 } 438 if len(m.Address) > 0 { 439 i -= len(m.Address) 440 copy(dAtA[i:], m.Address) 441 i = encodeVarintGenesis(dAtA, i, uint64(len(m.Address))) 442 i-- 443 dAtA[i] = 0xa 444 } 445 return len(dAtA) - i, nil 446 } 447 448 func (m *MissedBlock) Marshal() (dAtA []byte, err error) { 449 size := m.Size() 450 dAtA = make([]byte, size) 451 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 452 if err != nil { 453 return nil, err 454 } 455 return dAtA[:n], nil 456 } 457 458 func (m *MissedBlock) MarshalTo(dAtA []byte) (int, error) { 459 size := m.Size() 460 return m.MarshalToSizedBuffer(dAtA[:size]) 461 } 462 463 func (m *MissedBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { 464 i := len(dAtA) 465 _ = i 466 var l int 467 _ = l 468 if m.Missed { 469 i-- 470 if m.Missed { 471 dAtA[i] = 1 472 } else { 473 dAtA[i] = 0 474 } 475 i-- 476 dAtA[i] = 0x10 477 } 478 if m.Index != 0 { 479 i = encodeVarintGenesis(dAtA, i, uint64(m.Index)) 480 i-- 481 dAtA[i] = 0x8 482 } 483 return len(dAtA) - i, nil 484 } 485 486 func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { 487 offset -= sovGenesis(v) 488 base := offset 489 for v >= 1<<7 { 490 dAtA[offset] = uint8(v&0x7f | 0x80) 491 v >>= 7 492 offset++ 493 } 494 dAtA[offset] = uint8(v) 495 return base 496 } 497 func (m *GenesisState) Size() (n int) { 498 if m == nil { 499 return 0 500 } 501 var l int 502 _ = l 503 l = m.Params.Size() 504 n += 1 + l + sovGenesis(uint64(l)) 505 if len(m.SigningInfos) > 0 { 506 for _, e := range m.SigningInfos { 507 l = e.Size() 508 n += 1 + l + sovGenesis(uint64(l)) 509 } 510 } 511 if len(m.MissedBlocks) > 0 { 512 for _, e := range m.MissedBlocks { 513 l = e.Size() 514 n += 1 + l + sovGenesis(uint64(l)) 515 } 516 } 517 return n 518 } 519 520 func (m *SigningInfo) Size() (n int) { 521 if m == nil { 522 return 0 523 } 524 var l int 525 _ = l 526 l = len(m.Address) 527 if l > 0 { 528 n += 1 + l + sovGenesis(uint64(l)) 529 } 530 l = m.ValidatorSigningInfo.Size() 531 n += 1 + l + sovGenesis(uint64(l)) 532 return n 533 } 534 535 func (m *ValidatorMissedBlocks) Size() (n int) { 536 if m == nil { 537 return 0 538 } 539 var l int 540 _ = l 541 l = len(m.Address) 542 if l > 0 { 543 n += 1 + l + sovGenesis(uint64(l)) 544 } 545 if len(m.MissedBlocks) > 0 { 546 for _, e := range m.MissedBlocks { 547 l = e.Size() 548 n += 1 + l + sovGenesis(uint64(l)) 549 } 550 } 551 return n 552 } 553 554 func (m *MissedBlock) Size() (n int) { 555 if m == nil { 556 return 0 557 } 558 var l int 559 _ = l 560 if m.Index != 0 { 561 n += 1 + sovGenesis(uint64(m.Index)) 562 } 563 if m.Missed { 564 n += 2 565 } 566 return n 567 } 568 569 func sovGenesis(x uint64) (n int) { 570 return (math_bits.Len64(x|1) + 6) / 7 571 } 572 func sozGenesis(x uint64) (n int) { 573 return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 574 } 575 func (m *GenesisState) Unmarshal(dAtA []byte) error { 576 l := len(dAtA) 577 iNdEx := 0 578 for iNdEx < l { 579 preIndex := iNdEx 580 var wire uint64 581 for shift := uint(0); ; shift += 7 { 582 if shift >= 64 { 583 return ErrIntOverflowGenesis 584 } 585 if iNdEx >= l { 586 return io.ErrUnexpectedEOF 587 } 588 b := dAtA[iNdEx] 589 iNdEx++ 590 wire |= uint64(b&0x7F) << shift 591 if b < 0x80 { 592 break 593 } 594 } 595 fieldNum := int32(wire >> 3) 596 wireType := int(wire & 0x7) 597 if wireType == 4 { 598 return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") 599 } 600 if fieldNum <= 0 { 601 return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) 602 } 603 switch fieldNum { 604 case 1: 605 if wireType != 2 { 606 return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) 607 } 608 var msglen int 609 for shift := uint(0); ; shift += 7 { 610 if shift >= 64 { 611 return ErrIntOverflowGenesis 612 } 613 if iNdEx >= l { 614 return io.ErrUnexpectedEOF 615 } 616 b := dAtA[iNdEx] 617 iNdEx++ 618 msglen |= int(b&0x7F) << shift 619 if b < 0x80 { 620 break 621 } 622 } 623 if msglen < 0 { 624 return ErrInvalidLengthGenesis 625 } 626 postIndex := iNdEx + msglen 627 if postIndex < 0 { 628 return ErrInvalidLengthGenesis 629 } 630 if postIndex > l { 631 return io.ErrUnexpectedEOF 632 } 633 if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 634 return err 635 } 636 iNdEx = postIndex 637 case 2: 638 if wireType != 2 { 639 return fmt.Errorf("proto: wrong wireType = %d for field SigningInfos", wireType) 640 } 641 var msglen int 642 for shift := uint(0); ; shift += 7 { 643 if shift >= 64 { 644 return ErrIntOverflowGenesis 645 } 646 if iNdEx >= l { 647 return io.ErrUnexpectedEOF 648 } 649 b := dAtA[iNdEx] 650 iNdEx++ 651 msglen |= int(b&0x7F) << shift 652 if b < 0x80 { 653 break 654 } 655 } 656 if msglen < 0 { 657 return ErrInvalidLengthGenesis 658 } 659 postIndex := iNdEx + msglen 660 if postIndex < 0 { 661 return ErrInvalidLengthGenesis 662 } 663 if postIndex > l { 664 return io.ErrUnexpectedEOF 665 } 666 m.SigningInfos = append(m.SigningInfos, SigningInfo{}) 667 if err := m.SigningInfos[len(m.SigningInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 668 return err 669 } 670 iNdEx = postIndex 671 case 3: 672 if wireType != 2 { 673 return fmt.Errorf("proto: wrong wireType = %d for field MissedBlocks", wireType) 674 } 675 var msglen int 676 for shift := uint(0); ; shift += 7 { 677 if shift >= 64 { 678 return ErrIntOverflowGenesis 679 } 680 if iNdEx >= l { 681 return io.ErrUnexpectedEOF 682 } 683 b := dAtA[iNdEx] 684 iNdEx++ 685 msglen |= int(b&0x7F) << shift 686 if b < 0x80 { 687 break 688 } 689 } 690 if msglen < 0 { 691 return ErrInvalidLengthGenesis 692 } 693 postIndex := iNdEx + msglen 694 if postIndex < 0 { 695 return ErrInvalidLengthGenesis 696 } 697 if postIndex > l { 698 return io.ErrUnexpectedEOF 699 } 700 m.MissedBlocks = append(m.MissedBlocks, ValidatorMissedBlocks{}) 701 if err := m.MissedBlocks[len(m.MissedBlocks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 702 return err 703 } 704 iNdEx = postIndex 705 default: 706 iNdEx = preIndex 707 skippy, err := skipGenesis(dAtA[iNdEx:]) 708 if err != nil { 709 return err 710 } 711 if (skippy < 0) || (iNdEx+skippy) < 0 { 712 return ErrInvalidLengthGenesis 713 } 714 if (iNdEx + skippy) > l { 715 return io.ErrUnexpectedEOF 716 } 717 iNdEx += skippy 718 } 719 } 720 721 if iNdEx > l { 722 return io.ErrUnexpectedEOF 723 } 724 return nil 725 } 726 func (m *SigningInfo) Unmarshal(dAtA []byte) error { 727 l := len(dAtA) 728 iNdEx := 0 729 for iNdEx < l { 730 preIndex := iNdEx 731 var wire uint64 732 for shift := uint(0); ; shift += 7 { 733 if shift >= 64 { 734 return ErrIntOverflowGenesis 735 } 736 if iNdEx >= l { 737 return io.ErrUnexpectedEOF 738 } 739 b := dAtA[iNdEx] 740 iNdEx++ 741 wire |= uint64(b&0x7F) << shift 742 if b < 0x80 { 743 break 744 } 745 } 746 fieldNum := int32(wire >> 3) 747 wireType := int(wire & 0x7) 748 if wireType == 4 { 749 return fmt.Errorf("proto: SigningInfo: wiretype end group for non-group") 750 } 751 if fieldNum <= 0 { 752 return fmt.Errorf("proto: SigningInfo: illegal tag %d (wire type %d)", fieldNum, wire) 753 } 754 switch fieldNum { 755 case 1: 756 if wireType != 2 { 757 return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) 758 } 759 var stringLen uint64 760 for shift := uint(0); ; shift += 7 { 761 if shift >= 64 { 762 return ErrIntOverflowGenesis 763 } 764 if iNdEx >= l { 765 return io.ErrUnexpectedEOF 766 } 767 b := dAtA[iNdEx] 768 iNdEx++ 769 stringLen |= uint64(b&0x7F) << shift 770 if b < 0x80 { 771 break 772 } 773 } 774 intStringLen := int(stringLen) 775 if intStringLen < 0 { 776 return ErrInvalidLengthGenesis 777 } 778 postIndex := iNdEx + intStringLen 779 if postIndex < 0 { 780 return ErrInvalidLengthGenesis 781 } 782 if postIndex > l { 783 return io.ErrUnexpectedEOF 784 } 785 m.Address = string(dAtA[iNdEx:postIndex]) 786 iNdEx = postIndex 787 case 2: 788 if wireType != 2 { 789 return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSigningInfo", wireType) 790 } 791 var msglen int 792 for shift := uint(0); ; shift += 7 { 793 if shift >= 64 { 794 return ErrIntOverflowGenesis 795 } 796 if iNdEx >= l { 797 return io.ErrUnexpectedEOF 798 } 799 b := dAtA[iNdEx] 800 iNdEx++ 801 msglen |= int(b&0x7F) << shift 802 if b < 0x80 { 803 break 804 } 805 } 806 if msglen < 0 { 807 return ErrInvalidLengthGenesis 808 } 809 postIndex := iNdEx + msglen 810 if postIndex < 0 { 811 return ErrInvalidLengthGenesis 812 } 813 if postIndex > l { 814 return io.ErrUnexpectedEOF 815 } 816 if err := m.ValidatorSigningInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 817 return err 818 } 819 iNdEx = postIndex 820 default: 821 iNdEx = preIndex 822 skippy, err := skipGenesis(dAtA[iNdEx:]) 823 if err != nil { 824 return err 825 } 826 if (skippy < 0) || (iNdEx+skippy) < 0 { 827 return ErrInvalidLengthGenesis 828 } 829 if (iNdEx + skippy) > l { 830 return io.ErrUnexpectedEOF 831 } 832 iNdEx += skippy 833 } 834 } 835 836 if iNdEx > l { 837 return io.ErrUnexpectedEOF 838 } 839 return nil 840 } 841 func (m *ValidatorMissedBlocks) Unmarshal(dAtA []byte) error { 842 l := len(dAtA) 843 iNdEx := 0 844 for iNdEx < l { 845 preIndex := iNdEx 846 var wire uint64 847 for shift := uint(0); ; shift += 7 { 848 if shift >= 64 { 849 return ErrIntOverflowGenesis 850 } 851 if iNdEx >= l { 852 return io.ErrUnexpectedEOF 853 } 854 b := dAtA[iNdEx] 855 iNdEx++ 856 wire |= uint64(b&0x7F) << shift 857 if b < 0x80 { 858 break 859 } 860 } 861 fieldNum := int32(wire >> 3) 862 wireType := int(wire & 0x7) 863 if wireType == 4 { 864 return fmt.Errorf("proto: ValidatorMissedBlocks: wiretype end group for non-group") 865 } 866 if fieldNum <= 0 { 867 return fmt.Errorf("proto: ValidatorMissedBlocks: illegal tag %d (wire type %d)", fieldNum, wire) 868 } 869 switch fieldNum { 870 case 1: 871 if wireType != 2 { 872 return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) 873 } 874 var stringLen uint64 875 for shift := uint(0); ; shift += 7 { 876 if shift >= 64 { 877 return ErrIntOverflowGenesis 878 } 879 if iNdEx >= l { 880 return io.ErrUnexpectedEOF 881 } 882 b := dAtA[iNdEx] 883 iNdEx++ 884 stringLen |= uint64(b&0x7F) << shift 885 if b < 0x80 { 886 break 887 } 888 } 889 intStringLen := int(stringLen) 890 if intStringLen < 0 { 891 return ErrInvalidLengthGenesis 892 } 893 postIndex := iNdEx + intStringLen 894 if postIndex < 0 { 895 return ErrInvalidLengthGenesis 896 } 897 if postIndex > l { 898 return io.ErrUnexpectedEOF 899 } 900 m.Address = string(dAtA[iNdEx:postIndex]) 901 iNdEx = postIndex 902 case 2: 903 if wireType != 2 { 904 return fmt.Errorf("proto: wrong wireType = %d for field MissedBlocks", wireType) 905 } 906 var msglen int 907 for shift := uint(0); ; shift += 7 { 908 if shift >= 64 { 909 return ErrIntOverflowGenesis 910 } 911 if iNdEx >= l { 912 return io.ErrUnexpectedEOF 913 } 914 b := dAtA[iNdEx] 915 iNdEx++ 916 msglen |= int(b&0x7F) << shift 917 if b < 0x80 { 918 break 919 } 920 } 921 if msglen < 0 { 922 return ErrInvalidLengthGenesis 923 } 924 postIndex := iNdEx + msglen 925 if postIndex < 0 { 926 return ErrInvalidLengthGenesis 927 } 928 if postIndex > l { 929 return io.ErrUnexpectedEOF 930 } 931 m.MissedBlocks = append(m.MissedBlocks, MissedBlock{}) 932 if err := m.MissedBlocks[len(m.MissedBlocks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 933 return err 934 } 935 iNdEx = postIndex 936 default: 937 iNdEx = preIndex 938 skippy, err := skipGenesis(dAtA[iNdEx:]) 939 if err != nil { 940 return err 941 } 942 if (skippy < 0) || (iNdEx+skippy) < 0 { 943 return ErrInvalidLengthGenesis 944 } 945 if (iNdEx + skippy) > l { 946 return io.ErrUnexpectedEOF 947 } 948 iNdEx += skippy 949 } 950 } 951 952 if iNdEx > l { 953 return io.ErrUnexpectedEOF 954 } 955 return nil 956 } 957 func (m *MissedBlock) Unmarshal(dAtA []byte) error { 958 l := len(dAtA) 959 iNdEx := 0 960 for iNdEx < l { 961 preIndex := iNdEx 962 var wire uint64 963 for shift := uint(0); ; shift += 7 { 964 if shift >= 64 { 965 return ErrIntOverflowGenesis 966 } 967 if iNdEx >= l { 968 return io.ErrUnexpectedEOF 969 } 970 b := dAtA[iNdEx] 971 iNdEx++ 972 wire |= uint64(b&0x7F) << shift 973 if b < 0x80 { 974 break 975 } 976 } 977 fieldNum := int32(wire >> 3) 978 wireType := int(wire & 0x7) 979 if wireType == 4 { 980 return fmt.Errorf("proto: MissedBlock: wiretype end group for non-group") 981 } 982 if fieldNum <= 0 { 983 return fmt.Errorf("proto: MissedBlock: illegal tag %d (wire type %d)", fieldNum, wire) 984 } 985 switch fieldNum { 986 case 1: 987 if wireType != 0 { 988 return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) 989 } 990 m.Index = 0 991 for shift := uint(0); ; shift += 7 { 992 if shift >= 64 { 993 return ErrIntOverflowGenesis 994 } 995 if iNdEx >= l { 996 return io.ErrUnexpectedEOF 997 } 998 b := dAtA[iNdEx] 999 iNdEx++ 1000 m.Index |= int64(b&0x7F) << shift 1001 if b < 0x80 { 1002 break 1003 } 1004 } 1005 case 2: 1006 if wireType != 0 { 1007 return fmt.Errorf("proto: wrong wireType = %d for field Missed", wireType) 1008 } 1009 var v int 1010 for shift := uint(0); ; shift += 7 { 1011 if shift >= 64 { 1012 return ErrIntOverflowGenesis 1013 } 1014 if iNdEx >= l { 1015 return io.ErrUnexpectedEOF 1016 } 1017 b := dAtA[iNdEx] 1018 iNdEx++ 1019 v |= int(b&0x7F) << shift 1020 if b < 0x80 { 1021 break 1022 } 1023 } 1024 m.Missed = bool(v != 0) 1025 default: 1026 iNdEx = preIndex 1027 skippy, err := skipGenesis(dAtA[iNdEx:]) 1028 if err != nil { 1029 return err 1030 } 1031 if (skippy < 0) || (iNdEx+skippy) < 0 { 1032 return ErrInvalidLengthGenesis 1033 } 1034 if (iNdEx + skippy) > l { 1035 return io.ErrUnexpectedEOF 1036 } 1037 iNdEx += skippy 1038 } 1039 } 1040 1041 if iNdEx > l { 1042 return io.ErrUnexpectedEOF 1043 } 1044 return nil 1045 } 1046 func skipGenesis(dAtA []byte) (n int, err error) { 1047 l := len(dAtA) 1048 iNdEx := 0 1049 depth := 0 1050 for iNdEx < l { 1051 var wire uint64 1052 for shift := uint(0); ; shift += 7 { 1053 if shift >= 64 { 1054 return 0, ErrIntOverflowGenesis 1055 } 1056 if iNdEx >= l { 1057 return 0, io.ErrUnexpectedEOF 1058 } 1059 b := dAtA[iNdEx] 1060 iNdEx++ 1061 wire |= (uint64(b) & 0x7F) << shift 1062 if b < 0x80 { 1063 break 1064 } 1065 } 1066 wireType := int(wire & 0x7) 1067 switch wireType { 1068 case 0: 1069 for shift := uint(0); ; shift += 7 { 1070 if shift >= 64 { 1071 return 0, ErrIntOverflowGenesis 1072 } 1073 if iNdEx >= l { 1074 return 0, io.ErrUnexpectedEOF 1075 } 1076 iNdEx++ 1077 if dAtA[iNdEx-1] < 0x80 { 1078 break 1079 } 1080 } 1081 case 1: 1082 iNdEx += 8 1083 case 2: 1084 var length int 1085 for shift := uint(0); ; shift += 7 { 1086 if shift >= 64 { 1087 return 0, ErrIntOverflowGenesis 1088 } 1089 if iNdEx >= l { 1090 return 0, io.ErrUnexpectedEOF 1091 } 1092 b := dAtA[iNdEx] 1093 iNdEx++ 1094 length |= (int(b) & 0x7F) << shift 1095 if b < 0x80 { 1096 break 1097 } 1098 } 1099 if length < 0 { 1100 return 0, ErrInvalidLengthGenesis 1101 } 1102 iNdEx += length 1103 case 3: 1104 depth++ 1105 case 4: 1106 if depth == 0 { 1107 return 0, ErrUnexpectedEndOfGroupGenesis 1108 } 1109 depth-- 1110 case 5: 1111 iNdEx += 4 1112 default: 1113 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1114 } 1115 if iNdEx < 0 { 1116 return 0, ErrInvalidLengthGenesis 1117 } 1118 if depth == 0 { 1119 return iNdEx, nil 1120 } 1121 } 1122 return 0, io.ErrUnexpectedEOF 1123 } 1124 1125 var ( 1126 ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") 1127 ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") 1128 ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") 1129 )