github.com/Finschia/finschia-sdk@v0.48.1/x/token/token.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: lbm/token/v1/token.proto 3 4 package token 5 6 import ( 7 fmt "fmt" 8 _ "github.com/gogo/protobuf/gogoproto" 9 proto "github.com/gogo/protobuf/proto" 10 io "io" 11 math "math" 12 math_bits "math/bits" 13 ) 14 15 // Reference imports to suppress errors if they are not otherwise used. 16 var _ = proto.Marshal 17 var _ = fmt.Errorf 18 var _ = math.Inf 19 20 // This is a compile-time assertion to ensure that this generated file 21 // is compatible with the proto package it is being compiled against. 22 // A compilation error at this line likely means your copy of the 23 // proto package needs to be updated. 24 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 25 26 // Permission enumerates the valid permissions on a contract. 27 type Permission int32 28 29 const ( 30 // unspecified defines the default permission which is invalid. 31 PermissionUnspecified Permission = 0 32 // PERMISSION_MODIFY defines a permission to modify a contract. 33 PermissionModify Permission = 1 34 // PERMISSION_MINT defines a permission to mint tokens of a contract. 35 PermissionMint Permission = 2 36 // PERMISSION_BURN defines a permission to burn tokens of a contract. 37 PermissionBurn Permission = 3 38 ) 39 40 var Permission_name = map[int32]string{ 41 0: "PERMISSION_UNSPECIFIED", 42 1: "PERMISSION_MODIFY", 43 2: "PERMISSION_MINT", 44 3: "PERMISSION_BURN", 45 } 46 47 var Permission_value = map[string]int32{ 48 "PERMISSION_UNSPECIFIED": 0, 49 "PERMISSION_MODIFY": 1, 50 "PERMISSION_MINT": 2, 51 "PERMISSION_BURN": 3, 52 } 53 54 func (x Permission) String() string { 55 return proto.EnumName(Permission_name, int32(x)) 56 } 57 58 func (Permission) EnumDescriptor() ([]byte, []int) { 59 return fileDescriptor_1cc82dfde9e68378, []int{0} 60 } 61 62 // Deprecated: use Permission 63 // 64 // LegacyPermission enumerates the valid permissions on a contract. 65 type LegacyPermission int32 66 67 const ( 68 // unspecified defines the default permission which is invalid. 69 LegacyPermissionUnspecified LegacyPermission = 0 70 // modify defines a permission to modify a contract. 71 LegacyPermissionModify LegacyPermission = 1 72 // mint defines a permission to mint tokens of a contract. 73 LegacyPermissionMint LegacyPermission = 2 74 // burn defines a permission to burn tokens of a contract. 75 LegacyPermissionBurn LegacyPermission = 3 76 ) 77 78 var LegacyPermission_name = map[int32]string{ 79 0: "LEGACY_PERMISSION_UNSPECIFIED", 80 1: "LEGACY_PERMISSION_MODIFY", 81 2: "LEGACY_PERMISSION_MINT", 82 3: "LEGACY_PERMISSION_BURN", 83 } 84 85 var LegacyPermission_value = map[string]int32{ 86 "LEGACY_PERMISSION_UNSPECIFIED": 0, 87 "LEGACY_PERMISSION_MODIFY": 1, 88 "LEGACY_PERMISSION_MINT": 2, 89 "LEGACY_PERMISSION_BURN": 3, 90 } 91 92 func (LegacyPermission) EnumDescriptor() ([]byte, []int) { 93 return fileDescriptor_1cc82dfde9e68378, []int{1} 94 } 95 96 // Params defines the parameters for the token module. 97 type Params struct { 98 } 99 100 func (m *Params) Reset() { *m = Params{} } 101 func (m *Params) String() string { return proto.CompactTextString(m) } 102 func (*Params) ProtoMessage() {} 103 func (*Params) Descriptor() ([]byte, []int) { 104 return fileDescriptor_1cc82dfde9e68378, []int{0} 105 } 106 func (m *Params) XXX_Unmarshal(b []byte) error { 107 return m.Unmarshal(b) 108 } 109 func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 110 if deterministic { 111 return xxx_messageInfo_Params.Marshal(b, m, deterministic) 112 } else { 113 b = b[:cap(b)] 114 n, err := m.MarshalToSizedBuffer(b) 115 if err != nil { 116 return nil, err 117 } 118 return b[:n], nil 119 } 120 } 121 func (m *Params) XXX_Merge(src proto.Message) { 122 xxx_messageInfo_Params.Merge(m, src) 123 } 124 func (m *Params) XXX_Size() int { 125 return m.Size() 126 } 127 func (m *Params) XXX_DiscardUnknown() { 128 xxx_messageInfo_Params.DiscardUnknown(m) 129 } 130 131 var xxx_messageInfo_Params proto.InternalMessageInfo 132 133 // Contract defines token information. 134 type Contract struct { 135 // id defines the unique identifier of the contract. 136 Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` 137 // name defines the human-readable name of the contract. mandatory (not ERC20 compliant). 138 Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` 139 // symbol is an abbreviated name for contract. mandatory (not ERC20 compliant). 140 Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` 141 // an uri for the image of the contract stored off chain. 142 Uri string `protobuf:"bytes,4,opt,name=uri,proto3" json:"uri,omitempty"` 143 // meta is a brief description of contract. 144 Meta string `protobuf:"bytes,5,opt,name=meta,proto3" json:"meta,omitempty"` 145 // decimals is the number of decimals which one must divide the amount by to get its user representation. 146 Decimals int32 `protobuf:"varint,6,opt,name=decimals,proto3" json:"decimals,omitempty"` 147 // mintable represents whether the token is allowed to mint or burn. 148 Mintable bool `protobuf:"varint,7,opt,name=mintable,proto3" json:"mintable,omitempty"` 149 } 150 151 func (m *Contract) Reset() { *m = Contract{} } 152 func (m *Contract) String() string { return proto.CompactTextString(m) } 153 func (*Contract) ProtoMessage() {} 154 func (*Contract) Descriptor() ([]byte, []int) { 155 return fileDescriptor_1cc82dfde9e68378, []int{1} 156 } 157 func (m *Contract) XXX_Unmarshal(b []byte) error { 158 return m.Unmarshal(b) 159 } 160 func (m *Contract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 161 if deterministic { 162 return xxx_messageInfo_Contract.Marshal(b, m, deterministic) 163 } else { 164 b = b[:cap(b)] 165 n, err := m.MarshalToSizedBuffer(b) 166 if err != nil { 167 return nil, err 168 } 169 return b[:n], nil 170 } 171 } 172 func (m *Contract) XXX_Merge(src proto.Message) { 173 xxx_messageInfo_Contract.Merge(m, src) 174 } 175 func (m *Contract) XXX_Size() int { 176 return m.Size() 177 } 178 func (m *Contract) XXX_DiscardUnknown() { 179 xxx_messageInfo_Contract.DiscardUnknown(m) 180 } 181 182 var xxx_messageInfo_Contract proto.InternalMessageInfo 183 184 // Attribute defines a key and value of the attribute. 185 type Attribute struct { 186 Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` 187 Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` 188 } 189 190 func (m *Attribute) Reset() { *m = Attribute{} } 191 func (m *Attribute) String() string { return proto.CompactTextString(m) } 192 func (*Attribute) ProtoMessage() {} 193 func (*Attribute) Descriptor() ([]byte, []int) { 194 return fileDescriptor_1cc82dfde9e68378, []int{2} 195 } 196 func (m *Attribute) XXX_Unmarshal(b []byte) error { 197 return m.Unmarshal(b) 198 } 199 func (m *Attribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 200 if deterministic { 201 return xxx_messageInfo_Attribute.Marshal(b, m, deterministic) 202 } else { 203 b = b[:cap(b)] 204 n, err := m.MarshalToSizedBuffer(b) 205 if err != nil { 206 return nil, err 207 } 208 return b[:n], nil 209 } 210 } 211 func (m *Attribute) XXX_Merge(src proto.Message) { 212 xxx_messageInfo_Attribute.Merge(m, src) 213 } 214 func (m *Attribute) XXX_Size() int { 215 return m.Size() 216 } 217 func (m *Attribute) XXX_DiscardUnknown() { 218 xxx_messageInfo_Attribute.DiscardUnknown(m) 219 } 220 221 var xxx_messageInfo_Attribute proto.InternalMessageInfo 222 223 // Authorization defines an authorization given to the operator on tokens of the holder. 224 type Authorization struct { 225 // address of the token holder which approves the authorization. 226 Holder string `protobuf:"bytes,1,opt,name=holder,proto3" json:"holder,omitempty"` 227 // address of the operator which the authorization is granted to. 228 Operator string `protobuf:"bytes,2,opt,name=operator,proto3" json:"operator,omitempty"` 229 } 230 231 func (m *Authorization) Reset() { *m = Authorization{} } 232 func (m *Authorization) String() string { return proto.CompactTextString(m) } 233 func (*Authorization) ProtoMessage() {} 234 func (*Authorization) Descriptor() ([]byte, []int) { 235 return fileDescriptor_1cc82dfde9e68378, []int{3} 236 } 237 func (m *Authorization) XXX_Unmarshal(b []byte) error { 238 return m.Unmarshal(b) 239 } 240 func (m *Authorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 241 if deterministic { 242 return xxx_messageInfo_Authorization.Marshal(b, m, deterministic) 243 } else { 244 b = b[:cap(b)] 245 n, err := m.MarshalToSizedBuffer(b) 246 if err != nil { 247 return nil, err 248 } 249 return b[:n], nil 250 } 251 } 252 func (m *Authorization) XXX_Merge(src proto.Message) { 253 xxx_messageInfo_Authorization.Merge(m, src) 254 } 255 func (m *Authorization) XXX_Size() int { 256 return m.Size() 257 } 258 func (m *Authorization) XXX_DiscardUnknown() { 259 xxx_messageInfo_Authorization.DiscardUnknown(m) 260 } 261 262 var xxx_messageInfo_Authorization proto.InternalMessageInfo 263 264 // Grant defines permission given to a grantee. 265 type Grant struct { 266 // address of the grantee. 267 Grantee string `protobuf:"bytes,1,opt,name=grantee,proto3" json:"grantee,omitempty"` 268 // permission on the contract. 269 Permission Permission `protobuf:"varint,2,opt,name=permission,proto3,enum=lbm.token.v1.Permission" json:"permission,omitempty"` 270 } 271 272 func (m *Grant) Reset() { *m = Grant{} } 273 func (m *Grant) String() string { return proto.CompactTextString(m) } 274 func (*Grant) ProtoMessage() {} 275 func (*Grant) Descriptor() ([]byte, []int) { 276 return fileDescriptor_1cc82dfde9e68378, []int{4} 277 } 278 func (m *Grant) XXX_Unmarshal(b []byte) error { 279 return m.Unmarshal(b) 280 } 281 func (m *Grant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 282 if deterministic { 283 return xxx_messageInfo_Grant.Marshal(b, m, deterministic) 284 } else { 285 b = b[:cap(b)] 286 n, err := m.MarshalToSizedBuffer(b) 287 if err != nil { 288 return nil, err 289 } 290 return b[:n], nil 291 } 292 } 293 func (m *Grant) XXX_Merge(src proto.Message) { 294 xxx_messageInfo_Grant.Merge(m, src) 295 } 296 func (m *Grant) XXX_Size() int { 297 return m.Size() 298 } 299 func (m *Grant) XXX_DiscardUnknown() { 300 xxx_messageInfo_Grant.DiscardUnknown(m) 301 } 302 303 var xxx_messageInfo_Grant proto.InternalMessageInfo 304 305 func init() { 306 proto.RegisterEnum("lbm.token.v1.Permission", Permission_name, Permission_value) 307 proto.RegisterEnum("lbm.token.v1.LegacyPermission", LegacyPermission_name, LegacyPermission_value) 308 proto.RegisterType((*Params)(nil), "lbm.token.v1.Params") 309 proto.RegisterType((*Contract)(nil), "lbm.token.v1.Contract") 310 proto.RegisterType((*Attribute)(nil), "lbm.token.v1.Attribute") 311 proto.RegisterType((*Authorization)(nil), "lbm.token.v1.Authorization") 312 proto.RegisterType((*Grant)(nil), "lbm.token.v1.Grant") 313 } 314 315 func init() { proto.RegisterFile("lbm/token/v1/token.proto", fileDescriptor_1cc82dfde9e68378) } 316 317 var fileDescriptor_1cc82dfde9e68378 = []byte{ 318 // 581 bytes of a gzipped FileDescriptorProto 319 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0x41, 0x4f, 0x13, 0x41, 320 0x14, 0xde, 0x2d, 0xb4, 0x94, 0x17, 0xc5, 0x75, 0x52, 0x9b, 0x71, 0x8d, 0xeb, 0xa6, 0x17, 0x1b, 321 0x8c, 0x6d, 0x10, 0x4d, 0xb8, 0xd2, 0x52, 0x48, 0x0d, 0x94, 0xa6, 0xc8, 0x01, 0x3d, 0x90, 0xd9, 322 0xee, 0xd0, 0x4e, 0xd8, 0xdd, 0x69, 0x66, 0xa7, 0xc4, 0xfa, 0x03, 0x8c, 0xe9, 0xc9, 0x3f, 0xd0, 323 0x93, 0x1c, 0xf8, 0x29, 0x1c, 0x39, 0x7a, 0xd4, 0xf2, 0x47, 0xcc, 0xec, 0x2e, 0x65, 0x53, 0xea, 324 0xed, 0xfb, 0xde, 0xfb, 0xbe, 0x37, 0xef, 0x9b, 0xc9, 0x00, 0xf6, 0x1c, 0xbf, 0x2a, 0xf9, 0x39, 325 0x0d, 0xaa, 0x17, 0x1b, 0x31, 0xa8, 0x0c, 0x04, 0x97, 0x1c, 0x3d, 0xf2, 0x1c, 0xbf, 0x12, 0x17, 326 0x2e, 0x36, 0xcc, 0x42, 0x8f, 0xf7, 0x78, 0xd4, 0xa8, 0x2a, 0x14, 0x6b, 0x4a, 0x79, 0xc8, 0xb5, 327 0x89, 0x20, 0x7e, 0x58, 0xba, 0xd4, 0x21, 0x5f, 0xe7, 0x81, 0x14, 0xa4, 0x2b, 0xd1, 0x1a, 0x64, 328 0x98, 0x8b, 0x75, 0x5b, 0x2f, 0xaf, 0x76, 0x32, 0xcc, 0x45, 0x08, 0x96, 0x03, 0xe2, 0x53, 0x9c, 329 0x89, 0x2a, 0x11, 0x46, 0x45, 0xc8, 0x85, 0x23, 0xdf, 0xe1, 0x1e, 0x5e, 0x8a, 0xaa, 0x09, 0x43, 330 0x06, 0x2c, 0x0d, 0x05, 0xc3, 0xcb, 0x51, 0x51, 0x41, 0xe5, 0xf6, 0xa9, 0x24, 0x38, 0x1b, 0xbb, 331 0x15, 0x46, 0x26, 0xe4, 0x5d, 0xda, 0x65, 0x3e, 0xf1, 0x42, 0x9c, 0xb3, 0xf5, 0x72, 0xb6, 0x33, 332 0xe3, 0xaa, 0xe7, 0xb3, 0x40, 0x12, 0xc7, 0xa3, 0x78, 0xc5, 0xd6, 0xcb, 0xf9, 0xce, 0x8c, 0x97, 333 0x36, 0x61, 0x75, 0x5b, 0x4a, 0xc1, 0x9c, 0xa1, 0xa4, 0xea, 0xa8, 0x73, 0x3a, 0x4a, 0xf6, 0x54, 334 0x10, 0x15, 0x20, 0x7b, 0x41, 0xbc, 0xe1, 0xdd, 0xa6, 0x31, 0x29, 0xd5, 0xe1, 0xf1, 0xf6, 0x50, 335 0xf6, 0xb9, 0x60, 0xdf, 0x88, 0x64, 0x3c, 0x50, 0xbb, 0xf7, 0xb9, 0xe7, 0x52, 0x91, 0x78, 0x13, 336 0xa6, 0x4e, 0xe6, 0x03, 0x2a, 0x88, 0xe4, 0x22, 0x99, 0x30, 0xe3, 0xa5, 0x2f, 0x90, 0xdd, 0x13, 337 0x24, 0x90, 0x08, 0xc3, 0x4a, 0x4f, 0x01, 0x4a, 0x13, 0xf7, 0x1d, 0x45, 0x5b, 0x00, 0x03, 0x2a, 338 0x7c, 0x16, 0x86, 0x8c, 0x07, 0xd1, 0x80, 0xb5, 0x77, 0xb8, 0x92, 0x7e, 0x86, 0x4a, 0x7b, 0xd6, 339 0xef, 0xa4, 0xb4, 0xeb, 0xd7, 0x3a, 0xc0, 0x7d, 0x0b, 0x7d, 0x80, 0x62, 0xbb, 0xd1, 0x39, 0x68, 340 0x1e, 0x1d, 0x35, 0x0f, 0x5b, 0xa7, 0xc7, 0xad, 0xa3, 0x76, 0xa3, 0xde, 0xdc, 0x6d, 0x36, 0x76, 341 0x0c, 0xcd, 0x7c, 0x3e, 0x9e, 0xd8, 0xcf, 0xee, 0xb5, 0xc7, 0x41, 0x38, 0xa0, 0x5d, 0x76, 0xc6, 342 0xa8, 0x8b, 0xde, 0xc0, 0xd3, 0x94, 0xed, 0xe0, 0x70, 0xa7, 0xb9, 0x7b, 0x62, 0xe8, 0x66, 0x61, 343 0x3c, 0xb1, 0x8d, 0x7b, 0xc7, 0x01, 0x77, 0xd9, 0xd9, 0x08, 0xbd, 0x86, 0x27, 0x69, 0x71, 0xb3, 344 0xf5, 0xc9, 0xc8, 0x98, 0x68, 0x3c, 0xb1, 0xd7, 0x52, 0x52, 0x16, 0xc8, 0x39, 0x61, 0xed, 0xb8, 345 0xd3, 0x32, 0x96, 0xe6, 0x85, 0xb5, 0xa1, 0x08, 0xcc, 0xe5, 0x1f, 0xbf, 0x2c, 0x6d, 0xfd, 0x7b, 346 0x06, 0x8c, 0x7d, 0xda, 0x23, 0xdd, 0x51, 0x2a, 0x50, 0x0d, 0x5e, 0xee, 0x37, 0xf6, 0xb6, 0xeb, 347 0x27, 0xa7, 0xff, 0xcd, 0xf5, 0x6a, 0x3c, 0xb1, 0x5f, 0xcc, 0x1b, 0xd3, 0xe9, 0xb6, 0x00, 0x3f, 348 0x9c, 0x31, 0x0b, 0x69, 0x8e, 0x27, 0x76, 0x71, 0xde, 0x9e, 0x44, 0x7d, 0x0f, 0xc5, 0x05, 0xce, 349 0x38, 0x31, 0x1e, 0x4f, 0xec, 0xc2, 0x03, 0x9f, 0xca, 0xbd, 0xd0, 0x95, 0xc4, 0x5f, 0xe8, 0x8a, 350 0x2e, 0x21, 0xaf, 0x2e, 0xe1, 0xea, 0xd2, 0xd2, 0x6a, 0x1f, 0xaf, 0xff, 0x5a, 0xda, 0xd5, 0xd4, 351 0xd2, 0xae, 0xa7, 0x96, 0x7e, 0x33, 0xb5, 0xf4, 0x3f, 0x53, 0x4b, 0xff, 0x79, 0x6b, 0x69, 0x37, 352 0xb7, 0x96, 0xf6, 0xfb, 0xd6, 0xd2, 0x3e, 0x97, 0x7b, 0x4c, 0xf6, 0x87, 0x4e, 0xa5, 0xcb, 0xfd, 353 0xea, 0x2e, 0x0b, 0xc2, 0x6e, 0x9f, 0x91, 0xea, 0x59, 0x02, 0xde, 0x86, 0xee, 0x79, 0xf5, 0x6b, 354 0xfc, 0xa3, 0x9d, 0x5c, 0xf4, 0x5d, 0x37, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x2c, 0x77, 0x38, 355 0x75, 0xee, 0x03, 0x00, 0x00, 356 } 357 358 func (m *Params) Marshal() (dAtA []byte, err error) { 359 size := m.Size() 360 dAtA = make([]byte, size) 361 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 362 if err != nil { 363 return nil, err 364 } 365 return dAtA[:n], nil 366 } 367 368 func (m *Params) MarshalTo(dAtA []byte) (int, error) { 369 size := m.Size() 370 return m.MarshalToSizedBuffer(dAtA[:size]) 371 } 372 373 func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { 374 i := len(dAtA) 375 _ = i 376 var l int 377 _ = l 378 return len(dAtA) - i, nil 379 } 380 381 func (m *Contract) Marshal() (dAtA []byte, err error) { 382 size := m.Size() 383 dAtA = make([]byte, size) 384 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 385 if err != nil { 386 return nil, err 387 } 388 return dAtA[:n], nil 389 } 390 391 func (m *Contract) MarshalTo(dAtA []byte) (int, error) { 392 size := m.Size() 393 return m.MarshalToSizedBuffer(dAtA[:size]) 394 } 395 396 func (m *Contract) MarshalToSizedBuffer(dAtA []byte) (int, error) { 397 i := len(dAtA) 398 _ = i 399 var l int 400 _ = l 401 if m.Mintable { 402 i-- 403 if m.Mintable { 404 dAtA[i] = 1 405 } else { 406 dAtA[i] = 0 407 } 408 i-- 409 dAtA[i] = 0x38 410 } 411 if m.Decimals != 0 { 412 i = encodeVarintToken(dAtA, i, uint64(m.Decimals)) 413 i-- 414 dAtA[i] = 0x30 415 } 416 if len(m.Meta) > 0 { 417 i -= len(m.Meta) 418 copy(dAtA[i:], m.Meta) 419 i = encodeVarintToken(dAtA, i, uint64(len(m.Meta))) 420 i-- 421 dAtA[i] = 0x2a 422 } 423 if len(m.Uri) > 0 { 424 i -= len(m.Uri) 425 copy(dAtA[i:], m.Uri) 426 i = encodeVarintToken(dAtA, i, uint64(len(m.Uri))) 427 i-- 428 dAtA[i] = 0x22 429 } 430 if len(m.Symbol) > 0 { 431 i -= len(m.Symbol) 432 copy(dAtA[i:], m.Symbol) 433 i = encodeVarintToken(dAtA, i, uint64(len(m.Symbol))) 434 i-- 435 dAtA[i] = 0x1a 436 } 437 if len(m.Name) > 0 { 438 i -= len(m.Name) 439 copy(dAtA[i:], m.Name) 440 i = encodeVarintToken(dAtA, i, uint64(len(m.Name))) 441 i-- 442 dAtA[i] = 0x12 443 } 444 if len(m.Id) > 0 { 445 i -= len(m.Id) 446 copy(dAtA[i:], m.Id) 447 i = encodeVarintToken(dAtA, i, uint64(len(m.Id))) 448 i-- 449 dAtA[i] = 0xa 450 } 451 return len(dAtA) - i, nil 452 } 453 454 func (m *Attribute) Marshal() (dAtA []byte, err error) { 455 size := m.Size() 456 dAtA = make([]byte, size) 457 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 458 if err != nil { 459 return nil, err 460 } 461 return dAtA[:n], nil 462 } 463 464 func (m *Attribute) MarshalTo(dAtA []byte) (int, error) { 465 size := m.Size() 466 return m.MarshalToSizedBuffer(dAtA[:size]) 467 } 468 469 func (m *Attribute) MarshalToSizedBuffer(dAtA []byte) (int, error) { 470 i := len(dAtA) 471 _ = i 472 var l int 473 _ = l 474 if len(m.Value) > 0 { 475 i -= len(m.Value) 476 copy(dAtA[i:], m.Value) 477 i = encodeVarintToken(dAtA, i, uint64(len(m.Value))) 478 i-- 479 dAtA[i] = 0x12 480 } 481 if len(m.Key) > 0 { 482 i -= len(m.Key) 483 copy(dAtA[i:], m.Key) 484 i = encodeVarintToken(dAtA, i, uint64(len(m.Key))) 485 i-- 486 dAtA[i] = 0xa 487 } 488 return len(dAtA) - i, nil 489 } 490 491 func (m *Authorization) Marshal() (dAtA []byte, err error) { 492 size := m.Size() 493 dAtA = make([]byte, size) 494 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 495 if err != nil { 496 return nil, err 497 } 498 return dAtA[:n], nil 499 } 500 501 func (m *Authorization) MarshalTo(dAtA []byte) (int, error) { 502 size := m.Size() 503 return m.MarshalToSizedBuffer(dAtA[:size]) 504 } 505 506 func (m *Authorization) MarshalToSizedBuffer(dAtA []byte) (int, error) { 507 i := len(dAtA) 508 _ = i 509 var l int 510 _ = l 511 if len(m.Operator) > 0 { 512 i -= len(m.Operator) 513 copy(dAtA[i:], m.Operator) 514 i = encodeVarintToken(dAtA, i, uint64(len(m.Operator))) 515 i-- 516 dAtA[i] = 0x12 517 } 518 if len(m.Holder) > 0 { 519 i -= len(m.Holder) 520 copy(dAtA[i:], m.Holder) 521 i = encodeVarintToken(dAtA, i, uint64(len(m.Holder))) 522 i-- 523 dAtA[i] = 0xa 524 } 525 return len(dAtA) - i, nil 526 } 527 528 func (m *Grant) Marshal() (dAtA []byte, err error) { 529 size := m.Size() 530 dAtA = make([]byte, size) 531 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 532 if err != nil { 533 return nil, err 534 } 535 return dAtA[:n], nil 536 } 537 538 func (m *Grant) MarshalTo(dAtA []byte) (int, error) { 539 size := m.Size() 540 return m.MarshalToSizedBuffer(dAtA[:size]) 541 } 542 543 func (m *Grant) MarshalToSizedBuffer(dAtA []byte) (int, error) { 544 i := len(dAtA) 545 _ = i 546 var l int 547 _ = l 548 if m.Permission != 0 { 549 i = encodeVarintToken(dAtA, i, uint64(m.Permission)) 550 i-- 551 dAtA[i] = 0x10 552 } 553 if len(m.Grantee) > 0 { 554 i -= len(m.Grantee) 555 copy(dAtA[i:], m.Grantee) 556 i = encodeVarintToken(dAtA, i, uint64(len(m.Grantee))) 557 i-- 558 dAtA[i] = 0xa 559 } 560 return len(dAtA) - i, nil 561 } 562 563 func encodeVarintToken(dAtA []byte, offset int, v uint64) int { 564 offset -= sovToken(v) 565 base := offset 566 for v >= 1<<7 { 567 dAtA[offset] = uint8(v&0x7f | 0x80) 568 v >>= 7 569 offset++ 570 } 571 dAtA[offset] = uint8(v) 572 return base 573 } 574 func (m *Params) Size() (n int) { 575 if m == nil { 576 return 0 577 } 578 var l int 579 _ = l 580 return n 581 } 582 583 func (m *Contract) Size() (n int) { 584 if m == nil { 585 return 0 586 } 587 var l int 588 _ = l 589 l = len(m.Id) 590 if l > 0 { 591 n += 1 + l + sovToken(uint64(l)) 592 } 593 l = len(m.Name) 594 if l > 0 { 595 n += 1 + l + sovToken(uint64(l)) 596 } 597 l = len(m.Symbol) 598 if l > 0 { 599 n += 1 + l + sovToken(uint64(l)) 600 } 601 l = len(m.Uri) 602 if l > 0 { 603 n += 1 + l + sovToken(uint64(l)) 604 } 605 l = len(m.Meta) 606 if l > 0 { 607 n += 1 + l + sovToken(uint64(l)) 608 } 609 if m.Decimals != 0 { 610 n += 1 + sovToken(uint64(m.Decimals)) 611 } 612 if m.Mintable { 613 n += 2 614 } 615 return n 616 } 617 618 func (m *Attribute) Size() (n int) { 619 if m == nil { 620 return 0 621 } 622 var l int 623 _ = l 624 l = len(m.Key) 625 if l > 0 { 626 n += 1 + l + sovToken(uint64(l)) 627 } 628 l = len(m.Value) 629 if l > 0 { 630 n += 1 + l + sovToken(uint64(l)) 631 } 632 return n 633 } 634 635 func (m *Authorization) Size() (n int) { 636 if m == nil { 637 return 0 638 } 639 var l int 640 _ = l 641 l = len(m.Holder) 642 if l > 0 { 643 n += 1 + l + sovToken(uint64(l)) 644 } 645 l = len(m.Operator) 646 if l > 0 { 647 n += 1 + l + sovToken(uint64(l)) 648 } 649 return n 650 } 651 652 func (m *Grant) Size() (n int) { 653 if m == nil { 654 return 0 655 } 656 var l int 657 _ = l 658 l = len(m.Grantee) 659 if l > 0 { 660 n += 1 + l + sovToken(uint64(l)) 661 } 662 if m.Permission != 0 { 663 n += 1 + sovToken(uint64(m.Permission)) 664 } 665 return n 666 } 667 668 func sovToken(x uint64) (n int) { 669 return (math_bits.Len64(x|1) + 6) / 7 670 } 671 func sozToken(x uint64) (n int) { 672 return sovToken(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 673 } 674 func (m *Params) Unmarshal(dAtA []byte) error { 675 l := len(dAtA) 676 iNdEx := 0 677 for iNdEx < l { 678 preIndex := iNdEx 679 var wire uint64 680 for shift := uint(0); ; shift += 7 { 681 if shift >= 64 { 682 return ErrIntOverflowToken 683 } 684 if iNdEx >= l { 685 return io.ErrUnexpectedEOF 686 } 687 b := dAtA[iNdEx] 688 iNdEx++ 689 wire |= uint64(b&0x7F) << shift 690 if b < 0x80 { 691 break 692 } 693 } 694 fieldNum := int32(wire >> 3) 695 wireType := int(wire & 0x7) 696 if wireType == 4 { 697 return fmt.Errorf("proto: Params: wiretype end group for non-group") 698 } 699 if fieldNum <= 0 { 700 return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) 701 } 702 switch fieldNum { 703 default: 704 iNdEx = preIndex 705 skippy, err := skipToken(dAtA[iNdEx:]) 706 if err != nil { 707 return err 708 } 709 if (skippy < 0) || (iNdEx+skippy) < 0 { 710 return ErrInvalidLengthToken 711 } 712 if (iNdEx + skippy) > l { 713 return io.ErrUnexpectedEOF 714 } 715 iNdEx += skippy 716 } 717 } 718 719 if iNdEx > l { 720 return io.ErrUnexpectedEOF 721 } 722 return nil 723 } 724 func (m *Contract) Unmarshal(dAtA []byte) error { 725 l := len(dAtA) 726 iNdEx := 0 727 for iNdEx < l { 728 preIndex := iNdEx 729 var wire uint64 730 for shift := uint(0); ; shift += 7 { 731 if shift >= 64 { 732 return ErrIntOverflowToken 733 } 734 if iNdEx >= l { 735 return io.ErrUnexpectedEOF 736 } 737 b := dAtA[iNdEx] 738 iNdEx++ 739 wire |= uint64(b&0x7F) << shift 740 if b < 0x80 { 741 break 742 } 743 } 744 fieldNum := int32(wire >> 3) 745 wireType := int(wire & 0x7) 746 if wireType == 4 { 747 return fmt.Errorf("proto: Contract: wiretype end group for non-group") 748 } 749 if fieldNum <= 0 { 750 return fmt.Errorf("proto: Contract: illegal tag %d (wire type %d)", fieldNum, wire) 751 } 752 switch fieldNum { 753 case 1: 754 if wireType != 2 { 755 return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) 756 } 757 var stringLen uint64 758 for shift := uint(0); ; shift += 7 { 759 if shift >= 64 { 760 return ErrIntOverflowToken 761 } 762 if iNdEx >= l { 763 return io.ErrUnexpectedEOF 764 } 765 b := dAtA[iNdEx] 766 iNdEx++ 767 stringLen |= uint64(b&0x7F) << shift 768 if b < 0x80 { 769 break 770 } 771 } 772 intStringLen := int(stringLen) 773 if intStringLen < 0 { 774 return ErrInvalidLengthToken 775 } 776 postIndex := iNdEx + intStringLen 777 if postIndex < 0 { 778 return ErrInvalidLengthToken 779 } 780 if postIndex > l { 781 return io.ErrUnexpectedEOF 782 } 783 m.Id = string(dAtA[iNdEx:postIndex]) 784 iNdEx = postIndex 785 case 2: 786 if wireType != 2 { 787 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 788 } 789 var stringLen uint64 790 for shift := uint(0); ; shift += 7 { 791 if shift >= 64 { 792 return ErrIntOverflowToken 793 } 794 if iNdEx >= l { 795 return io.ErrUnexpectedEOF 796 } 797 b := dAtA[iNdEx] 798 iNdEx++ 799 stringLen |= uint64(b&0x7F) << shift 800 if b < 0x80 { 801 break 802 } 803 } 804 intStringLen := int(stringLen) 805 if intStringLen < 0 { 806 return ErrInvalidLengthToken 807 } 808 postIndex := iNdEx + intStringLen 809 if postIndex < 0 { 810 return ErrInvalidLengthToken 811 } 812 if postIndex > l { 813 return io.ErrUnexpectedEOF 814 } 815 m.Name = string(dAtA[iNdEx:postIndex]) 816 iNdEx = postIndex 817 case 3: 818 if wireType != 2 { 819 return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) 820 } 821 var stringLen uint64 822 for shift := uint(0); ; shift += 7 { 823 if shift >= 64 { 824 return ErrIntOverflowToken 825 } 826 if iNdEx >= l { 827 return io.ErrUnexpectedEOF 828 } 829 b := dAtA[iNdEx] 830 iNdEx++ 831 stringLen |= uint64(b&0x7F) << shift 832 if b < 0x80 { 833 break 834 } 835 } 836 intStringLen := int(stringLen) 837 if intStringLen < 0 { 838 return ErrInvalidLengthToken 839 } 840 postIndex := iNdEx + intStringLen 841 if postIndex < 0 { 842 return ErrInvalidLengthToken 843 } 844 if postIndex > l { 845 return io.ErrUnexpectedEOF 846 } 847 m.Symbol = string(dAtA[iNdEx:postIndex]) 848 iNdEx = postIndex 849 case 4: 850 if wireType != 2 { 851 return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) 852 } 853 var stringLen uint64 854 for shift := uint(0); ; shift += 7 { 855 if shift >= 64 { 856 return ErrIntOverflowToken 857 } 858 if iNdEx >= l { 859 return io.ErrUnexpectedEOF 860 } 861 b := dAtA[iNdEx] 862 iNdEx++ 863 stringLen |= uint64(b&0x7F) << shift 864 if b < 0x80 { 865 break 866 } 867 } 868 intStringLen := int(stringLen) 869 if intStringLen < 0 { 870 return ErrInvalidLengthToken 871 } 872 postIndex := iNdEx + intStringLen 873 if postIndex < 0 { 874 return ErrInvalidLengthToken 875 } 876 if postIndex > l { 877 return io.ErrUnexpectedEOF 878 } 879 m.Uri = string(dAtA[iNdEx:postIndex]) 880 iNdEx = postIndex 881 case 5: 882 if wireType != 2 { 883 return fmt.Errorf("proto: wrong wireType = %d for field Meta", wireType) 884 } 885 var stringLen uint64 886 for shift := uint(0); ; shift += 7 { 887 if shift >= 64 { 888 return ErrIntOverflowToken 889 } 890 if iNdEx >= l { 891 return io.ErrUnexpectedEOF 892 } 893 b := dAtA[iNdEx] 894 iNdEx++ 895 stringLen |= uint64(b&0x7F) << shift 896 if b < 0x80 { 897 break 898 } 899 } 900 intStringLen := int(stringLen) 901 if intStringLen < 0 { 902 return ErrInvalidLengthToken 903 } 904 postIndex := iNdEx + intStringLen 905 if postIndex < 0 { 906 return ErrInvalidLengthToken 907 } 908 if postIndex > l { 909 return io.ErrUnexpectedEOF 910 } 911 m.Meta = string(dAtA[iNdEx:postIndex]) 912 iNdEx = postIndex 913 case 6: 914 if wireType != 0 { 915 return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) 916 } 917 m.Decimals = 0 918 for shift := uint(0); ; shift += 7 { 919 if shift >= 64 { 920 return ErrIntOverflowToken 921 } 922 if iNdEx >= l { 923 return io.ErrUnexpectedEOF 924 } 925 b := dAtA[iNdEx] 926 iNdEx++ 927 m.Decimals |= int32(b&0x7F) << shift 928 if b < 0x80 { 929 break 930 } 931 } 932 case 7: 933 if wireType != 0 { 934 return fmt.Errorf("proto: wrong wireType = %d for field Mintable", wireType) 935 } 936 var v int 937 for shift := uint(0); ; shift += 7 { 938 if shift >= 64 { 939 return ErrIntOverflowToken 940 } 941 if iNdEx >= l { 942 return io.ErrUnexpectedEOF 943 } 944 b := dAtA[iNdEx] 945 iNdEx++ 946 v |= int(b&0x7F) << shift 947 if b < 0x80 { 948 break 949 } 950 } 951 m.Mintable = bool(v != 0) 952 default: 953 iNdEx = preIndex 954 skippy, err := skipToken(dAtA[iNdEx:]) 955 if err != nil { 956 return err 957 } 958 if (skippy < 0) || (iNdEx+skippy) < 0 { 959 return ErrInvalidLengthToken 960 } 961 if (iNdEx + skippy) > l { 962 return io.ErrUnexpectedEOF 963 } 964 iNdEx += skippy 965 } 966 } 967 968 if iNdEx > l { 969 return io.ErrUnexpectedEOF 970 } 971 return nil 972 } 973 func (m *Attribute) Unmarshal(dAtA []byte) error { 974 l := len(dAtA) 975 iNdEx := 0 976 for iNdEx < l { 977 preIndex := iNdEx 978 var wire uint64 979 for shift := uint(0); ; shift += 7 { 980 if shift >= 64 { 981 return ErrIntOverflowToken 982 } 983 if iNdEx >= l { 984 return io.ErrUnexpectedEOF 985 } 986 b := dAtA[iNdEx] 987 iNdEx++ 988 wire |= uint64(b&0x7F) << shift 989 if b < 0x80 { 990 break 991 } 992 } 993 fieldNum := int32(wire >> 3) 994 wireType := int(wire & 0x7) 995 if wireType == 4 { 996 return fmt.Errorf("proto: Attribute: wiretype end group for non-group") 997 } 998 if fieldNum <= 0 { 999 return fmt.Errorf("proto: Attribute: illegal tag %d (wire type %d)", fieldNum, wire) 1000 } 1001 switch fieldNum { 1002 case 1: 1003 if wireType != 2 { 1004 return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) 1005 } 1006 var stringLen uint64 1007 for shift := uint(0); ; shift += 7 { 1008 if shift >= 64 { 1009 return ErrIntOverflowToken 1010 } 1011 if iNdEx >= l { 1012 return io.ErrUnexpectedEOF 1013 } 1014 b := dAtA[iNdEx] 1015 iNdEx++ 1016 stringLen |= uint64(b&0x7F) << shift 1017 if b < 0x80 { 1018 break 1019 } 1020 } 1021 intStringLen := int(stringLen) 1022 if intStringLen < 0 { 1023 return ErrInvalidLengthToken 1024 } 1025 postIndex := iNdEx + intStringLen 1026 if postIndex < 0 { 1027 return ErrInvalidLengthToken 1028 } 1029 if postIndex > l { 1030 return io.ErrUnexpectedEOF 1031 } 1032 m.Key = string(dAtA[iNdEx:postIndex]) 1033 iNdEx = postIndex 1034 case 2: 1035 if wireType != 2 { 1036 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 1037 } 1038 var stringLen uint64 1039 for shift := uint(0); ; shift += 7 { 1040 if shift >= 64 { 1041 return ErrIntOverflowToken 1042 } 1043 if iNdEx >= l { 1044 return io.ErrUnexpectedEOF 1045 } 1046 b := dAtA[iNdEx] 1047 iNdEx++ 1048 stringLen |= uint64(b&0x7F) << shift 1049 if b < 0x80 { 1050 break 1051 } 1052 } 1053 intStringLen := int(stringLen) 1054 if intStringLen < 0 { 1055 return ErrInvalidLengthToken 1056 } 1057 postIndex := iNdEx + intStringLen 1058 if postIndex < 0 { 1059 return ErrInvalidLengthToken 1060 } 1061 if postIndex > l { 1062 return io.ErrUnexpectedEOF 1063 } 1064 m.Value = string(dAtA[iNdEx:postIndex]) 1065 iNdEx = postIndex 1066 default: 1067 iNdEx = preIndex 1068 skippy, err := skipToken(dAtA[iNdEx:]) 1069 if err != nil { 1070 return err 1071 } 1072 if (skippy < 0) || (iNdEx+skippy) < 0 { 1073 return ErrInvalidLengthToken 1074 } 1075 if (iNdEx + skippy) > l { 1076 return io.ErrUnexpectedEOF 1077 } 1078 iNdEx += skippy 1079 } 1080 } 1081 1082 if iNdEx > l { 1083 return io.ErrUnexpectedEOF 1084 } 1085 return nil 1086 } 1087 func (m *Authorization) Unmarshal(dAtA []byte) error { 1088 l := len(dAtA) 1089 iNdEx := 0 1090 for iNdEx < l { 1091 preIndex := iNdEx 1092 var wire uint64 1093 for shift := uint(0); ; shift += 7 { 1094 if shift >= 64 { 1095 return ErrIntOverflowToken 1096 } 1097 if iNdEx >= l { 1098 return io.ErrUnexpectedEOF 1099 } 1100 b := dAtA[iNdEx] 1101 iNdEx++ 1102 wire |= uint64(b&0x7F) << shift 1103 if b < 0x80 { 1104 break 1105 } 1106 } 1107 fieldNum := int32(wire >> 3) 1108 wireType := int(wire & 0x7) 1109 if wireType == 4 { 1110 return fmt.Errorf("proto: Authorization: wiretype end group for non-group") 1111 } 1112 if fieldNum <= 0 { 1113 return fmt.Errorf("proto: Authorization: illegal tag %d (wire type %d)", fieldNum, wire) 1114 } 1115 switch fieldNum { 1116 case 1: 1117 if wireType != 2 { 1118 return fmt.Errorf("proto: wrong wireType = %d for field Holder", wireType) 1119 } 1120 var stringLen uint64 1121 for shift := uint(0); ; shift += 7 { 1122 if shift >= 64 { 1123 return ErrIntOverflowToken 1124 } 1125 if iNdEx >= l { 1126 return io.ErrUnexpectedEOF 1127 } 1128 b := dAtA[iNdEx] 1129 iNdEx++ 1130 stringLen |= uint64(b&0x7F) << shift 1131 if b < 0x80 { 1132 break 1133 } 1134 } 1135 intStringLen := int(stringLen) 1136 if intStringLen < 0 { 1137 return ErrInvalidLengthToken 1138 } 1139 postIndex := iNdEx + intStringLen 1140 if postIndex < 0 { 1141 return ErrInvalidLengthToken 1142 } 1143 if postIndex > l { 1144 return io.ErrUnexpectedEOF 1145 } 1146 m.Holder = string(dAtA[iNdEx:postIndex]) 1147 iNdEx = postIndex 1148 case 2: 1149 if wireType != 2 { 1150 return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) 1151 } 1152 var stringLen uint64 1153 for shift := uint(0); ; shift += 7 { 1154 if shift >= 64 { 1155 return ErrIntOverflowToken 1156 } 1157 if iNdEx >= l { 1158 return io.ErrUnexpectedEOF 1159 } 1160 b := dAtA[iNdEx] 1161 iNdEx++ 1162 stringLen |= uint64(b&0x7F) << shift 1163 if b < 0x80 { 1164 break 1165 } 1166 } 1167 intStringLen := int(stringLen) 1168 if intStringLen < 0 { 1169 return ErrInvalidLengthToken 1170 } 1171 postIndex := iNdEx + intStringLen 1172 if postIndex < 0 { 1173 return ErrInvalidLengthToken 1174 } 1175 if postIndex > l { 1176 return io.ErrUnexpectedEOF 1177 } 1178 m.Operator = string(dAtA[iNdEx:postIndex]) 1179 iNdEx = postIndex 1180 default: 1181 iNdEx = preIndex 1182 skippy, err := skipToken(dAtA[iNdEx:]) 1183 if err != nil { 1184 return err 1185 } 1186 if (skippy < 0) || (iNdEx+skippy) < 0 { 1187 return ErrInvalidLengthToken 1188 } 1189 if (iNdEx + skippy) > l { 1190 return io.ErrUnexpectedEOF 1191 } 1192 iNdEx += skippy 1193 } 1194 } 1195 1196 if iNdEx > l { 1197 return io.ErrUnexpectedEOF 1198 } 1199 return nil 1200 } 1201 func (m *Grant) Unmarshal(dAtA []byte) error { 1202 l := len(dAtA) 1203 iNdEx := 0 1204 for iNdEx < l { 1205 preIndex := iNdEx 1206 var wire uint64 1207 for shift := uint(0); ; shift += 7 { 1208 if shift >= 64 { 1209 return ErrIntOverflowToken 1210 } 1211 if iNdEx >= l { 1212 return io.ErrUnexpectedEOF 1213 } 1214 b := dAtA[iNdEx] 1215 iNdEx++ 1216 wire |= uint64(b&0x7F) << shift 1217 if b < 0x80 { 1218 break 1219 } 1220 } 1221 fieldNum := int32(wire >> 3) 1222 wireType := int(wire & 0x7) 1223 if wireType == 4 { 1224 return fmt.Errorf("proto: Grant: wiretype end group for non-group") 1225 } 1226 if fieldNum <= 0 { 1227 return fmt.Errorf("proto: Grant: illegal tag %d (wire type %d)", fieldNum, wire) 1228 } 1229 switch fieldNum { 1230 case 1: 1231 if wireType != 2 { 1232 return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) 1233 } 1234 var stringLen uint64 1235 for shift := uint(0); ; shift += 7 { 1236 if shift >= 64 { 1237 return ErrIntOverflowToken 1238 } 1239 if iNdEx >= l { 1240 return io.ErrUnexpectedEOF 1241 } 1242 b := dAtA[iNdEx] 1243 iNdEx++ 1244 stringLen |= uint64(b&0x7F) << shift 1245 if b < 0x80 { 1246 break 1247 } 1248 } 1249 intStringLen := int(stringLen) 1250 if intStringLen < 0 { 1251 return ErrInvalidLengthToken 1252 } 1253 postIndex := iNdEx + intStringLen 1254 if postIndex < 0 { 1255 return ErrInvalidLengthToken 1256 } 1257 if postIndex > l { 1258 return io.ErrUnexpectedEOF 1259 } 1260 m.Grantee = string(dAtA[iNdEx:postIndex]) 1261 iNdEx = postIndex 1262 case 2: 1263 if wireType != 0 { 1264 return fmt.Errorf("proto: wrong wireType = %d for field Permission", wireType) 1265 } 1266 m.Permission = 0 1267 for shift := uint(0); ; shift += 7 { 1268 if shift >= 64 { 1269 return ErrIntOverflowToken 1270 } 1271 if iNdEx >= l { 1272 return io.ErrUnexpectedEOF 1273 } 1274 b := dAtA[iNdEx] 1275 iNdEx++ 1276 m.Permission |= Permission(b&0x7F) << shift 1277 if b < 0x80 { 1278 break 1279 } 1280 } 1281 default: 1282 iNdEx = preIndex 1283 skippy, err := skipToken(dAtA[iNdEx:]) 1284 if err != nil { 1285 return err 1286 } 1287 if (skippy < 0) || (iNdEx+skippy) < 0 { 1288 return ErrInvalidLengthToken 1289 } 1290 if (iNdEx + skippy) > l { 1291 return io.ErrUnexpectedEOF 1292 } 1293 iNdEx += skippy 1294 } 1295 } 1296 1297 if iNdEx > l { 1298 return io.ErrUnexpectedEOF 1299 } 1300 return nil 1301 } 1302 func skipToken(dAtA []byte) (n int, err error) { 1303 l := len(dAtA) 1304 iNdEx := 0 1305 depth := 0 1306 for iNdEx < l { 1307 var wire uint64 1308 for shift := uint(0); ; shift += 7 { 1309 if shift >= 64 { 1310 return 0, ErrIntOverflowToken 1311 } 1312 if iNdEx >= l { 1313 return 0, io.ErrUnexpectedEOF 1314 } 1315 b := dAtA[iNdEx] 1316 iNdEx++ 1317 wire |= (uint64(b) & 0x7F) << shift 1318 if b < 0x80 { 1319 break 1320 } 1321 } 1322 wireType := int(wire & 0x7) 1323 switch wireType { 1324 case 0: 1325 for shift := uint(0); ; shift += 7 { 1326 if shift >= 64 { 1327 return 0, ErrIntOverflowToken 1328 } 1329 if iNdEx >= l { 1330 return 0, io.ErrUnexpectedEOF 1331 } 1332 iNdEx++ 1333 if dAtA[iNdEx-1] < 0x80 { 1334 break 1335 } 1336 } 1337 case 1: 1338 iNdEx += 8 1339 case 2: 1340 var length int 1341 for shift := uint(0); ; shift += 7 { 1342 if shift >= 64 { 1343 return 0, ErrIntOverflowToken 1344 } 1345 if iNdEx >= l { 1346 return 0, io.ErrUnexpectedEOF 1347 } 1348 b := dAtA[iNdEx] 1349 iNdEx++ 1350 length |= (int(b) & 0x7F) << shift 1351 if b < 0x80 { 1352 break 1353 } 1354 } 1355 if length < 0 { 1356 return 0, ErrInvalidLengthToken 1357 } 1358 iNdEx += length 1359 case 3: 1360 depth++ 1361 case 4: 1362 if depth == 0 { 1363 return 0, ErrUnexpectedEndOfGroupToken 1364 } 1365 depth-- 1366 case 5: 1367 iNdEx += 4 1368 default: 1369 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1370 } 1371 if iNdEx < 0 { 1372 return 0, ErrInvalidLengthToken 1373 } 1374 if depth == 0 { 1375 return iNdEx, nil 1376 } 1377 } 1378 return 0, io.ErrUnexpectedEOF 1379 } 1380 1381 var ( 1382 ErrInvalidLengthToken = fmt.Errorf("proto: negative length found during unmarshaling") 1383 ErrIntOverflowToken = fmt.Errorf("proto: integer overflow") 1384 ErrUnexpectedEndOfGroupToken = fmt.Errorf("proto: unexpected end of group") 1385 )