github.com/Finschia/finschia-sdk@v0.48.1/x/staking/types/authz.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: cosmos/staking/v1beta1/authz.proto 3 4 package types 5 6 import ( 7 fmt "fmt" 8 types "github.com/Finschia/finschia-sdk/types" 9 _ "github.com/gogo/protobuf/gogoproto" 10 proto "github.com/gogo/protobuf/proto" 11 _ "github.com/regen-network/cosmos-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 // AuthorizationType defines the type of staking module authorization type 29 // 30 // Since: cosmos-sdk 0.43 31 type AuthorizationType int32 32 33 const ( 34 // AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type 35 AuthorizationType_AUTHORIZATION_TYPE_UNSPECIFIED AuthorizationType = 0 36 // AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate 37 AuthorizationType_AUTHORIZATION_TYPE_DELEGATE AuthorizationType = 1 38 // AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate 39 AuthorizationType_AUTHORIZATION_TYPE_UNDELEGATE AuthorizationType = 2 40 // AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate 41 AuthorizationType_AUTHORIZATION_TYPE_REDELEGATE AuthorizationType = 3 42 ) 43 44 var AuthorizationType_name = map[int32]string{ 45 0: "AUTHORIZATION_TYPE_UNSPECIFIED", 46 1: "AUTHORIZATION_TYPE_DELEGATE", 47 2: "AUTHORIZATION_TYPE_UNDELEGATE", 48 3: "AUTHORIZATION_TYPE_REDELEGATE", 49 } 50 51 var AuthorizationType_value = map[string]int32{ 52 "AUTHORIZATION_TYPE_UNSPECIFIED": 0, 53 "AUTHORIZATION_TYPE_DELEGATE": 1, 54 "AUTHORIZATION_TYPE_UNDELEGATE": 2, 55 "AUTHORIZATION_TYPE_REDELEGATE": 3, 56 } 57 58 func (x AuthorizationType) String() string { 59 return proto.EnumName(AuthorizationType_name, int32(x)) 60 } 61 62 func (AuthorizationType) EnumDescriptor() ([]byte, []int) { 63 return fileDescriptor_d6d8cdbc6f4432f0, []int{0} 64 } 65 66 // StakeAuthorization defines authorization for delegate/undelegate/redelegate. 67 // 68 // Since: cosmos-sdk 0.43 69 type StakeAuthorization struct { 70 // max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is 71 // empty, there is no spend limit and any amount of coins can be delegated. 72 MaxTokens *types.Coin `protobuf:"bytes,1,opt,name=max_tokens,json=maxTokens,proto3,castrepeated=github.com/Finschia/finschia-sdk/types.Coin" json:"max_tokens,omitempty"` 73 // validators is the oneof that represents either allow_list or deny_list 74 // 75 // Types that are valid to be assigned to Validators: 76 // *StakeAuthorization_AllowList 77 // *StakeAuthorization_DenyList 78 Validators isStakeAuthorization_Validators `protobuf_oneof:"validators"` 79 // authorization_type defines one of AuthorizationType. 80 AuthorizationType AuthorizationType `protobuf:"varint,4,opt,name=authorization_type,json=authorizationType,proto3,enum=cosmos.staking.v1beta1.AuthorizationType" json:"authorization_type,omitempty"` 81 } 82 83 func (m *StakeAuthorization) Reset() { *m = StakeAuthorization{} } 84 func (m *StakeAuthorization) String() string { return proto.CompactTextString(m) } 85 func (*StakeAuthorization) ProtoMessage() {} 86 func (*StakeAuthorization) Descriptor() ([]byte, []int) { 87 return fileDescriptor_d6d8cdbc6f4432f0, []int{0} 88 } 89 func (m *StakeAuthorization) XXX_Unmarshal(b []byte) error { 90 return m.Unmarshal(b) 91 } 92 func (m *StakeAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 93 if deterministic { 94 return xxx_messageInfo_StakeAuthorization.Marshal(b, m, deterministic) 95 } else { 96 b = b[:cap(b)] 97 n, err := m.MarshalToSizedBuffer(b) 98 if err != nil { 99 return nil, err 100 } 101 return b[:n], nil 102 } 103 } 104 func (m *StakeAuthorization) XXX_Merge(src proto.Message) { 105 xxx_messageInfo_StakeAuthorization.Merge(m, src) 106 } 107 func (m *StakeAuthorization) XXX_Size() int { 108 return m.Size() 109 } 110 func (m *StakeAuthorization) XXX_DiscardUnknown() { 111 xxx_messageInfo_StakeAuthorization.DiscardUnknown(m) 112 } 113 114 var xxx_messageInfo_StakeAuthorization proto.InternalMessageInfo 115 116 type isStakeAuthorization_Validators interface { 117 isStakeAuthorization_Validators() 118 MarshalTo([]byte) (int, error) 119 Size() int 120 } 121 122 type StakeAuthorization_AllowList struct { 123 AllowList *StakeAuthorization_Validators `protobuf:"bytes,2,opt,name=allow_list,json=allowList,proto3,oneof" json:"allow_list,omitempty"` 124 } 125 type StakeAuthorization_DenyList struct { 126 DenyList *StakeAuthorization_Validators `protobuf:"bytes,3,opt,name=deny_list,json=denyList,proto3,oneof" json:"deny_list,omitempty"` 127 } 128 129 func (*StakeAuthorization_AllowList) isStakeAuthorization_Validators() {} 130 func (*StakeAuthorization_DenyList) isStakeAuthorization_Validators() {} 131 132 func (m *StakeAuthorization) GetValidators() isStakeAuthorization_Validators { 133 if m != nil { 134 return m.Validators 135 } 136 return nil 137 } 138 139 func (m *StakeAuthorization) GetMaxTokens() *types.Coin { 140 if m != nil { 141 return m.MaxTokens 142 } 143 return nil 144 } 145 146 func (m *StakeAuthorization) GetAllowList() *StakeAuthorization_Validators { 147 if x, ok := m.GetValidators().(*StakeAuthorization_AllowList); ok { 148 return x.AllowList 149 } 150 return nil 151 } 152 153 func (m *StakeAuthorization) GetDenyList() *StakeAuthorization_Validators { 154 if x, ok := m.GetValidators().(*StakeAuthorization_DenyList); ok { 155 return x.DenyList 156 } 157 return nil 158 } 159 160 func (m *StakeAuthorization) GetAuthorizationType() AuthorizationType { 161 if m != nil { 162 return m.AuthorizationType 163 } 164 return AuthorizationType_AUTHORIZATION_TYPE_UNSPECIFIED 165 } 166 167 // XXX_OneofWrappers is for the internal use of the proto package. 168 func (*StakeAuthorization) XXX_OneofWrappers() []interface{} { 169 return []interface{}{ 170 (*StakeAuthorization_AllowList)(nil), 171 (*StakeAuthorization_DenyList)(nil), 172 } 173 } 174 175 // Validators defines list of validator addresses. 176 type StakeAuthorization_Validators struct { 177 Address []string `protobuf:"bytes,1,rep,name=address,proto3" json:"address,omitempty"` 178 } 179 180 func (m *StakeAuthorization_Validators) Reset() { *m = StakeAuthorization_Validators{} } 181 func (m *StakeAuthorization_Validators) String() string { return proto.CompactTextString(m) } 182 func (*StakeAuthorization_Validators) ProtoMessage() {} 183 func (*StakeAuthorization_Validators) Descriptor() ([]byte, []int) { 184 return fileDescriptor_d6d8cdbc6f4432f0, []int{0, 0} 185 } 186 func (m *StakeAuthorization_Validators) XXX_Unmarshal(b []byte) error { 187 return m.Unmarshal(b) 188 } 189 func (m *StakeAuthorization_Validators) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 190 if deterministic { 191 return xxx_messageInfo_StakeAuthorization_Validators.Marshal(b, m, deterministic) 192 } else { 193 b = b[:cap(b)] 194 n, err := m.MarshalToSizedBuffer(b) 195 if err != nil { 196 return nil, err 197 } 198 return b[:n], nil 199 } 200 } 201 func (m *StakeAuthorization_Validators) XXX_Merge(src proto.Message) { 202 xxx_messageInfo_StakeAuthorization_Validators.Merge(m, src) 203 } 204 func (m *StakeAuthorization_Validators) XXX_Size() int { 205 return m.Size() 206 } 207 func (m *StakeAuthorization_Validators) XXX_DiscardUnknown() { 208 xxx_messageInfo_StakeAuthorization_Validators.DiscardUnknown(m) 209 } 210 211 var xxx_messageInfo_StakeAuthorization_Validators proto.InternalMessageInfo 212 213 func (m *StakeAuthorization_Validators) GetAddress() []string { 214 if m != nil { 215 return m.Address 216 } 217 return nil 218 } 219 220 func init() { 221 proto.RegisterEnum("cosmos.staking.v1beta1.AuthorizationType", AuthorizationType_name, AuthorizationType_value) 222 proto.RegisterType((*StakeAuthorization)(nil), "cosmos.staking.v1beta1.StakeAuthorization") 223 proto.RegisterType((*StakeAuthorization_Validators)(nil), "cosmos.staking.v1beta1.StakeAuthorization.Validators") 224 } 225 226 func init() { 227 proto.RegisterFile("cosmos/staking/v1beta1/authz.proto", fileDescriptor_d6d8cdbc6f4432f0) 228 } 229 230 var fileDescriptor_d6d8cdbc6f4432f0 = []byte{ 231 // 467 bytes of a gzipped FileDescriptorProto 232 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4f, 0x6e, 0xd3, 0x40, 233 0x14, 0x87, 0x3d, 0x0d, 0x02, 0xf2, 0xf8, 0xa3, 0x66, 0x84, 0x50, 0x1a, 0xc4, 0xb4, 0x64, 0x81, 234 0x02, 0xa8, 0x33, 0xb4, 0x88, 0x0d, 0xbb, 0xa4, 0x75, 0x69, 0x50, 0xd5, 0x56, 0xae, 0x5b, 0x41, 235 0x37, 0xd6, 0x24, 0x1e, 0x92, 0x51, 0x12, 0x4f, 0x94, 0x99, 0x94, 0xa4, 0xa7, 0xe0, 0x04, 0x1c, 236 0x80, 0x35, 0x87, 0x60, 0x19, 0xb1, 0x62, 0x07, 0x4a, 0x2e, 0x82, 0x3c, 0x76, 0x0d, 0xa5, 0x89, 237 0x58, 0xb0, 0x1b, 0xfb, 0x7d, 0xef, 0xfb, 0xcd, 0xb3, 0x9e, 0xa1, 0xdc, 0x54, 0xba, 0xa7, 0x34, 238 0xd3, 0x86, 0x77, 0x64, 0xd4, 0x62, 0x67, 0x1b, 0x0d, 0x61, 0xf8, 0x06, 0xe3, 0x43, 0xd3, 0x3e, 239 0xa7, 0xfd, 0x81, 0x32, 0x0a, 0xdf, 0x4f, 0x18, 0x9a, 0x32, 0x34, 0x65, 0x4a, 0xf7, 0x5a, 0xaa, 240 0xa5, 0x2c, 0xc2, 0xe2, 0x53, 0x42, 0x97, 0x56, 0x12, 0x3a, 0x48, 0x0a, 0x69, 0x6b, 0x52, 0x22, 241 0x69, 0x58, 0x83, 0x6b, 0x91, 0x25, 0x35, 0x95, 0x8c, 0x92, 0x7a, 0x79, 0x92, 0x03, 0x7c, 0x64, 242 0x78, 0x47, 0x54, 0x87, 0xa6, 0xad, 0x06, 0xf2, 0x9c, 0x1b, 0xa9, 0x22, 0x2c, 0x01, 0x7a, 0x7c, 243 0x14, 0x18, 0xd5, 0x11, 0x91, 0x2e, 0xa2, 0x35, 0x54, 0xb9, 0xb5, 0xb9, 0x42, 0x53, 0x73, 0xec, 244 0xba, 0xb8, 0x11, 0xdd, 0x52, 0x32, 0xaa, 0xb1, 0xcf, 0x3f, 0x56, 0x9f, 0xb5, 0xa4, 0x69, 0x0f, 245 0x1b, 0xb4, 0xa9, 0x7a, 0x6c, 0x47, 0x46, 0xba, 0xd9, 0x96, 0x9c, 0xbd, 0x4f, 0x0f, 0xeb, 0x3a, 246 0xec, 0x30, 0x33, 0xee, 0x0b, 0x6d, 0x1b, 0xbc, 0x7c, 0x8f, 0x8f, 0x7c, 0x2b, 0xc7, 0x27, 0x00, 247 0xbc, 0xdb, 0x55, 0x1f, 0x82, 0xae, 0xd4, 0xa6, 0xb8, 0x64, 0xa3, 0x5e, 0xd2, 0xf9, 0xf3, 0xd3, 248 0xab, 0x57, 0xa5, 0x27, 0xbc, 0x2b, 0x43, 0x6e, 0xd4, 0x40, 0xef, 0x3a, 0x5e, 0xde, 0xaa, 0xf6, 249 0xa4, 0x36, 0xd8, 0x87, 0x7c, 0x28, 0xa2, 0x71, 0xa2, 0xcd, 0xfd, 0x9f, 0xf6, 0x66, 0x6c, 0xb2, 250 0xd6, 0xb7, 0x80, 0xf9, 0x9f, 0x5c, 0x10, 0x0f, 0x55, 0xbc, 0xb6, 0x86, 0x2a, 0x77, 0x37, 0x9f, 251 0x2c, 0xd2, 0x5f, 0x32, 0xfb, 0xe3, 0xbe, 0xf0, 0x0a, 0xfc, 0xef, 0x57, 0xa5, 0xc7, 0x00, 0xbf, 252 0x33, 0x71, 0x11, 0x6e, 0xf0, 0x30, 0x1c, 0x08, 0x1d, 0x7f, 0xfd, 0x5c, 0x25, 0xef, 0x5d, 0x3c, 253 0xbe, 0x2a, 0x7c, 0xfb, 0xb2, 0x7e, 0xe7, 0x92, 0xb1, 0x76, 0x1b, 0xe0, 0x2c, 0x6b, 0x7d, 0xfa, 254 0x09, 0x41, 0xe1, 0x4a, 0x22, 0x2e, 0x03, 0xa9, 0x1e, 0xfb, 0xbb, 0x07, 0x5e, 0xfd, 0xb4, 0xea, 255 0xd7, 0x0f, 0xf6, 0x03, 0xff, 0xdd, 0xa1, 0x1b, 0x1c, 0xef, 0x1f, 0x1d, 0xba, 0x5b, 0xf5, 0x9d, 256 0xba, 0xbb, 0xbd, 0xec, 0xe0, 0x55, 0x78, 0x30, 0x87, 0xd9, 0x76, 0xf7, 0xdc, 0xd7, 0x55, 0xdf, 257 0x5d, 0x46, 0xf8, 0x11, 0x3c, 0x9c, 0x2b, 0xc9, 0x90, 0xa5, 0x05, 0x88, 0xe7, 0x66, 0x48, 0xae, 258 0xf6, 0xe6, 0xeb, 0x94, 0xa0, 0xc9, 0x94, 0xa0, 0x9f, 0x53, 0x82, 0x3e, 0xce, 0x88, 0x33, 0x99, 259 0x11, 0xe7, 0xfb, 0x8c, 0x38, 0xa7, 0xcf, 0xff, 0xb9, 0x43, 0xa3, 0xec, 0xb7, 0xb1, 0xdb, 0xd4, 260 0xb8, 0x6e, 0xd7, 0xf8, 0xc5, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x72, 0xed, 0x28, 0x56, 0x55, 261 0x03, 0x00, 0x00, 262 } 263 264 func (m *StakeAuthorization) Marshal() (dAtA []byte, err error) { 265 size := m.Size() 266 dAtA = make([]byte, size) 267 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 268 if err != nil { 269 return nil, err 270 } 271 return dAtA[:n], nil 272 } 273 274 func (m *StakeAuthorization) MarshalTo(dAtA []byte) (int, error) { 275 size := m.Size() 276 return m.MarshalToSizedBuffer(dAtA[:size]) 277 } 278 279 func (m *StakeAuthorization) MarshalToSizedBuffer(dAtA []byte) (int, error) { 280 i := len(dAtA) 281 _ = i 282 var l int 283 _ = l 284 if m.AuthorizationType != 0 { 285 i = encodeVarintAuthz(dAtA, i, uint64(m.AuthorizationType)) 286 i-- 287 dAtA[i] = 0x20 288 } 289 if m.Validators != nil { 290 { 291 size := m.Validators.Size() 292 i -= size 293 if _, err := m.Validators.MarshalTo(dAtA[i:]); err != nil { 294 return 0, err 295 } 296 } 297 } 298 if m.MaxTokens != nil { 299 { 300 size, err := m.MaxTokens.MarshalToSizedBuffer(dAtA[:i]) 301 if err != nil { 302 return 0, err 303 } 304 i -= size 305 i = encodeVarintAuthz(dAtA, i, uint64(size)) 306 } 307 i-- 308 dAtA[i] = 0xa 309 } 310 return len(dAtA) - i, nil 311 } 312 313 func (m *StakeAuthorization_AllowList) MarshalTo(dAtA []byte) (int, error) { 314 size := m.Size() 315 return m.MarshalToSizedBuffer(dAtA[:size]) 316 } 317 318 func (m *StakeAuthorization_AllowList) MarshalToSizedBuffer(dAtA []byte) (int, error) { 319 i := len(dAtA) 320 if m.AllowList != nil { 321 { 322 size, err := m.AllowList.MarshalToSizedBuffer(dAtA[:i]) 323 if err != nil { 324 return 0, err 325 } 326 i -= size 327 i = encodeVarintAuthz(dAtA, i, uint64(size)) 328 } 329 i-- 330 dAtA[i] = 0x12 331 } 332 return len(dAtA) - i, nil 333 } 334 func (m *StakeAuthorization_DenyList) MarshalTo(dAtA []byte) (int, error) { 335 size := m.Size() 336 return m.MarshalToSizedBuffer(dAtA[:size]) 337 } 338 339 func (m *StakeAuthorization_DenyList) MarshalToSizedBuffer(dAtA []byte) (int, error) { 340 i := len(dAtA) 341 if m.DenyList != nil { 342 { 343 size, err := m.DenyList.MarshalToSizedBuffer(dAtA[:i]) 344 if err != nil { 345 return 0, err 346 } 347 i -= size 348 i = encodeVarintAuthz(dAtA, i, uint64(size)) 349 } 350 i-- 351 dAtA[i] = 0x1a 352 } 353 return len(dAtA) - i, nil 354 } 355 func (m *StakeAuthorization_Validators) Marshal() (dAtA []byte, err error) { 356 size := m.Size() 357 dAtA = make([]byte, size) 358 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 359 if err != nil { 360 return nil, err 361 } 362 return dAtA[:n], nil 363 } 364 365 func (m *StakeAuthorization_Validators) MarshalTo(dAtA []byte) (int, error) { 366 size := m.Size() 367 return m.MarshalToSizedBuffer(dAtA[:size]) 368 } 369 370 func (m *StakeAuthorization_Validators) MarshalToSizedBuffer(dAtA []byte) (int, error) { 371 i := len(dAtA) 372 _ = i 373 var l int 374 _ = l 375 if len(m.Address) > 0 { 376 for iNdEx := len(m.Address) - 1; iNdEx >= 0; iNdEx-- { 377 i -= len(m.Address[iNdEx]) 378 copy(dAtA[i:], m.Address[iNdEx]) 379 i = encodeVarintAuthz(dAtA, i, uint64(len(m.Address[iNdEx]))) 380 i-- 381 dAtA[i] = 0xa 382 } 383 } 384 return len(dAtA) - i, nil 385 } 386 387 func encodeVarintAuthz(dAtA []byte, offset int, v uint64) int { 388 offset -= sovAuthz(v) 389 base := offset 390 for v >= 1<<7 { 391 dAtA[offset] = uint8(v&0x7f | 0x80) 392 v >>= 7 393 offset++ 394 } 395 dAtA[offset] = uint8(v) 396 return base 397 } 398 func (m *StakeAuthorization) Size() (n int) { 399 if m == nil { 400 return 0 401 } 402 var l int 403 _ = l 404 if m.MaxTokens != nil { 405 l = m.MaxTokens.Size() 406 n += 1 + l + sovAuthz(uint64(l)) 407 } 408 if m.Validators != nil { 409 n += m.Validators.Size() 410 } 411 if m.AuthorizationType != 0 { 412 n += 1 + sovAuthz(uint64(m.AuthorizationType)) 413 } 414 return n 415 } 416 417 func (m *StakeAuthorization_AllowList) Size() (n int) { 418 if m == nil { 419 return 0 420 } 421 var l int 422 _ = l 423 if m.AllowList != nil { 424 l = m.AllowList.Size() 425 n += 1 + l + sovAuthz(uint64(l)) 426 } 427 return n 428 } 429 func (m *StakeAuthorization_DenyList) Size() (n int) { 430 if m == nil { 431 return 0 432 } 433 var l int 434 _ = l 435 if m.DenyList != nil { 436 l = m.DenyList.Size() 437 n += 1 + l + sovAuthz(uint64(l)) 438 } 439 return n 440 } 441 func (m *StakeAuthorization_Validators) Size() (n int) { 442 if m == nil { 443 return 0 444 } 445 var l int 446 _ = l 447 if len(m.Address) > 0 { 448 for _, s := range m.Address { 449 l = len(s) 450 n += 1 + l + sovAuthz(uint64(l)) 451 } 452 } 453 return n 454 } 455 456 func sovAuthz(x uint64) (n int) { 457 return (math_bits.Len64(x|1) + 6) / 7 458 } 459 func sozAuthz(x uint64) (n int) { 460 return sovAuthz(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 461 } 462 func (m *StakeAuthorization) Unmarshal(dAtA []byte) error { 463 l := len(dAtA) 464 iNdEx := 0 465 for iNdEx < l { 466 preIndex := iNdEx 467 var wire uint64 468 for shift := uint(0); ; shift += 7 { 469 if shift >= 64 { 470 return ErrIntOverflowAuthz 471 } 472 if iNdEx >= l { 473 return io.ErrUnexpectedEOF 474 } 475 b := dAtA[iNdEx] 476 iNdEx++ 477 wire |= uint64(b&0x7F) << shift 478 if b < 0x80 { 479 break 480 } 481 } 482 fieldNum := int32(wire >> 3) 483 wireType := int(wire & 0x7) 484 if wireType == 4 { 485 return fmt.Errorf("proto: StakeAuthorization: wiretype end group for non-group") 486 } 487 if fieldNum <= 0 { 488 return fmt.Errorf("proto: StakeAuthorization: illegal tag %d (wire type %d)", fieldNum, wire) 489 } 490 switch fieldNum { 491 case 1: 492 if wireType != 2 { 493 return fmt.Errorf("proto: wrong wireType = %d for field MaxTokens", wireType) 494 } 495 var msglen int 496 for shift := uint(0); ; shift += 7 { 497 if shift >= 64 { 498 return ErrIntOverflowAuthz 499 } 500 if iNdEx >= l { 501 return io.ErrUnexpectedEOF 502 } 503 b := dAtA[iNdEx] 504 iNdEx++ 505 msglen |= int(b&0x7F) << shift 506 if b < 0x80 { 507 break 508 } 509 } 510 if msglen < 0 { 511 return ErrInvalidLengthAuthz 512 } 513 postIndex := iNdEx + msglen 514 if postIndex < 0 { 515 return ErrInvalidLengthAuthz 516 } 517 if postIndex > l { 518 return io.ErrUnexpectedEOF 519 } 520 if m.MaxTokens == nil { 521 m.MaxTokens = &types.Coin{} 522 } 523 if err := m.MaxTokens.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 524 return err 525 } 526 iNdEx = postIndex 527 case 2: 528 if wireType != 2 { 529 return fmt.Errorf("proto: wrong wireType = %d for field AllowList", wireType) 530 } 531 var msglen int 532 for shift := uint(0); ; shift += 7 { 533 if shift >= 64 { 534 return ErrIntOverflowAuthz 535 } 536 if iNdEx >= l { 537 return io.ErrUnexpectedEOF 538 } 539 b := dAtA[iNdEx] 540 iNdEx++ 541 msglen |= int(b&0x7F) << shift 542 if b < 0x80 { 543 break 544 } 545 } 546 if msglen < 0 { 547 return ErrInvalidLengthAuthz 548 } 549 postIndex := iNdEx + msglen 550 if postIndex < 0 { 551 return ErrInvalidLengthAuthz 552 } 553 if postIndex > l { 554 return io.ErrUnexpectedEOF 555 } 556 v := &StakeAuthorization_Validators{} 557 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 558 return err 559 } 560 m.Validators = &StakeAuthorization_AllowList{v} 561 iNdEx = postIndex 562 case 3: 563 if wireType != 2 { 564 return fmt.Errorf("proto: wrong wireType = %d for field DenyList", wireType) 565 } 566 var msglen int 567 for shift := uint(0); ; shift += 7 { 568 if shift >= 64 { 569 return ErrIntOverflowAuthz 570 } 571 if iNdEx >= l { 572 return io.ErrUnexpectedEOF 573 } 574 b := dAtA[iNdEx] 575 iNdEx++ 576 msglen |= int(b&0x7F) << shift 577 if b < 0x80 { 578 break 579 } 580 } 581 if msglen < 0 { 582 return ErrInvalidLengthAuthz 583 } 584 postIndex := iNdEx + msglen 585 if postIndex < 0 { 586 return ErrInvalidLengthAuthz 587 } 588 if postIndex > l { 589 return io.ErrUnexpectedEOF 590 } 591 v := &StakeAuthorization_Validators{} 592 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 593 return err 594 } 595 m.Validators = &StakeAuthorization_DenyList{v} 596 iNdEx = postIndex 597 case 4: 598 if wireType != 0 { 599 return fmt.Errorf("proto: wrong wireType = %d for field AuthorizationType", wireType) 600 } 601 m.AuthorizationType = 0 602 for shift := uint(0); ; shift += 7 { 603 if shift >= 64 { 604 return ErrIntOverflowAuthz 605 } 606 if iNdEx >= l { 607 return io.ErrUnexpectedEOF 608 } 609 b := dAtA[iNdEx] 610 iNdEx++ 611 m.AuthorizationType |= AuthorizationType(b&0x7F) << shift 612 if b < 0x80 { 613 break 614 } 615 } 616 default: 617 iNdEx = preIndex 618 skippy, err := skipAuthz(dAtA[iNdEx:]) 619 if err != nil { 620 return err 621 } 622 if (skippy < 0) || (iNdEx+skippy) < 0 { 623 return ErrInvalidLengthAuthz 624 } 625 if (iNdEx + skippy) > l { 626 return io.ErrUnexpectedEOF 627 } 628 iNdEx += skippy 629 } 630 } 631 632 if iNdEx > l { 633 return io.ErrUnexpectedEOF 634 } 635 return nil 636 } 637 func (m *StakeAuthorization_Validators) Unmarshal(dAtA []byte) error { 638 l := len(dAtA) 639 iNdEx := 0 640 for iNdEx < l { 641 preIndex := iNdEx 642 var wire uint64 643 for shift := uint(0); ; shift += 7 { 644 if shift >= 64 { 645 return ErrIntOverflowAuthz 646 } 647 if iNdEx >= l { 648 return io.ErrUnexpectedEOF 649 } 650 b := dAtA[iNdEx] 651 iNdEx++ 652 wire |= uint64(b&0x7F) << shift 653 if b < 0x80 { 654 break 655 } 656 } 657 fieldNum := int32(wire >> 3) 658 wireType := int(wire & 0x7) 659 if wireType == 4 { 660 return fmt.Errorf("proto: Validators: wiretype end group for non-group") 661 } 662 if fieldNum <= 0 { 663 return fmt.Errorf("proto: Validators: illegal tag %d (wire type %d)", fieldNum, wire) 664 } 665 switch fieldNum { 666 case 1: 667 if wireType != 2 { 668 return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) 669 } 670 var stringLen uint64 671 for shift := uint(0); ; shift += 7 { 672 if shift >= 64 { 673 return ErrIntOverflowAuthz 674 } 675 if iNdEx >= l { 676 return io.ErrUnexpectedEOF 677 } 678 b := dAtA[iNdEx] 679 iNdEx++ 680 stringLen |= uint64(b&0x7F) << shift 681 if b < 0x80 { 682 break 683 } 684 } 685 intStringLen := int(stringLen) 686 if intStringLen < 0 { 687 return ErrInvalidLengthAuthz 688 } 689 postIndex := iNdEx + intStringLen 690 if postIndex < 0 { 691 return ErrInvalidLengthAuthz 692 } 693 if postIndex > l { 694 return io.ErrUnexpectedEOF 695 } 696 m.Address = append(m.Address, string(dAtA[iNdEx:postIndex])) 697 iNdEx = postIndex 698 default: 699 iNdEx = preIndex 700 skippy, err := skipAuthz(dAtA[iNdEx:]) 701 if err != nil { 702 return err 703 } 704 if (skippy < 0) || (iNdEx+skippy) < 0 { 705 return ErrInvalidLengthAuthz 706 } 707 if (iNdEx + skippy) > l { 708 return io.ErrUnexpectedEOF 709 } 710 iNdEx += skippy 711 } 712 } 713 714 if iNdEx > l { 715 return io.ErrUnexpectedEOF 716 } 717 return nil 718 } 719 func skipAuthz(dAtA []byte) (n int, err error) { 720 l := len(dAtA) 721 iNdEx := 0 722 depth := 0 723 for iNdEx < l { 724 var wire uint64 725 for shift := uint(0); ; shift += 7 { 726 if shift >= 64 { 727 return 0, ErrIntOverflowAuthz 728 } 729 if iNdEx >= l { 730 return 0, io.ErrUnexpectedEOF 731 } 732 b := dAtA[iNdEx] 733 iNdEx++ 734 wire |= (uint64(b) & 0x7F) << shift 735 if b < 0x80 { 736 break 737 } 738 } 739 wireType := int(wire & 0x7) 740 switch wireType { 741 case 0: 742 for shift := uint(0); ; shift += 7 { 743 if shift >= 64 { 744 return 0, ErrIntOverflowAuthz 745 } 746 if iNdEx >= l { 747 return 0, io.ErrUnexpectedEOF 748 } 749 iNdEx++ 750 if dAtA[iNdEx-1] < 0x80 { 751 break 752 } 753 } 754 case 1: 755 iNdEx += 8 756 case 2: 757 var length int 758 for shift := uint(0); ; shift += 7 { 759 if shift >= 64 { 760 return 0, ErrIntOverflowAuthz 761 } 762 if iNdEx >= l { 763 return 0, io.ErrUnexpectedEOF 764 } 765 b := dAtA[iNdEx] 766 iNdEx++ 767 length |= (int(b) & 0x7F) << shift 768 if b < 0x80 { 769 break 770 } 771 } 772 if length < 0 { 773 return 0, ErrInvalidLengthAuthz 774 } 775 iNdEx += length 776 case 3: 777 depth++ 778 case 4: 779 if depth == 0 { 780 return 0, ErrUnexpectedEndOfGroupAuthz 781 } 782 depth-- 783 case 5: 784 iNdEx += 4 785 default: 786 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 787 } 788 if iNdEx < 0 { 789 return 0, ErrInvalidLengthAuthz 790 } 791 if depth == 0 { 792 return iNdEx, nil 793 } 794 } 795 return 0, io.ErrUnexpectedEOF 796 } 797 798 var ( 799 ErrInvalidLengthAuthz = fmt.Errorf("proto: negative length found during unmarshaling") 800 ErrIntOverflowAuthz = fmt.Errorf("proto: integer overflow") 801 ErrUnexpectedEndOfGroupAuthz = fmt.Errorf("proto: unexpected end of group") 802 )