// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: bitsong/fantoken/v1beta1/fantoken.proto

package types

import (
	cosmossdk_io_math "cosmossdk.io/math"
	fmt "fmt"
	_ "github.com/cosmos/cosmos-sdk/types"
	_ "github.com/cosmos/gogoproto/gogoproto"
	proto "github.com/cosmos/gogoproto/proto"
	io "io"
	math "math"
	math_bits "math/bits"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package

type Metadata struct {
	// name defines the name of the fantoken (eg: Kitty Punk)
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// symbol is the token symbol usually shown on exchanges (eg: KITTY)
	Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// URI to a document (on or off-chain) that contains additional
	// information.Optional.
	URI string `protobuf:"bytes,3,opt,name=uri,proto3" json:"uri,omitempty"`
	// sdk.AccAddress allowed to set a new uri
	Authority string `protobuf:"bytes,4,opt,name=authority,proto3" json:"authority,omitempty"`
}

func (m *Metadata) Reset()         { *m = Metadata{} }
func (m *Metadata) String() string { return proto.CompactTextString(m) }
func (*Metadata) ProtoMessage()    {}
func (*Metadata) Descriptor() ([]byte, []int) {
	return fileDescriptor_af4dfaf3dfee0855, []int{0}
}
func (m *Metadata) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_Metadata.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *Metadata) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Metadata.Merge(m, src)
}
func (m *Metadata) XXX_Size() int {
	return m.Size()
}
func (m *Metadata) XXX_DiscardUnknown() {
	xxx_messageInfo_Metadata.DiscardUnknown(m)
}

var xxx_messageInfo_Metadata proto.InternalMessageInfo

// FanToken defines a standard for the fungible token
type FanToken struct {
	// denom represents the string name of the given denom unit (e.g ft<hash>).
	Denom     string                `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
	MaxSupply cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=max_supply,json=maxSupply,proto3,customtype=cosmossdk.io/math.Int" json:"max_supply" yaml:"max_supply"`
	// sdk.AccAddress allowed to mint new fantoken
	Minter   string   `protobuf:"bytes,3,opt,name=minter,proto3" json:"minter,omitempty"`
	MetaData Metadata `protobuf:"bytes,4,opt,name=meta_data,json=metaData,proto3" json:"meta_data" yaml:"meta_data"`
}

func (m *FanToken) Reset()      { *m = FanToken{} }
func (*FanToken) ProtoMessage() {}
func (*FanToken) Descriptor() ([]byte, []int) {
	return fileDescriptor_af4dfaf3dfee0855, []int{1}
}
func (m *FanToken) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *FanToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_FanToken.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *FanToken) XXX_Merge(src proto.Message) {
	xxx_messageInfo_FanToken.Merge(m, src)
}
func (m *FanToken) XXX_Size() int {
	return m.Size()
}
func (m *FanToken) XXX_DiscardUnknown() {
	xxx_messageInfo_FanToken.DiscardUnknown(m)
}

var xxx_messageInfo_FanToken proto.InternalMessageInfo

func init() {
	proto.RegisterType((*Metadata)(nil), "bitsong.fantoken.v1beta1.Metadata")
	proto.RegisterType((*FanToken)(nil), "bitsong.fantoken.v1beta1.FanToken")
}

func init() {
	proto.RegisterFile("bitsong/fantoken/v1beta1/fantoken.proto", fileDescriptor_af4dfaf3dfee0855)
}

var fileDescriptor_af4dfaf3dfee0855 = []byte{
	// 404 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xb1, 0x6e, 0xd4, 0x40,
	0x10, 0xb5, 0xb9, 0x10, 0xee, 0x96, 0x06, 0x56, 0x01, 0x99, 0x08, 0xad, 0x91, 0x1b, 0x68, 0xb0,
	0x95, 0x20, 0x51, 0xa4, 0x3c, 0x21, 0xa4, 0x14, 0x14, 0x98, 0x50, 0x40, 0x13, 0x8d, 0xef, 0xf6,
	0x7c, 0xab, 0x78, 0x77, 0x2c, 0xef, 0x1a, 0x9d, 0xff, 0x80, 0x92, 0x92, 0x32, 0x9f, 0x73, 0x65,
	0x4a, 0x44, 0x61, 0x81, 0xef, 0x07, 0x50, 0xbe, 0x00, 0xad, 0xbd, 0x77, 0x57, 0xa5, 0x7b, 0xf3,
	0x34, 0x6f, 0xdf, 0x9b, 0xd9, 0x21, 0x2f, 0x33, 0x61, 0x34, 0xaa, 0x3c, 0x59, 0x80, 0x32, 0x78,
	0xc5, 0x55, 0xf2, 0xed, 0x24, 0xe3, 0x06, 0x4e, 0x76, 0x44, 0x5c, 0x56, 0x68, 0x90, 0x06, 0xae,
	0x31, 0xde, 0xf1, 0xae, 0xf1, 0x98, 0xcd, 0x50, 0x4b, 0xd4, 0x49, 0x06, 0x9a, 0xef, 0xd4, 0x33,
	0x14, 0x4e, 0x79, 0x7c, 0x94, 0x63, 0x8e, 0x3d, 0x4c, 0x2c, 0x1a, 0xd8, 0x08, 0xc9, 0xf8, 0x03,
	0x37, 0x30, 0x07, 0x03, 0x94, 0x92, 0x03, 0x05, 0x92, 0x07, 0xfe, 0x0b, 0xff, 0xd5, 0x24, 0xed,
	0x31, 0x7d, 0x4a, 0x0e, 0x75, 0x23, 0x33, 0x2c, 0x82, 0x7b, 0x3d, 0xeb, 0x2a, 0xfa, 0x8c, 0x8c,
	0xea, 0x4a, 0x04, 0x23, 0x4b, 0x4e, 0x1f, 0x74, 0x6d, 0x38, 0xfa, 0x9c, 0x9e, 0xa7, 0x96, 0xa3,
	0xcf, 0xc9, 0x04, 0x6a, 0xb3, 0xc4, 0x4a, 0x98, 0x26, 0x38, 0xe8, 0x55, 0x7b, 0x22, 0xfa, 0xe7,
	0x93, 0xf1, 0x7b, 0x50, 0x17, 0x36, 0x3b, 0x3d, 0x22, 0xf7, 0xe7, 0x5c, 0xa1, 0x74, 0x96, 0x43,
	0x41, 0x3f, 0x12, 0x22, 0x61, 0x75, 0xa9, 0xeb, 0xb2, 0x2c, 0x9a, 0xc1, 0x77, 0x7a, 0xba, 0x6e,
	0x43, 0xef, 0x77, 0x1b, 0x3e, 0x19, 0xa6, 0xd4, 0xf3, 0xab, 0x58, 0x60, 0x22, 0xc1, 0x2c, 0xe3,
	0x73, 0x65, 0x6e, 0xdb, 0xf0, 0x71, 0x03, 0xb2, 0x38, 0x8b, 0xf6, 0xc2, 0x28, 0x9d, 0x48, 0x58,
	0x7d, 0xea, 0xb1, 0x1d, 0x43, 0x0a, 0x65, 0x78, 0x35, 0x24, 0x4e, 0x5d, 0x45, 0xbf, 0x90, 0x89,
	0xe4, 0x06, 0x2e, 0xed, 0xfc, 0x7d, 0xd6, 0x87, 0xa7, 0x51, 0x7c, 0xd7, 0x8a, 0xe3, 0xed, 0xa6,
	0xa6, 0x81, 0x4d, 0x73, 0xdb, 0x86, 0x8f, 0x9c, 0xe9, 0xf6, 0x89, 0x28, 0x1d, 0x5b, 0xfc, 0x0e,
	0x0c, 0x9c, 0x8d, 0xbf, 0x5f, 0x87, 0xde, 0xcf, 0xeb, 0xd0, 0x9b, 0x5e, 0xac, 0xff, 0x32, 0x6f,
	0xdd, 0x31, 0xff, 0xa6, 0x63, 0xfe, 0x9f, 0x8e, 0xf9, 0x3f, 0x36, 0xcc, 0xbb, 0xd9, 0x30, 0xef,
	0xd7, 0x86, 0x79, 0x5f, 0xdf, 0xe6, 0xc2, 0x2c, 0xeb, 0x2c, 0x9e, 0xa1, 0x4c, 0x9c, 0x33, 0x2e,
	0x16, 0x62, 0x26, 0xa0, 0x48, 0x72, 0x7c, 0xbd, 0x3d, 0x8c, 0xd5, 0xfe, 0x34, 0x4c, 0x53, 0x72,
	0x9d, 0x1d, 0xf6, 0x1f, 0xf8, 0xe6, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x67, 0xe2, 0xbe, 0x01,
	0x3b, 0x02, 0x00, 0x00,
}

func (m *Metadata) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *Metadata) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Authority) > 0 {
		i -= len(m.Authority)
		copy(dAtA[i:], m.Authority)
		i = encodeVarintFantoken(dAtA, i, uint64(len(m.Authority)))
		i--
		dAtA[i] = 0x22
	}
	if len(m.URI) > 0 {
		i -= len(m.URI)
		copy(dAtA[i:], m.URI)
		i = encodeVarintFantoken(dAtA, i, uint64(len(m.URI)))
		i--
		dAtA[i] = 0x1a
	}
	if len(m.Symbol) > 0 {
		i -= len(m.Symbol)
		copy(dAtA[i:], m.Symbol)
		i = encodeVarintFantoken(dAtA, i, uint64(len(m.Symbol)))
		i--
		dAtA[i] = 0x12
	}
	if len(m.Name) > 0 {
		i -= len(m.Name)
		copy(dAtA[i:], m.Name)
		i = encodeVarintFantoken(dAtA, i, uint64(len(m.Name)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *FanToken) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *FanToken) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *FanToken) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size, err := m.MetaData.MarshalToSizedBuffer(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = encodeVarintFantoken(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0x22
	if len(m.Minter) > 0 {
		i -= len(m.Minter)
		copy(dAtA[i:], m.Minter)
		i = encodeVarintFantoken(dAtA, i, uint64(len(m.Minter)))
		i--
		dAtA[i] = 0x1a
	}
	{
		size := m.MaxSupply.Size()
		i -= size
		if _, err := m.MaxSupply.MarshalTo(dAtA[i:]); err != nil {
			return 0, err
		}
		i = encodeVarintFantoken(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0x12
	if len(m.Denom) > 0 {
		i -= len(m.Denom)
		copy(dAtA[i:], m.Denom)
		i = encodeVarintFantoken(dAtA, i, uint64(len(m.Denom)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func encodeVarintFantoken(dAtA []byte, offset int, v uint64) int {
	offset -= sovFantoken(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *Metadata) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.Name)
	if l > 0 {
		n += 1 + l + sovFantoken(uint64(l))
	}
	l = len(m.Symbol)
	if l > 0 {
		n += 1 + l + sovFantoken(uint64(l))
	}
	l = len(m.URI)
	if l > 0 {
		n += 1 + l + sovFantoken(uint64(l))
	}
	l = len(m.Authority)
	if l > 0 {
		n += 1 + l + sovFantoken(uint64(l))
	}
	return n
}

func (m *FanToken) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.Denom)
	if l > 0 {
		n += 1 + l + sovFantoken(uint64(l))
	}
	l = m.MaxSupply.Size()
	n += 1 + l + sovFantoken(uint64(l))
	l = len(m.Minter)
	if l > 0 {
		n += 1 + l + sovFantoken(uint64(l))
	}
	l = m.MetaData.Size()
	n += 1 + l + sovFantoken(uint64(l))
	return n
}

func sovFantoken(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozFantoken(x uint64) (n int) {
	return sovFantoken(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Metadata) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowFantoken
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: Metadata: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowFantoken
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthFantoken
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthFantoken
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Name = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowFantoken
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthFantoken
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthFantoken
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Symbol = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field URI", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowFantoken
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthFantoken
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthFantoken
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.URI = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowFantoken
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthFantoken
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthFantoken
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Authority = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipFantoken(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthFantoken
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *FanToken) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowFantoken
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: FanToken: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: FanToken: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowFantoken
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthFantoken
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthFantoken
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Denom = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field MaxSupply", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowFantoken
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthFantoken
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthFantoken
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.MaxSupply.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Minter", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowFantoken
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthFantoken
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthFantoken
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Minter = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field MetaData", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowFantoken
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return ErrInvalidLengthFantoken
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return ErrInvalidLengthFantoken
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.MetaData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipFantoken(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthFantoken
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipFantoken(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
	depth := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowFantoken
			}
			if iNdEx >= l {
				return 0, io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		wireType := int(wire & 0x7)
		switch wireType {
		case 0:
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowFantoken
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				iNdEx++
				if dAtA[iNdEx-1] < 0x80 {
					break
				}
			}
		case 1:
			iNdEx += 8
		case 2:
			var length int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowFantoken
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if length < 0 {
				return 0, ErrInvalidLengthFantoken
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupFantoken
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthFantoken
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthFantoken        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowFantoken          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupFantoken = fmt.Errorf("proto: unexpected end of group")
)
