github.com/Finschia/finschia-sdk@v0.48.1/x/authz/authz.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: cosmos/authz/v1beta1/authz.proto 3 4 package authz 5 6 import ( 7 fmt "fmt" 8 types "github.com/Finschia/finschia-sdk/codec/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 _ "github.com/regen-network/cosmos-proto" 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 // GenericAuthorization gives the grantee unrestricted permissions to execute 33 // the provided method on behalf of the granter's account. 34 type GenericAuthorization struct { 35 // Msg, identified by it's type URL, to grant unrestricted permissions to execute 36 Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` 37 } 38 39 func (m *GenericAuthorization) Reset() { *m = GenericAuthorization{} } 40 func (m *GenericAuthorization) String() string { return proto.CompactTextString(m) } 41 func (*GenericAuthorization) ProtoMessage() {} 42 func (*GenericAuthorization) Descriptor() ([]byte, []int) { 43 return fileDescriptor_544dc2e84b61c637, []int{0} 44 } 45 func (m *GenericAuthorization) XXX_Unmarshal(b []byte) error { 46 return m.Unmarshal(b) 47 } 48 func (m *GenericAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 49 if deterministic { 50 return xxx_messageInfo_GenericAuthorization.Marshal(b, m, deterministic) 51 } else { 52 b = b[:cap(b)] 53 n, err := m.MarshalToSizedBuffer(b) 54 if err != nil { 55 return nil, err 56 } 57 return b[:n], nil 58 } 59 } 60 func (m *GenericAuthorization) XXX_Merge(src proto.Message) { 61 xxx_messageInfo_GenericAuthorization.Merge(m, src) 62 } 63 func (m *GenericAuthorization) XXX_Size() int { 64 return m.Size() 65 } 66 func (m *GenericAuthorization) XXX_DiscardUnknown() { 67 xxx_messageInfo_GenericAuthorization.DiscardUnknown(m) 68 } 69 70 var xxx_messageInfo_GenericAuthorization proto.InternalMessageInfo 71 72 // Grant gives permissions to execute 73 // the provide method with expiration time. 74 type Grant struct { 75 Authorization *types.Any `protobuf:"bytes,1,opt,name=authorization,proto3" json:"authorization,omitempty"` 76 Expiration time.Time `protobuf:"bytes,2,opt,name=expiration,proto3,stdtime" json:"expiration"` 77 } 78 79 func (m *Grant) Reset() { *m = Grant{} } 80 func (m *Grant) String() string { return proto.CompactTextString(m) } 81 func (*Grant) ProtoMessage() {} 82 func (*Grant) Descriptor() ([]byte, []int) { 83 return fileDescriptor_544dc2e84b61c637, []int{1} 84 } 85 func (m *Grant) XXX_Unmarshal(b []byte) error { 86 return m.Unmarshal(b) 87 } 88 func (m *Grant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 89 if deterministic { 90 return xxx_messageInfo_Grant.Marshal(b, m, deterministic) 91 } else { 92 b = b[:cap(b)] 93 n, err := m.MarshalToSizedBuffer(b) 94 if err != nil { 95 return nil, err 96 } 97 return b[:n], nil 98 } 99 } 100 func (m *Grant) XXX_Merge(src proto.Message) { 101 xxx_messageInfo_Grant.Merge(m, src) 102 } 103 func (m *Grant) XXX_Size() int { 104 return m.Size() 105 } 106 func (m *Grant) XXX_DiscardUnknown() { 107 xxx_messageInfo_Grant.DiscardUnknown(m) 108 } 109 110 var xxx_messageInfo_Grant proto.InternalMessageInfo 111 112 // GrantAuthorization extends a grant with both the addresses of the grantee and granter. 113 // It is used in genesis.proto and query.proto 114 // 115 // Since: cosmos-sdk 0.45.2 116 type GrantAuthorization struct { 117 Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` 118 Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` 119 Authorization *types.Any `protobuf:"bytes,3,opt,name=authorization,proto3" json:"authorization,omitempty"` 120 Expiration time.Time `protobuf:"bytes,4,opt,name=expiration,proto3,stdtime" json:"expiration"` 121 } 122 123 func (m *GrantAuthorization) Reset() { *m = GrantAuthorization{} } 124 func (m *GrantAuthorization) String() string { return proto.CompactTextString(m) } 125 func (*GrantAuthorization) ProtoMessage() {} 126 func (*GrantAuthorization) Descriptor() ([]byte, []int) { 127 return fileDescriptor_544dc2e84b61c637, []int{2} 128 } 129 func (m *GrantAuthorization) XXX_Unmarshal(b []byte) error { 130 return m.Unmarshal(b) 131 } 132 func (m *GrantAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 133 if deterministic { 134 return xxx_messageInfo_GrantAuthorization.Marshal(b, m, deterministic) 135 } else { 136 b = b[:cap(b)] 137 n, err := m.MarshalToSizedBuffer(b) 138 if err != nil { 139 return nil, err 140 } 141 return b[:n], nil 142 } 143 } 144 func (m *GrantAuthorization) XXX_Merge(src proto.Message) { 145 xxx_messageInfo_GrantAuthorization.Merge(m, src) 146 } 147 func (m *GrantAuthorization) XXX_Size() int { 148 return m.Size() 149 } 150 func (m *GrantAuthorization) XXX_DiscardUnknown() { 151 xxx_messageInfo_GrantAuthorization.DiscardUnknown(m) 152 } 153 154 var xxx_messageInfo_GrantAuthorization proto.InternalMessageInfo 155 156 func init() { 157 proto.RegisterType((*GenericAuthorization)(nil), "cosmos.authz.v1beta1.GenericAuthorization") 158 proto.RegisterType((*Grant)(nil), "cosmos.authz.v1beta1.Grant") 159 proto.RegisterType((*GrantAuthorization)(nil), "cosmos.authz.v1beta1.GrantAuthorization") 160 } 161 162 func init() { proto.RegisterFile("cosmos/authz/v1beta1/authz.proto", fileDescriptor_544dc2e84b61c637) } 163 164 var fileDescriptor_544dc2e84b61c637 = []byte{ 165 // 350 bytes of a gzipped FileDescriptorProto 166 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0xbb, 0x6e, 0xf2, 0x30, 167 0x14, 0x8e, 0x7f, 0xfe, 0xde, 0x5c, 0x21, 0x95, 0x28, 0x03, 0x30, 0x18, 0xc4, 0xc4, 0x42, 0x2c, 168 0xda, 0xad, 0x9d, 0x40, 0x15, 0x4c, 0x5d, 0x50, 0xa7, 0x2e, 0x95, 0x93, 0x1a, 0xc7, 0x6a, 0x13, 169 0xa3, 0xc4, 0xa9, 0x80, 0xa7, 0xe0, 0x01, 0xfa, 0x18, 0x7d, 0x08, 0xd4, 0x09, 0x75, 0xea, 0xd2, 170 0x1b, 0xbc, 0x48, 0x85, 0x6d, 0x5a, 0x02, 0x5b, 0xd5, 0xed, 0x9c, 0xf3, 0xdd, 0xfc, 0x49, 0x86, 171 0x55, 0x5f, 0x24, 0xa1, 0x48, 0x30, 0x49, 0x65, 0x30, 0xc6, 0xf7, 0x4d, 0x8f, 0x4a, 0xd2, 0xd4, 172 0x9b, 0x3b, 0x88, 0x85, 0x14, 0xb6, 0xa3, 0x19, 0xae, 0xbe, 0x19, 0x46, 0xb9, 0xa4, 0xaf, 0xd7, 173 0x8a, 0x83, 0x0d, 0x45, 0x2d, 0xe5, 0x0a, 0x13, 0x82, 0xdd, 0x51, 0xac, 0x36, 0x2f, 0xed, 0x63, 174 0xc9, 0x43, 0x9a, 0x48, 0x12, 0x0e, 0x0c, 0xc1, 0x61, 0x82, 0x09, 0x2d, 0x5c, 0x4e, 0xe6, 0x5a, 175 0xda, 0x94, 0x91, 0x68, 0xa4, 0xa1, 0xda, 0x19, 0x74, 0xba, 0x34, 0xa2, 0x31, 0xf7, 0x5b, 0xa9, 176 0x0c, 0x44, 0xcc, 0xc7, 0x44, 0x72, 0x11, 0xd9, 0x47, 0x30, 0x17, 0x26, 0xac, 0x08, 0xaa, 0xa0, 177 0x7e, 0xd0, 0x5b, 0x8e, 0xa7, 0x85, 0xe7, 0xc7, 0x46, 0x3e, 0x43, 0xaa, 0x3d, 0x00, 0xb8, 0xd3, 178 0x8d, 0x49, 0x24, 0xed, 0x0b, 0x98, 0x27, 0xeb, 0x90, 0x12, 0x1e, 0x1e, 0x3b, 0xae, 0x4e, 0x76, 179 0x57, 0xc9, 0x6e, 0x2b, 0x1a, 0xb5, 0x0b, 0x4f, 0x9b, 0x4e, 0xbd, 0xac, 0xda, 0x3e, 0x87, 0x90, 180 0x0e, 0x07, 0x3c, 0xd6, 0x5e, 0xff, 0x94, 0x57, 0x79, 0xcb, 0xeb, 0x72, 0x55, 0xbe, 0xbd, 0x3f, 181 0x7d, 0xab, 0x58, 0x93, 0xf7, 0x0a, 0xe8, 0xad, 0xe9, 0x6a, 0xaf, 0x00, 0xda, 0xea, 0x79, 0xd9, 182 0x6a, 0x45, 0xb8, 0xc7, 0x96, 0x57, 0x1a, 0x9b, 0x7a, 0xab, 0xf5, 0x07, 0xa1, 0x2a, 0xf3, 0x1b, 183 0xa1, 0xdb, 0xfd, 0x72, 0x7f, 0xd8, 0xef, 0xff, 0xef, 0xfa, 0xb5, 0x3b, 0xd3, 0x4f, 0x64, 0x4d, 184 0xe7, 0x08, 0xcc, 0xe6, 0x08, 0x7c, 0xcc, 0x11, 0x98, 0x2c, 0x90, 0x35, 0x5b, 0x20, 0xeb, 0x65, 185 0x81, 0xac, 0xab, 0x3a, 0xe3, 0x32, 0x48, 0x3d, 0xd7, 0x17, 0x21, 0xee, 0xf0, 0x28, 0xf1, 0x03, 186 0x4e, 0x70, 0xdf, 0x0c, 0x8d, 0xe4, 0xe6, 0x16, 0x0f, 0xf5, 0x67, 0xf4, 0x76, 0x55, 0xe2, 0xc9, 187 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x62, 0xb1, 0x05, 0x21, 0xb1, 0x02, 0x00, 0x00, 188 } 189 190 func (m *GenericAuthorization) Marshal() (dAtA []byte, err error) { 191 size := m.Size() 192 dAtA = make([]byte, size) 193 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 194 if err != nil { 195 return nil, err 196 } 197 return dAtA[:n], nil 198 } 199 200 func (m *GenericAuthorization) MarshalTo(dAtA []byte) (int, error) { 201 size := m.Size() 202 return m.MarshalToSizedBuffer(dAtA[:size]) 203 } 204 205 func (m *GenericAuthorization) MarshalToSizedBuffer(dAtA []byte) (int, error) { 206 i := len(dAtA) 207 _ = i 208 var l int 209 _ = l 210 if len(m.Msg) > 0 { 211 i -= len(m.Msg) 212 copy(dAtA[i:], m.Msg) 213 i = encodeVarintAuthz(dAtA, i, uint64(len(m.Msg))) 214 i-- 215 dAtA[i] = 0xa 216 } 217 return len(dAtA) - i, nil 218 } 219 220 func (m *Grant) Marshal() (dAtA []byte, err error) { 221 size := m.Size() 222 dAtA = make([]byte, size) 223 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 224 if err != nil { 225 return nil, err 226 } 227 return dAtA[:n], nil 228 } 229 230 func (m *Grant) MarshalTo(dAtA []byte) (int, error) { 231 size := m.Size() 232 return m.MarshalToSizedBuffer(dAtA[:size]) 233 } 234 235 func (m *Grant) MarshalToSizedBuffer(dAtA []byte) (int, error) { 236 i := len(dAtA) 237 _ = i 238 var l int 239 _ = l 240 n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Expiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Expiration):]) 241 if err1 != nil { 242 return 0, err1 243 } 244 i -= n1 245 i = encodeVarintAuthz(dAtA, i, uint64(n1)) 246 i-- 247 dAtA[i] = 0x12 248 if m.Authorization != nil { 249 { 250 size, err := m.Authorization.MarshalToSizedBuffer(dAtA[:i]) 251 if err != nil { 252 return 0, err 253 } 254 i -= size 255 i = encodeVarintAuthz(dAtA, i, uint64(size)) 256 } 257 i-- 258 dAtA[i] = 0xa 259 } 260 return len(dAtA) - i, nil 261 } 262 263 func (m *GrantAuthorization) Marshal() (dAtA []byte, err error) { 264 size := m.Size() 265 dAtA = make([]byte, size) 266 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 267 if err != nil { 268 return nil, err 269 } 270 return dAtA[:n], nil 271 } 272 273 func (m *GrantAuthorization) MarshalTo(dAtA []byte) (int, error) { 274 size := m.Size() 275 return m.MarshalToSizedBuffer(dAtA[:size]) 276 } 277 278 func (m *GrantAuthorization) MarshalToSizedBuffer(dAtA []byte) (int, error) { 279 i := len(dAtA) 280 _ = i 281 var l int 282 _ = l 283 n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Expiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Expiration):]) 284 if err3 != nil { 285 return 0, err3 286 } 287 i -= n3 288 i = encodeVarintAuthz(dAtA, i, uint64(n3)) 289 i-- 290 dAtA[i] = 0x22 291 if m.Authorization != nil { 292 { 293 size, err := m.Authorization.MarshalToSizedBuffer(dAtA[:i]) 294 if err != nil { 295 return 0, err 296 } 297 i -= size 298 i = encodeVarintAuthz(dAtA, i, uint64(size)) 299 } 300 i-- 301 dAtA[i] = 0x1a 302 } 303 if len(m.Grantee) > 0 { 304 i -= len(m.Grantee) 305 copy(dAtA[i:], m.Grantee) 306 i = encodeVarintAuthz(dAtA, i, uint64(len(m.Grantee))) 307 i-- 308 dAtA[i] = 0x12 309 } 310 if len(m.Granter) > 0 { 311 i -= len(m.Granter) 312 copy(dAtA[i:], m.Granter) 313 i = encodeVarintAuthz(dAtA, i, uint64(len(m.Granter))) 314 i-- 315 dAtA[i] = 0xa 316 } 317 return len(dAtA) - i, nil 318 } 319 320 func encodeVarintAuthz(dAtA []byte, offset int, v uint64) int { 321 offset -= sovAuthz(v) 322 base := offset 323 for v >= 1<<7 { 324 dAtA[offset] = uint8(v&0x7f | 0x80) 325 v >>= 7 326 offset++ 327 } 328 dAtA[offset] = uint8(v) 329 return base 330 } 331 func (m *GenericAuthorization) Size() (n int) { 332 if m == nil { 333 return 0 334 } 335 var l int 336 _ = l 337 l = len(m.Msg) 338 if l > 0 { 339 n += 1 + l + sovAuthz(uint64(l)) 340 } 341 return n 342 } 343 344 func (m *Grant) Size() (n int) { 345 if m == nil { 346 return 0 347 } 348 var l int 349 _ = l 350 if m.Authorization != nil { 351 l = m.Authorization.Size() 352 n += 1 + l + sovAuthz(uint64(l)) 353 } 354 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Expiration) 355 n += 1 + l + sovAuthz(uint64(l)) 356 return n 357 } 358 359 func (m *GrantAuthorization) Size() (n int) { 360 if m == nil { 361 return 0 362 } 363 var l int 364 _ = l 365 l = len(m.Granter) 366 if l > 0 { 367 n += 1 + l + sovAuthz(uint64(l)) 368 } 369 l = len(m.Grantee) 370 if l > 0 { 371 n += 1 + l + sovAuthz(uint64(l)) 372 } 373 if m.Authorization != nil { 374 l = m.Authorization.Size() 375 n += 1 + l + sovAuthz(uint64(l)) 376 } 377 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Expiration) 378 n += 1 + l + sovAuthz(uint64(l)) 379 return n 380 } 381 382 func sovAuthz(x uint64) (n int) { 383 return (math_bits.Len64(x|1) + 6) / 7 384 } 385 func sozAuthz(x uint64) (n int) { 386 return sovAuthz(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 387 } 388 func (m *GenericAuthorization) Unmarshal(dAtA []byte) error { 389 l := len(dAtA) 390 iNdEx := 0 391 for iNdEx < l { 392 preIndex := iNdEx 393 var wire uint64 394 for shift := uint(0); ; shift += 7 { 395 if shift >= 64 { 396 return ErrIntOverflowAuthz 397 } 398 if iNdEx >= l { 399 return io.ErrUnexpectedEOF 400 } 401 b := dAtA[iNdEx] 402 iNdEx++ 403 wire |= uint64(b&0x7F) << shift 404 if b < 0x80 { 405 break 406 } 407 } 408 fieldNum := int32(wire >> 3) 409 wireType := int(wire & 0x7) 410 if wireType == 4 { 411 return fmt.Errorf("proto: GenericAuthorization: wiretype end group for non-group") 412 } 413 if fieldNum <= 0 { 414 return fmt.Errorf("proto: GenericAuthorization: illegal tag %d (wire type %d)", fieldNum, wire) 415 } 416 switch fieldNum { 417 case 1: 418 if wireType != 2 { 419 return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) 420 } 421 var stringLen uint64 422 for shift := uint(0); ; shift += 7 { 423 if shift >= 64 { 424 return ErrIntOverflowAuthz 425 } 426 if iNdEx >= l { 427 return io.ErrUnexpectedEOF 428 } 429 b := dAtA[iNdEx] 430 iNdEx++ 431 stringLen |= uint64(b&0x7F) << shift 432 if b < 0x80 { 433 break 434 } 435 } 436 intStringLen := int(stringLen) 437 if intStringLen < 0 { 438 return ErrInvalidLengthAuthz 439 } 440 postIndex := iNdEx + intStringLen 441 if postIndex < 0 { 442 return ErrInvalidLengthAuthz 443 } 444 if postIndex > l { 445 return io.ErrUnexpectedEOF 446 } 447 m.Msg = string(dAtA[iNdEx:postIndex]) 448 iNdEx = postIndex 449 default: 450 iNdEx = preIndex 451 skippy, err := skipAuthz(dAtA[iNdEx:]) 452 if err != nil { 453 return err 454 } 455 if (skippy < 0) || (iNdEx+skippy) < 0 { 456 return ErrInvalidLengthAuthz 457 } 458 if (iNdEx + skippy) > l { 459 return io.ErrUnexpectedEOF 460 } 461 iNdEx += skippy 462 } 463 } 464 465 if iNdEx > l { 466 return io.ErrUnexpectedEOF 467 } 468 return nil 469 } 470 func (m *Grant) Unmarshal(dAtA []byte) error { 471 l := len(dAtA) 472 iNdEx := 0 473 for iNdEx < l { 474 preIndex := iNdEx 475 var wire uint64 476 for shift := uint(0); ; shift += 7 { 477 if shift >= 64 { 478 return ErrIntOverflowAuthz 479 } 480 if iNdEx >= l { 481 return io.ErrUnexpectedEOF 482 } 483 b := dAtA[iNdEx] 484 iNdEx++ 485 wire |= uint64(b&0x7F) << shift 486 if b < 0x80 { 487 break 488 } 489 } 490 fieldNum := int32(wire >> 3) 491 wireType := int(wire & 0x7) 492 if wireType == 4 { 493 return fmt.Errorf("proto: Grant: wiretype end group for non-group") 494 } 495 if fieldNum <= 0 { 496 return fmt.Errorf("proto: Grant: illegal tag %d (wire type %d)", fieldNum, wire) 497 } 498 switch fieldNum { 499 case 1: 500 if wireType != 2 { 501 return fmt.Errorf("proto: wrong wireType = %d for field Authorization", wireType) 502 } 503 var msglen int 504 for shift := uint(0); ; shift += 7 { 505 if shift >= 64 { 506 return ErrIntOverflowAuthz 507 } 508 if iNdEx >= l { 509 return io.ErrUnexpectedEOF 510 } 511 b := dAtA[iNdEx] 512 iNdEx++ 513 msglen |= int(b&0x7F) << shift 514 if b < 0x80 { 515 break 516 } 517 } 518 if msglen < 0 { 519 return ErrInvalidLengthAuthz 520 } 521 postIndex := iNdEx + msglen 522 if postIndex < 0 { 523 return ErrInvalidLengthAuthz 524 } 525 if postIndex > l { 526 return io.ErrUnexpectedEOF 527 } 528 if m.Authorization == nil { 529 m.Authorization = &types.Any{} 530 } 531 if err := m.Authorization.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 532 return err 533 } 534 iNdEx = postIndex 535 case 2: 536 if wireType != 2 { 537 return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) 538 } 539 var msglen int 540 for shift := uint(0); ; shift += 7 { 541 if shift >= 64 { 542 return ErrIntOverflowAuthz 543 } 544 if iNdEx >= l { 545 return io.ErrUnexpectedEOF 546 } 547 b := dAtA[iNdEx] 548 iNdEx++ 549 msglen |= int(b&0x7F) << shift 550 if b < 0x80 { 551 break 552 } 553 } 554 if msglen < 0 { 555 return ErrInvalidLengthAuthz 556 } 557 postIndex := iNdEx + msglen 558 if postIndex < 0 { 559 return ErrInvalidLengthAuthz 560 } 561 if postIndex > l { 562 return io.ErrUnexpectedEOF 563 } 564 if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Expiration, dAtA[iNdEx:postIndex]); err != nil { 565 return err 566 } 567 iNdEx = postIndex 568 default: 569 iNdEx = preIndex 570 skippy, err := skipAuthz(dAtA[iNdEx:]) 571 if err != nil { 572 return err 573 } 574 if (skippy < 0) || (iNdEx+skippy) < 0 { 575 return ErrInvalidLengthAuthz 576 } 577 if (iNdEx + skippy) > l { 578 return io.ErrUnexpectedEOF 579 } 580 iNdEx += skippy 581 } 582 } 583 584 if iNdEx > l { 585 return io.ErrUnexpectedEOF 586 } 587 return nil 588 } 589 func (m *GrantAuthorization) Unmarshal(dAtA []byte) error { 590 l := len(dAtA) 591 iNdEx := 0 592 for iNdEx < l { 593 preIndex := iNdEx 594 var wire uint64 595 for shift := uint(0); ; shift += 7 { 596 if shift >= 64 { 597 return ErrIntOverflowAuthz 598 } 599 if iNdEx >= l { 600 return io.ErrUnexpectedEOF 601 } 602 b := dAtA[iNdEx] 603 iNdEx++ 604 wire |= uint64(b&0x7F) << shift 605 if b < 0x80 { 606 break 607 } 608 } 609 fieldNum := int32(wire >> 3) 610 wireType := int(wire & 0x7) 611 if wireType == 4 { 612 return fmt.Errorf("proto: GrantAuthorization: wiretype end group for non-group") 613 } 614 if fieldNum <= 0 { 615 return fmt.Errorf("proto: GrantAuthorization: illegal tag %d (wire type %d)", fieldNum, wire) 616 } 617 switch fieldNum { 618 case 1: 619 if wireType != 2 { 620 return fmt.Errorf("proto: wrong wireType = %d for field Granter", wireType) 621 } 622 var stringLen uint64 623 for shift := uint(0); ; shift += 7 { 624 if shift >= 64 { 625 return ErrIntOverflowAuthz 626 } 627 if iNdEx >= l { 628 return io.ErrUnexpectedEOF 629 } 630 b := dAtA[iNdEx] 631 iNdEx++ 632 stringLen |= uint64(b&0x7F) << shift 633 if b < 0x80 { 634 break 635 } 636 } 637 intStringLen := int(stringLen) 638 if intStringLen < 0 { 639 return ErrInvalidLengthAuthz 640 } 641 postIndex := iNdEx + intStringLen 642 if postIndex < 0 { 643 return ErrInvalidLengthAuthz 644 } 645 if postIndex > l { 646 return io.ErrUnexpectedEOF 647 } 648 m.Granter = string(dAtA[iNdEx:postIndex]) 649 iNdEx = postIndex 650 case 2: 651 if wireType != 2 { 652 return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) 653 } 654 var stringLen uint64 655 for shift := uint(0); ; shift += 7 { 656 if shift >= 64 { 657 return ErrIntOverflowAuthz 658 } 659 if iNdEx >= l { 660 return io.ErrUnexpectedEOF 661 } 662 b := dAtA[iNdEx] 663 iNdEx++ 664 stringLen |= uint64(b&0x7F) << shift 665 if b < 0x80 { 666 break 667 } 668 } 669 intStringLen := int(stringLen) 670 if intStringLen < 0 { 671 return ErrInvalidLengthAuthz 672 } 673 postIndex := iNdEx + intStringLen 674 if postIndex < 0 { 675 return ErrInvalidLengthAuthz 676 } 677 if postIndex > l { 678 return io.ErrUnexpectedEOF 679 } 680 m.Grantee = string(dAtA[iNdEx:postIndex]) 681 iNdEx = postIndex 682 case 3: 683 if wireType != 2 { 684 return fmt.Errorf("proto: wrong wireType = %d for field Authorization", wireType) 685 } 686 var msglen int 687 for shift := uint(0); ; shift += 7 { 688 if shift >= 64 { 689 return ErrIntOverflowAuthz 690 } 691 if iNdEx >= l { 692 return io.ErrUnexpectedEOF 693 } 694 b := dAtA[iNdEx] 695 iNdEx++ 696 msglen |= int(b&0x7F) << shift 697 if b < 0x80 { 698 break 699 } 700 } 701 if msglen < 0 { 702 return ErrInvalidLengthAuthz 703 } 704 postIndex := iNdEx + msglen 705 if postIndex < 0 { 706 return ErrInvalidLengthAuthz 707 } 708 if postIndex > l { 709 return io.ErrUnexpectedEOF 710 } 711 if m.Authorization == nil { 712 m.Authorization = &types.Any{} 713 } 714 if err := m.Authorization.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 715 return err 716 } 717 iNdEx = postIndex 718 case 4: 719 if wireType != 2 { 720 return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) 721 } 722 var msglen int 723 for shift := uint(0); ; shift += 7 { 724 if shift >= 64 { 725 return ErrIntOverflowAuthz 726 } 727 if iNdEx >= l { 728 return io.ErrUnexpectedEOF 729 } 730 b := dAtA[iNdEx] 731 iNdEx++ 732 msglen |= int(b&0x7F) << shift 733 if b < 0x80 { 734 break 735 } 736 } 737 if msglen < 0 { 738 return ErrInvalidLengthAuthz 739 } 740 postIndex := iNdEx + msglen 741 if postIndex < 0 { 742 return ErrInvalidLengthAuthz 743 } 744 if postIndex > l { 745 return io.ErrUnexpectedEOF 746 } 747 if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Expiration, dAtA[iNdEx:postIndex]); err != nil { 748 return err 749 } 750 iNdEx = postIndex 751 default: 752 iNdEx = preIndex 753 skippy, err := skipAuthz(dAtA[iNdEx:]) 754 if err != nil { 755 return err 756 } 757 if (skippy < 0) || (iNdEx+skippy) < 0 { 758 return ErrInvalidLengthAuthz 759 } 760 if (iNdEx + skippy) > l { 761 return io.ErrUnexpectedEOF 762 } 763 iNdEx += skippy 764 } 765 } 766 767 if iNdEx > l { 768 return io.ErrUnexpectedEOF 769 } 770 return nil 771 } 772 func skipAuthz(dAtA []byte) (n int, err error) { 773 l := len(dAtA) 774 iNdEx := 0 775 depth := 0 776 for iNdEx < l { 777 var wire uint64 778 for shift := uint(0); ; shift += 7 { 779 if shift >= 64 { 780 return 0, ErrIntOverflowAuthz 781 } 782 if iNdEx >= l { 783 return 0, io.ErrUnexpectedEOF 784 } 785 b := dAtA[iNdEx] 786 iNdEx++ 787 wire |= (uint64(b) & 0x7F) << shift 788 if b < 0x80 { 789 break 790 } 791 } 792 wireType := int(wire & 0x7) 793 switch wireType { 794 case 0: 795 for shift := uint(0); ; shift += 7 { 796 if shift >= 64 { 797 return 0, ErrIntOverflowAuthz 798 } 799 if iNdEx >= l { 800 return 0, io.ErrUnexpectedEOF 801 } 802 iNdEx++ 803 if dAtA[iNdEx-1] < 0x80 { 804 break 805 } 806 } 807 case 1: 808 iNdEx += 8 809 case 2: 810 var length int 811 for shift := uint(0); ; shift += 7 { 812 if shift >= 64 { 813 return 0, ErrIntOverflowAuthz 814 } 815 if iNdEx >= l { 816 return 0, io.ErrUnexpectedEOF 817 } 818 b := dAtA[iNdEx] 819 iNdEx++ 820 length |= (int(b) & 0x7F) << shift 821 if b < 0x80 { 822 break 823 } 824 } 825 if length < 0 { 826 return 0, ErrInvalidLengthAuthz 827 } 828 iNdEx += length 829 case 3: 830 depth++ 831 case 4: 832 if depth == 0 { 833 return 0, ErrUnexpectedEndOfGroupAuthz 834 } 835 depth-- 836 case 5: 837 iNdEx += 4 838 default: 839 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 840 } 841 if iNdEx < 0 { 842 return 0, ErrInvalidLengthAuthz 843 } 844 if depth == 0 { 845 return iNdEx, nil 846 } 847 } 848 return 0, io.ErrUnexpectedEOF 849 } 850 851 var ( 852 ErrInvalidLengthAuthz = fmt.Errorf("proto: negative length found during unmarshaling") 853 ErrIntOverflowAuthz = fmt.Errorf("proto: integer overflow") 854 ErrUnexpectedEndOfGroupAuthz = fmt.Errorf("proto: unexpected end of group") 855 )