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