github.com/cosmos/cosmos-sdk@v0.50.10/x/slashing/types/slashing.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: cosmos/slashing/v1beta1/slashing.proto 3 4 package types 5 6 import ( 7 cosmossdk_io_math "cosmossdk.io/math" 8 fmt "fmt" 9 _ "github.com/cosmos/cosmos-proto" 10 _ "github.com/cosmos/cosmos-sdk/types/tx/amino" 11 _ "github.com/cosmos/gogoproto/gogoproto" 12 proto "github.com/cosmos/gogoproto/proto" 13 github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" 14 _ "google.golang.org/protobuf/types/known/durationpb" 15 _ "google.golang.org/protobuf/types/known/timestamppb" 16 io "io" 17 math "math" 18 math_bits "math/bits" 19 time "time" 20 ) 21 22 // Reference imports to suppress errors if they are not otherwise used. 23 var _ = proto.Marshal 24 var _ = fmt.Errorf 25 var _ = math.Inf 26 var _ = time.Kitchen 27 28 // This is a compile-time assertion to ensure that this generated file 29 // is compatible with the proto package it is being compiled against. 30 // A compilation error at this line likely means your copy of the 31 // proto package needs to be updated. 32 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 33 34 // ValidatorSigningInfo defines a validator's signing info for monitoring their 35 // liveness activity. 36 type ValidatorSigningInfo struct { 37 Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` 38 // Height at which validator was first a candidate OR was un-jailed 39 StartHeight int64 `protobuf:"varint,2,opt,name=start_height,json=startHeight,proto3" json:"start_height,omitempty"` 40 // Index which is incremented every time a validator is bonded in a block and 41 // _may_ have signed a pre-commit or not. This in conjunction with the 42 // signed_blocks_window param determines the index in the missed block bitmap. 43 IndexOffset int64 `protobuf:"varint,3,opt,name=index_offset,json=indexOffset,proto3" json:"index_offset,omitempty"` 44 // Timestamp until which the validator is jailed due to liveness downtime. 45 JailedUntil time.Time `protobuf:"bytes,4,opt,name=jailed_until,json=jailedUntil,proto3,stdtime" json:"jailed_until"` 46 // Whether or not a validator has been tombstoned (killed out of validator 47 // set). It is set once the validator commits an equivocation or for any other 48 // configured misbehavior. 49 Tombstoned bool `protobuf:"varint,5,opt,name=tombstoned,proto3" json:"tombstoned,omitempty"` 50 // A counter of missed (unsigned) blocks. It is used to avoid unnecessary 51 // reads in the missed block bitmap. 52 MissedBlocksCounter int64 `protobuf:"varint,6,opt,name=missed_blocks_counter,json=missedBlocksCounter,proto3" json:"missed_blocks_counter,omitempty"` 53 } 54 55 func (m *ValidatorSigningInfo) Reset() { *m = ValidatorSigningInfo{} } 56 func (m *ValidatorSigningInfo) String() string { return proto.CompactTextString(m) } 57 func (*ValidatorSigningInfo) ProtoMessage() {} 58 func (*ValidatorSigningInfo) Descriptor() ([]byte, []int) { 59 return fileDescriptor_1078e5d96a74cc52, []int{0} 60 } 61 func (m *ValidatorSigningInfo) XXX_Unmarshal(b []byte) error { 62 return m.Unmarshal(b) 63 } 64 func (m *ValidatorSigningInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 65 if deterministic { 66 return xxx_messageInfo_ValidatorSigningInfo.Marshal(b, m, deterministic) 67 } else { 68 b = b[:cap(b)] 69 n, err := m.MarshalToSizedBuffer(b) 70 if err != nil { 71 return nil, err 72 } 73 return b[:n], nil 74 } 75 } 76 func (m *ValidatorSigningInfo) XXX_Merge(src proto.Message) { 77 xxx_messageInfo_ValidatorSigningInfo.Merge(m, src) 78 } 79 func (m *ValidatorSigningInfo) XXX_Size() int { 80 return m.Size() 81 } 82 func (m *ValidatorSigningInfo) XXX_DiscardUnknown() { 83 xxx_messageInfo_ValidatorSigningInfo.DiscardUnknown(m) 84 } 85 86 var xxx_messageInfo_ValidatorSigningInfo proto.InternalMessageInfo 87 88 func (m *ValidatorSigningInfo) GetAddress() string { 89 if m != nil { 90 return m.Address 91 } 92 return "" 93 } 94 95 func (m *ValidatorSigningInfo) GetStartHeight() int64 { 96 if m != nil { 97 return m.StartHeight 98 } 99 return 0 100 } 101 102 func (m *ValidatorSigningInfo) GetIndexOffset() int64 { 103 if m != nil { 104 return m.IndexOffset 105 } 106 return 0 107 } 108 109 func (m *ValidatorSigningInfo) GetJailedUntil() time.Time { 110 if m != nil { 111 return m.JailedUntil 112 } 113 return time.Time{} 114 } 115 116 func (m *ValidatorSigningInfo) GetTombstoned() bool { 117 if m != nil { 118 return m.Tombstoned 119 } 120 return false 121 } 122 123 func (m *ValidatorSigningInfo) GetMissedBlocksCounter() int64 { 124 if m != nil { 125 return m.MissedBlocksCounter 126 } 127 return 0 128 } 129 130 // Params represents the parameters used for by the slashing module. 131 type Params struct { 132 SignedBlocksWindow int64 `protobuf:"varint,1,opt,name=signed_blocks_window,json=signedBlocksWindow,proto3" json:"signed_blocks_window,omitempty"` 133 MinSignedPerWindow cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=min_signed_per_window,json=minSignedPerWindow,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_signed_per_window"` 134 DowntimeJailDuration time.Duration `protobuf:"bytes,3,opt,name=downtime_jail_duration,json=downtimeJailDuration,proto3,stdduration" json:"downtime_jail_duration"` 135 SlashFractionDoubleSign cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=slash_fraction_double_sign,json=slashFractionDoubleSign,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slash_fraction_double_sign"` 136 SlashFractionDowntime cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=slash_fraction_downtime,json=slashFractionDowntime,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slash_fraction_downtime"` 137 } 138 139 func (m *Params) Reset() { *m = Params{} } 140 func (m *Params) String() string { return proto.CompactTextString(m) } 141 func (*Params) ProtoMessage() {} 142 func (*Params) Descriptor() ([]byte, []int) { 143 return fileDescriptor_1078e5d96a74cc52, []int{1} 144 } 145 func (m *Params) XXX_Unmarshal(b []byte) error { 146 return m.Unmarshal(b) 147 } 148 func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 149 if deterministic { 150 return xxx_messageInfo_Params.Marshal(b, m, deterministic) 151 } else { 152 b = b[:cap(b)] 153 n, err := m.MarshalToSizedBuffer(b) 154 if err != nil { 155 return nil, err 156 } 157 return b[:n], nil 158 } 159 } 160 func (m *Params) XXX_Merge(src proto.Message) { 161 xxx_messageInfo_Params.Merge(m, src) 162 } 163 func (m *Params) XXX_Size() int { 164 return m.Size() 165 } 166 func (m *Params) XXX_DiscardUnknown() { 167 xxx_messageInfo_Params.DiscardUnknown(m) 168 } 169 170 var xxx_messageInfo_Params proto.InternalMessageInfo 171 172 func (m *Params) GetSignedBlocksWindow() int64 { 173 if m != nil { 174 return m.SignedBlocksWindow 175 } 176 return 0 177 } 178 179 func (m *Params) GetDowntimeJailDuration() time.Duration { 180 if m != nil { 181 return m.DowntimeJailDuration 182 } 183 return 0 184 } 185 186 func init() { 187 proto.RegisterType((*ValidatorSigningInfo)(nil), "cosmos.slashing.v1beta1.ValidatorSigningInfo") 188 proto.RegisterType((*Params)(nil), "cosmos.slashing.v1beta1.Params") 189 } 190 191 func init() { 192 proto.RegisterFile("cosmos/slashing/v1beta1/slashing.proto", fileDescriptor_1078e5d96a74cc52) 193 } 194 195 var fileDescriptor_1078e5d96a74cc52 = []byte{ 196 // 634 bytes of a gzipped FileDescriptorProto 197 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcf, 0x4f, 0x13, 0x41, 198 0x14, 0xee, 0x00, 0xa2, 0x4e, 0xf1, 0xe0, 0x58, 0xa4, 0x54, 0xdd, 0x16, 0x0e, 0xa6, 0x21, 0xe9, 199 0xae, 0x60, 0xe2, 0x01, 0x4f, 0x96, 0xc6, 0xf8, 0x83, 0x44, 0x52, 0xfc, 0x91, 0x78, 0x70, 0x33, 200 0xbb, 0x33, 0x9d, 0x8e, 0xec, 0xce, 0x34, 0x3b, 0xb3, 0x02, 0xff, 0x82, 0x89, 0x09, 0x47, 0x8f, 201 0x1e, 0x39, 0x72, 0xe0, 0x1f, 0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0xf5, 0x75, 0x75, 0xac, 0x01, 0x9a, 0xe3, 0xdd, 213 0xb2, 0xc1, 0x9e, 0x19, 0x28, 0x93, 0x70, 0x41, 0xe8, 0x96, 0x2f, 0x7b, 0x3d, 0x45, 0x75, 0x75, 214 0xdc, 0x4a, 0x0c, 0xf6, 0xca, 0x40, 0x68, 0x15, 0x4e, 0x7d, 0xc4, 0x3c, 0xa2, 0xc4, 0x4f, 0x85, 215 0xe6, 0x51, 0x75, 0xa2, 0x01, 0x9a, 0xe5, 0xa5, 0x9a, 0x6b, 0x13, 0x70, 0x8b, 0x04, 0xdc, 0xd7, 216 0x45, 0x02, 0xed, 0x1b, 0x07, 0xc7, 0xf5, 0xd2, 0xce, 0xaf, 0x3a, 0xd8, 0x3d, 0xdd, 0x5b, 0x00, 217 0xdd, 0xb2, 0x2d, 0x7f, 0x93, 0x55, 0x23, 0x07, 0x42, 0x2d, 0xe3, 0x40, 0x69, 0x29, 0x28, 0xa9, 218 0x5e, 0x69, 0x80, 0xe6, 0xb5, 0xee, 0x3f, 0x08, 0x5a, 0x82, 0xd3, 0x31, 0x57, 0x8a, 0x12, 0x3f, 219 0x88, 0x64, 0xb8, 0xa1, 0xfc, 0x50, 0xa6, 0x42, 0xd3, 0xa4, 0x3a, 0x69, 0x9e, 0xec, 0x96, 0x25, 220 0xdb, 0x86, 0x5b, 0xb1, 0xd4, 0xf2, 0xc4, 0x9f, 0x6f, 0x75, 0x30, 0xff, 0x65, 0x02, 0x4e, 0xae, 221 0xe1, 0x04, 0xc7, 0x0a, 0x3d, 0x80, 0x15, 0xc5, 0x99, 0x38, 0x33, 0xd9, 0xe4, 0x82, 0xc8, 0x4d, 222 0x13, 0xe1, 0x78, 0x17, 0x59, 0xce, 0x7a, 0xbc, 0x33, 0x0c, 0xe2, 0x59, 0x5b, 0xe1, 0xe7, 0x55, 223 0x03, 0x9a, 0x14, 0x25, 0x59, 0x66, 0x53, 0xed, 0x47, 0xd9, 0x44, 0x3f, 0x8f, 0x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x7a, 0xff, 0x77, 0xd3, 0xdb, 0x03, 0xaa, 0x82, 0x49, 0xb3, 0x8c, 0x87, 0x7f, 0x03, 0x00, 0x00, 236 0xff, 0xff, 0xec, 0x7c, 0x0b, 0xf0, 0x6f, 0x04, 0x00, 0x00, 237 } 238 239 func (this *ValidatorSigningInfo) Equal(that interface{}) bool { 240 if that == nil { 241 return this == nil 242 } 243 244 that1, ok := that.(*ValidatorSigningInfo) 245 if !ok { 246 that2, ok := that.(ValidatorSigningInfo) 247 if ok { 248 that1 = &that2 249 } else { 250 return false 251 } 252 } 253 if that1 == nil { 254 return this == nil 255 } else if this == nil { 256 return false 257 } 258 if this.Address != that1.Address { 259 return false 260 } 261 if this.StartHeight != that1.StartHeight { 262 return false 263 } 264 if this.IndexOffset != that1.IndexOffset { 265 return false 266 } 267 if !this.JailedUntil.Equal(that1.JailedUntil) { 268 return false 269 } 270 if this.Tombstoned != that1.Tombstoned { 271 return false 272 } 273 if this.MissedBlocksCounter != that1.MissedBlocksCounter { 274 return false 275 } 276 return true 277 } 278 func (this *Params) Equal(that interface{}) bool { 279 if that == nil { 280 return this == nil 281 } 282 283 that1, ok := that.(*Params) 284 if !ok { 285 that2, ok := that.(Params) 286 if ok { 287 that1 = &that2 288 } else { 289 return false 290 } 291 } 292 if that1 == nil { 293 return this == nil 294 } else if this == nil { 295 return false 296 } 297 if this.SignedBlocksWindow != that1.SignedBlocksWindow { 298 return false 299 } 300 if !this.MinSignedPerWindow.Equal(that1.MinSignedPerWindow) { 301 return false 302 } 303 if this.DowntimeJailDuration != that1.DowntimeJailDuration { 304 return false 305 } 306 if !this.SlashFractionDoubleSign.Equal(that1.SlashFractionDoubleSign) { 307 return false 308 } 309 if !this.SlashFractionDowntime.Equal(that1.SlashFractionDowntime) { 310 return false 311 } 312 return true 313 } 314 func (m *ValidatorSigningInfo) Marshal() (dAtA []byte, err error) { 315 size := m.Size() 316 dAtA = make([]byte, size) 317 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 318 if err != nil { 319 return nil, err 320 } 321 return dAtA[:n], nil 322 } 323 324 func (m *ValidatorSigningInfo) MarshalTo(dAtA []byte) (int, error) { 325 size := m.Size() 326 return m.MarshalToSizedBuffer(dAtA[:size]) 327 } 328 329 func (m *ValidatorSigningInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { 330 i := len(dAtA) 331 _ = i 332 var l int 333 _ = l 334 if m.MissedBlocksCounter != 0 { 335 i = encodeVarintSlashing(dAtA, i, uint64(m.MissedBlocksCounter)) 336 i-- 337 dAtA[i] = 0x30 338 } 339 if m.Tombstoned { 340 i-- 341 if m.Tombstoned { 342 dAtA[i] = 1 343 } else { 344 dAtA[i] = 0 345 } 346 i-- 347 dAtA[i] = 0x28 348 } 349 n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.JailedUntil, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.JailedUntil):]) 350 if err1 != nil { 351 return 0, err1 352 } 353 i -= n1 354 i = encodeVarintSlashing(dAtA, i, uint64(n1)) 355 i-- 356 dAtA[i] = 0x22 357 if m.IndexOffset != 0 { 358 i = encodeVarintSlashing(dAtA, i, uint64(m.IndexOffset)) 359 i-- 360 dAtA[i] = 0x18 361 } 362 if m.StartHeight != 0 { 363 i = encodeVarintSlashing(dAtA, i, uint64(m.StartHeight)) 364 i-- 365 dAtA[i] = 0x10 366 } 367 if len(m.Address) > 0 { 368 i -= len(m.Address) 369 copy(dAtA[i:], m.Address) 370 i = encodeVarintSlashing(dAtA, i, uint64(len(m.Address))) 371 i-- 372 dAtA[i] = 0xa 373 } 374 return len(dAtA) - i, nil 375 } 376 377 func (m *Params) Marshal() (dAtA []byte, err error) { 378 size := m.Size() 379 dAtA = make([]byte, size) 380 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 381 if err != nil { 382 return nil, err 383 } 384 return dAtA[:n], nil 385 } 386 387 func (m *Params) MarshalTo(dAtA []byte) (int, error) { 388 size := m.Size() 389 return m.MarshalToSizedBuffer(dAtA[:size]) 390 } 391 392 func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { 393 i := len(dAtA) 394 _ = i 395 var l int 396 _ = l 397 { 398 size := m.SlashFractionDowntime.Size() 399 i -= size 400 if _, err := m.SlashFractionDowntime.MarshalTo(dAtA[i:]); err != nil { 401 return 0, err 402 } 403 i = encodeVarintSlashing(dAtA, i, uint64(size)) 404 } 405 i-- 406 dAtA[i] = 0x2a 407 { 408 size := m.SlashFractionDoubleSign.Size() 409 i -= size 410 if _, err := m.SlashFractionDoubleSign.MarshalTo(dAtA[i:]); err != nil { 411 return 0, err 412 } 413 i = encodeVarintSlashing(dAtA, i, uint64(size)) 414 } 415 i-- 416 dAtA[i] = 0x22 417 n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.DowntimeJailDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.DowntimeJailDuration):]) 418 if err2 != nil { 419 return 0, err2 420 } 421 i -= n2 422 i = encodeVarintSlashing(dAtA, i, uint64(n2)) 423 i-- 424 dAtA[i] = 0x1a 425 { 426 size := m.MinSignedPerWindow.Size() 427 i -= size 428 if _, err := m.MinSignedPerWindow.MarshalTo(dAtA[i:]); err != nil { 429 return 0, err 430 } 431 i = encodeVarintSlashing(dAtA, i, uint64(size)) 432 } 433 i-- 434 dAtA[i] = 0x12 435 if m.SignedBlocksWindow != 0 { 436 i = encodeVarintSlashing(dAtA, i, uint64(m.SignedBlocksWindow)) 437 i-- 438 dAtA[i] = 0x8 439 } 440 return len(dAtA) - i, nil 441 } 442 443 func encodeVarintSlashing(dAtA []byte, offset int, v uint64) int { 444 offset -= sovSlashing(v) 445 base := offset 446 for v >= 1<<7 { 447 dAtA[offset] = uint8(v&0x7f | 0x80) 448 v >>= 7 449 offset++ 450 } 451 dAtA[offset] = uint8(v) 452 return base 453 } 454 func (m *ValidatorSigningInfo) Size() (n int) { 455 if m == nil { 456 return 0 457 } 458 var l int 459 _ = l 460 l = len(m.Address) 461 if l > 0 { 462 n += 1 + l + sovSlashing(uint64(l)) 463 } 464 if m.StartHeight != 0 { 465 n += 1 + sovSlashing(uint64(m.StartHeight)) 466 } 467 if m.IndexOffset != 0 { 468 n += 1 + sovSlashing(uint64(m.IndexOffset)) 469 } 470 l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.JailedUntil) 471 n += 1 + l + sovSlashing(uint64(l)) 472 if m.Tombstoned { 473 n += 2 474 } 475 if m.MissedBlocksCounter != 0 { 476 n += 1 + sovSlashing(uint64(m.MissedBlocksCounter)) 477 } 478 return n 479 } 480 481 func (m *Params) Size() (n int) { 482 if m == nil { 483 return 0 484 } 485 var l int 486 _ = l 487 if m.SignedBlocksWindow != 0 { 488 n += 1 + sovSlashing(uint64(m.SignedBlocksWindow)) 489 } 490 l = m.MinSignedPerWindow.Size() 491 n += 1 + l + sovSlashing(uint64(l)) 492 l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.DowntimeJailDuration) 493 n += 1 + l + sovSlashing(uint64(l)) 494 l = m.SlashFractionDoubleSign.Size() 495 n += 1 + l + sovSlashing(uint64(l)) 496 l = m.SlashFractionDowntime.Size() 497 n += 1 + l + sovSlashing(uint64(l)) 498 return n 499 } 500 501 func sovSlashing(x uint64) (n int) { 502 return (math_bits.Len64(x|1) + 6) / 7 503 } 504 func sozSlashing(x uint64) (n int) { 505 return sovSlashing(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 506 } 507 func (m *ValidatorSigningInfo) Unmarshal(dAtA []byte) error { 508 l := len(dAtA) 509 iNdEx := 0 510 for iNdEx < l { 511 preIndex := iNdEx 512 var wire uint64 513 for shift := uint(0); ; shift += 7 { 514 if shift >= 64 { 515 return ErrIntOverflowSlashing 516 } 517 if iNdEx >= l { 518 return io.ErrUnexpectedEOF 519 } 520 b := dAtA[iNdEx] 521 iNdEx++ 522 wire |= uint64(b&0x7F) << shift 523 if b < 0x80 { 524 break 525 } 526 } 527 fieldNum := int32(wire >> 3) 528 wireType := int(wire & 0x7) 529 if wireType == 4 { 530 return fmt.Errorf("proto: ValidatorSigningInfo: wiretype end group for non-group") 531 } 532 if fieldNum <= 0 { 533 return fmt.Errorf("proto: ValidatorSigningInfo: illegal tag %d (wire type %d)", fieldNum, wire) 534 } 535 switch fieldNum { 536 case 1: 537 if wireType != 2 { 538 return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) 539 } 540 var stringLen uint64 541 for shift := uint(0); ; shift += 7 { 542 if shift >= 64 { 543 return ErrIntOverflowSlashing 544 } 545 if iNdEx >= l { 546 return io.ErrUnexpectedEOF 547 } 548 b := dAtA[iNdEx] 549 iNdEx++ 550 stringLen |= uint64(b&0x7F) << shift 551 if b < 0x80 { 552 break 553 } 554 } 555 intStringLen := int(stringLen) 556 if intStringLen < 0 { 557 return ErrInvalidLengthSlashing 558 } 559 postIndex := iNdEx + intStringLen 560 if postIndex < 0 { 561 return ErrInvalidLengthSlashing 562 } 563 if postIndex > l { 564 return io.ErrUnexpectedEOF 565 } 566 m.Address = string(dAtA[iNdEx:postIndex]) 567 iNdEx = postIndex 568 case 2: 569 if wireType != 0 { 570 return fmt.Errorf("proto: wrong wireType = %d for field StartHeight", wireType) 571 } 572 m.StartHeight = 0 573 for shift := uint(0); ; shift += 7 { 574 if shift >= 64 { 575 return ErrIntOverflowSlashing 576 } 577 if iNdEx >= l { 578 return io.ErrUnexpectedEOF 579 } 580 b := dAtA[iNdEx] 581 iNdEx++ 582 m.StartHeight |= int64(b&0x7F) << shift 583 if b < 0x80 { 584 break 585 } 586 } 587 case 3: 588 if wireType != 0 { 589 return fmt.Errorf("proto: wrong wireType = %d for field IndexOffset", wireType) 590 } 591 m.IndexOffset = 0 592 for shift := uint(0); ; shift += 7 { 593 if shift >= 64 { 594 return ErrIntOverflowSlashing 595 } 596 if iNdEx >= l { 597 return io.ErrUnexpectedEOF 598 } 599 b := dAtA[iNdEx] 600 iNdEx++ 601 m.IndexOffset |= int64(b&0x7F) << shift 602 if b < 0x80 { 603 break 604 } 605 } 606 case 4: 607 if wireType != 2 { 608 return fmt.Errorf("proto: wrong wireType = %d for field JailedUntil", wireType) 609 } 610 var msglen int 611 for shift := uint(0); ; shift += 7 { 612 if shift >= 64 { 613 return ErrIntOverflowSlashing 614 } 615 if iNdEx >= l { 616 return io.ErrUnexpectedEOF 617 } 618 b := dAtA[iNdEx] 619 iNdEx++ 620 msglen |= int(b&0x7F) << shift 621 if b < 0x80 { 622 break 623 } 624 } 625 if msglen < 0 { 626 return ErrInvalidLengthSlashing 627 } 628 postIndex := iNdEx + msglen 629 if postIndex < 0 { 630 return ErrInvalidLengthSlashing 631 } 632 if postIndex > l { 633 return io.ErrUnexpectedEOF 634 } 635 if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.JailedUntil, dAtA[iNdEx:postIndex]); err != nil { 636 return err 637 } 638 iNdEx = postIndex 639 case 5: 640 if wireType != 0 { 641 return fmt.Errorf("proto: wrong wireType = %d for field Tombstoned", wireType) 642 } 643 var v int 644 for shift := uint(0); ; shift += 7 { 645 if shift >= 64 { 646 return ErrIntOverflowSlashing 647 } 648 if iNdEx >= l { 649 return io.ErrUnexpectedEOF 650 } 651 b := dAtA[iNdEx] 652 iNdEx++ 653 v |= int(b&0x7F) << shift 654 if b < 0x80 { 655 break 656 } 657 } 658 m.Tombstoned = bool(v != 0) 659 case 6: 660 if wireType != 0 { 661 return fmt.Errorf("proto: wrong wireType = %d for field MissedBlocksCounter", wireType) 662 } 663 m.MissedBlocksCounter = 0 664 for shift := uint(0); ; shift += 7 { 665 if shift >= 64 { 666 return ErrIntOverflowSlashing 667 } 668 if iNdEx >= l { 669 return io.ErrUnexpectedEOF 670 } 671 b := dAtA[iNdEx] 672 iNdEx++ 673 m.MissedBlocksCounter |= int64(b&0x7F) << shift 674 if b < 0x80 { 675 break 676 } 677 } 678 default: 679 iNdEx = preIndex 680 skippy, err := skipSlashing(dAtA[iNdEx:]) 681 if err != nil { 682 return err 683 } 684 if (skippy < 0) || (iNdEx+skippy) < 0 { 685 return ErrInvalidLengthSlashing 686 } 687 if (iNdEx + skippy) > l { 688 return io.ErrUnexpectedEOF 689 } 690 iNdEx += skippy 691 } 692 } 693 694 if iNdEx > l { 695 return io.ErrUnexpectedEOF 696 } 697 return nil 698 } 699 func (m *Params) Unmarshal(dAtA []byte) error { 700 l := len(dAtA) 701 iNdEx := 0 702 for iNdEx < l { 703 preIndex := iNdEx 704 var wire uint64 705 for shift := uint(0); ; shift += 7 { 706 if shift >= 64 { 707 return ErrIntOverflowSlashing 708 } 709 if iNdEx >= l { 710 return io.ErrUnexpectedEOF 711 } 712 b := dAtA[iNdEx] 713 iNdEx++ 714 wire |= uint64(b&0x7F) << shift 715 if b < 0x80 { 716 break 717 } 718 } 719 fieldNum := int32(wire >> 3) 720 wireType := int(wire & 0x7) 721 if wireType == 4 { 722 return fmt.Errorf("proto: Params: wiretype end group for non-group") 723 } 724 if fieldNum <= 0 { 725 return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) 726 } 727 switch fieldNum { 728 case 1: 729 if wireType != 0 { 730 return fmt.Errorf("proto: wrong wireType = %d for field SignedBlocksWindow", wireType) 731 } 732 m.SignedBlocksWindow = 0 733 for shift := uint(0); ; shift += 7 { 734 if shift >= 64 { 735 return ErrIntOverflowSlashing 736 } 737 if iNdEx >= l { 738 return io.ErrUnexpectedEOF 739 } 740 b := dAtA[iNdEx] 741 iNdEx++ 742 m.SignedBlocksWindow |= int64(b&0x7F) << shift 743 if b < 0x80 { 744 break 745 } 746 } 747 case 2: 748 if wireType != 2 { 749 return fmt.Errorf("proto: wrong wireType = %d for field MinSignedPerWindow", wireType) 750 } 751 var byteLen int 752 for shift := uint(0); ; shift += 7 { 753 if shift >= 64 { 754 return ErrIntOverflowSlashing 755 } 756 if iNdEx >= l { 757 return io.ErrUnexpectedEOF 758 } 759 b := dAtA[iNdEx] 760 iNdEx++ 761 byteLen |= int(b&0x7F) << shift 762 if b < 0x80 { 763 break 764 } 765 } 766 if byteLen < 0 { 767 return ErrInvalidLengthSlashing 768 } 769 postIndex := iNdEx + byteLen 770 if postIndex < 0 { 771 return ErrInvalidLengthSlashing 772 } 773 if postIndex > l { 774 return io.ErrUnexpectedEOF 775 } 776 if err := m.MinSignedPerWindow.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 777 return err 778 } 779 iNdEx = postIndex 780 case 3: 781 if wireType != 2 { 782 return fmt.Errorf("proto: wrong wireType = %d for field DowntimeJailDuration", wireType) 783 } 784 var msglen int 785 for shift := uint(0); ; shift += 7 { 786 if shift >= 64 { 787 return ErrIntOverflowSlashing 788 } 789 if iNdEx >= l { 790 return io.ErrUnexpectedEOF 791 } 792 b := dAtA[iNdEx] 793 iNdEx++ 794 msglen |= int(b&0x7F) << shift 795 if b < 0x80 { 796 break 797 } 798 } 799 if msglen < 0 { 800 return ErrInvalidLengthSlashing 801 } 802 postIndex := iNdEx + msglen 803 if postIndex < 0 { 804 return ErrInvalidLengthSlashing 805 } 806 if postIndex > l { 807 return io.ErrUnexpectedEOF 808 } 809 if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.DowntimeJailDuration, dAtA[iNdEx:postIndex]); err != nil { 810 return err 811 } 812 iNdEx = postIndex 813 case 4: 814 if wireType != 2 { 815 return fmt.Errorf("proto: wrong wireType = %d for field SlashFractionDoubleSign", wireType) 816 } 817 var byteLen int 818 for shift := uint(0); ; shift += 7 { 819 if shift >= 64 { 820 return ErrIntOverflowSlashing 821 } 822 if iNdEx >= l { 823 return io.ErrUnexpectedEOF 824 } 825 b := dAtA[iNdEx] 826 iNdEx++ 827 byteLen |= int(b&0x7F) << shift 828 if b < 0x80 { 829 break 830 } 831 } 832 if byteLen < 0 { 833 return ErrInvalidLengthSlashing 834 } 835 postIndex := iNdEx + byteLen 836 if postIndex < 0 { 837 return ErrInvalidLengthSlashing 838 } 839 if postIndex > l { 840 return io.ErrUnexpectedEOF 841 } 842 if err := m.SlashFractionDoubleSign.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 843 return err 844 } 845 iNdEx = postIndex 846 case 5: 847 if wireType != 2 { 848 return fmt.Errorf("proto: wrong wireType = %d for field SlashFractionDowntime", wireType) 849 } 850 var byteLen int 851 for shift := uint(0); ; shift += 7 { 852 if shift >= 64 { 853 return ErrIntOverflowSlashing 854 } 855 if iNdEx >= l { 856 return io.ErrUnexpectedEOF 857 } 858 b := dAtA[iNdEx] 859 iNdEx++ 860 byteLen |= int(b&0x7F) << shift 861 if b < 0x80 { 862 break 863 } 864 } 865 if byteLen < 0 { 866 return ErrInvalidLengthSlashing 867 } 868 postIndex := iNdEx + byteLen 869 if postIndex < 0 { 870 return ErrInvalidLengthSlashing 871 } 872 if postIndex > l { 873 return io.ErrUnexpectedEOF 874 } 875 if err := m.SlashFractionDowntime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 876 return err 877 } 878 iNdEx = postIndex 879 default: 880 iNdEx = preIndex 881 skippy, err := skipSlashing(dAtA[iNdEx:]) 882 if err != nil { 883 return err 884 } 885 if (skippy < 0) || (iNdEx+skippy) < 0 { 886 return ErrInvalidLengthSlashing 887 } 888 if (iNdEx + skippy) > l { 889 return io.ErrUnexpectedEOF 890 } 891 iNdEx += skippy 892 } 893 } 894 895 if iNdEx > l { 896 return io.ErrUnexpectedEOF 897 } 898 return nil 899 } 900 func skipSlashing(dAtA []byte) (n int, err error) { 901 l := len(dAtA) 902 iNdEx := 0 903 depth := 0 904 for iNdEx < l { 905 var wire uint64 906 for shift := uint(0); ; shift += 7 { 907 if shift >= 64 { 908 return 0, ErrIntOverflowSlashing 909 } 910 if iNdEx >= l { 911 return 0, io.ErrUnexpectedEOF 912 } 913 b := dAtA[iNdEx] 914 iNdEx++ 915 wire |= (uint64(b) & 0x7F) << shift 916 if b < 0x80 { 917 break 918 } 919 } 920 wireType := int(wire & 0x7) 921 switch wireType { 922 case 0: 923 for shift := uint(0); ; shift += 7 { 924 if shift >= 64 { 925 return 0, ErrIntOverflowSlashing 926 } 927 if iNdEx >= l { 928 return 0, io.ErrUnexpectedEOF 929 } 930 iNdEx++ 931 if dAtA[iNdEx-1] < 0x80 { 932 break 933 } 934 } 935 case 1: 936 iNdEx += 8 937 case 2: 938 var length int 939 for shift := uint(0); ; shift += 7 { 940 if shift >= 64 { 941 return 0, ErrIntOverflowSlashing 942 } 943 if iNdEx >= l { 944 return 0, io.ErrUnexpectedEOF 945 } 946 b := dAtA[iNdEx] 947 iNdEx++ 948 length |= (int(b) & 0x7F) << shift 949 if b < 0x80 { 950 break 951 } 952 } 953 if length < 0 { 954 return 0, ErrInvalidLengthSlashing 955 } 956 iNdEx += length 957 case 3: 958 depth++ 959 case 4: 960 if depth == 0 { 961 return 0, ErrUnexpectedEndOfGroupSlashing 962 } 963 depth-- 964 case 5: 965 iNdEx += 4 966 default: 967 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 968 } 969 if iNdEx < 0 { 970 return 0, ErrInvalidLengthSlashing 971 } 972 if depth == 0 { 973 return iNdEx, nil 974 } 975 } 976 return 0, io.ErrUnexpectedEOF 977 } 978 979 var ( 980 ErrInvalidLengthSlashing = fmt.Errorf("proto: negative length found during unmarshaling") 981 ErrIntOverflowSlashing = fmt.Errorf("proto: integer overflow") 982 ErrUnexpectedEndOfGroupSlashing = fmt.Errorf("proto: unexpected end of group") 983 )