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