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