// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: canto/csr/v1/csr.proto

package types

import (
	cosmossdk_io_math "cosmossdk.io/math"
	fmt "fmt"
	_ "github.com/cosmos/cosmos-proto"
	_ "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

// The CSR struct is a wrapper to all of the metadata associated with a given
// CST NFT
type CSR struct {
	// Contracts is the list of all EVM address that are registered to this NFT
	Contracts []string `protobuf:"bytes,1,rep,name=contracts,proto3" json:"contracts,omitempty"`
	// The NFT id which this CSR corresponds to
	Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
	// The total number of transactions for this CSR NFT
	Txs uint64 `protobuf:"varint,3,opt,name=txs,proto3" json:"txs,omitempty"`
	// The cumulative revenue for this CSR NFT -> represented as a sdk.Int
	Revenue cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=revenue,proto3,customtype=cosmossdk.io/math.Int" json:"revenue"`
}

func (m *CSR) Reset()         { *m = CSR{} }
func (m *CSR) String() string { return proto.CompactTextString(m) }
func (*CSR) ProtoMessage()    {}
func (*CSR) Descriptor() ([]byte, []int) {
	return fileDescriptor_57c53cea3d443afa, []int{0}
}
func (m *CSR) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *CSR) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_CSR.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 *CSR) XXX_Merge(src proto.Message) {
	xxx_messageInfo_CSR.Merge(m, src)
}
func (m *CSR) XXX_Size() int {
	return m.Size()
}
func (m *CSR) XXX_DiscardUnknown() {
	xxx_messageInfo_CSR.DiscardUnknown(m)
}

var xxx_messageInfo_CSR proto.InternalMessageInfo

func (m *CSR) GetContracts() []string {
	if m != nil {
		return m.Contracts
	}
	return nil
}

func (m *CSR) GetId() uint64 {
	if m != nil {
		return m.Id
	}
	return 0
}

func (m *CSR) GetTxs() uint64 {
	if m != nil {
		return m.Txs
	}
	return 0
}

func init() {
	proto.RegisterType((*CSR)(nil), "canto.csr.v1.CSR")
}

func init() { proto.RegisterFile("canto/csr/v1/csr.proto", fileDescriptor_57c53cea3d443afa) }

var fileDescriptor_57c53cea3d443afa = []byte{
	// 268 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4b, 0x4e, 0xcc, 0x2b,
	0xc9, 0xd7, 0x4f, 0x2e, 0x2e, 0xd2, 0x2f, 0x33, 0x04, 0x51, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9,
	0x42, 0x3c, 0x60, 0x71, 0x3d, 0x90, 0x40, 0x99, 0xa1, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x58,
	0x42, 0x1f, 0xc4, 0x82, 0xa8, 0x91, 0x92, 0x4c, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0x8e, 0x87, 0x48,
	0x40, 0x38, 0x10, 0x29, 0xa5, 0x1e, 0x46, 0x2e, 0x66, 0xe7, 0xe0, 0x20, 0x21, 0x19, 0x2e, 0xce,
	0xe4, 0xfc, 0xbc, 0x92, 0xa2, 0xc4, 0xe4, 0x92, 0x62, 0x09, 0x46, 0x05, 0x66, 0x0d, 0xce, 0x20,
	0x84, 0x80, 0x10, 0x1f, 0x17, 0x53, 0x66, 0x8a, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x4b, 0x10, 0x53,
	0x66, 0x8a, 0x90, 0x00, 0x17, 0x73, 0x49, 0x45, 0xb1, 0x04, 0x33, 0x58, 0x00, 0xc4, 0x14, 0x72,
	0xe5, 0x62, 0x2f, 0x4a, 0x2d, 0x4b, 0xcd, 0x2b, 0x4d, 0x95, 0x60, 0x51, 0x60, 0xd4, 0xe0, 0x74,
	0xd2, 0x3e, 0x71, 0x4f, 0x9e, 0xe1, 0xd6, 0x3d, 0x79, 0x51, 0x88, 0x75, 0xc5, 0x29, 0xd9, 0x7a,
	0x99, 0xf9, 0xfa, 0xb9, 0x89, 0x25, 0x19, 0x7a, 0x9e, 0x79, 0x25, 0x97, 0xb6, 0xe8, 0x72, 0x41,
	0xdd, 0xe1, 0x99, 0x57, 0x12, 0x04, 0xd3, 0xeb, 0xe4, 0x7e, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47,
	0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d,
	0xc7, 0x72, 0x0c, 0x51, 0xba, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa,
	0xce, 0x20, 0x2f, 0xeb, 0xfa, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0x43, 0x78, 0xfa, 0x65, 0x16,
	0xfa, 0x15, 0xe0, 0xd0, 0x29, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x7b, 0xcf, 0x18, 0x10,
	0x00, 0x00, 0xff, 0xff, 0xb6, 0xa7, 0x10, 0x34, 0x37, 0x01, 0x00, 0x00,
}

func (m *CSR) 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 *CSR) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *CSR) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	{
		size := m.Revenue.Size()
		i -= size
		if _, err := m.Revenue.MarshalTo(dAtA[i:]); err != nil {
			return 0, err
		}
		i = encodeVarintCsr(dAtA, i, uint64(size))
	}
	i--
	dAtA[i] = 0x22
	if m.Txs != 0 {
		i = encodeVarintCsr(dAtA, i, uint64(m.Txs))
		i--
		dAtA[i] = 0x18
	}
	if m.Id != 0 {
		i = encodeVarintCsr(dAtA, i, uint64(m.Id))
		i--
		dAtA[i] = 0x10
	}
	if len(m.Contracts) > 0 {
		for iNdEx := len(m.Contracts) - 1; iNdEx >= 0; iNdEx-- {
			i -= len(m.Contracts[iNdEx])
			copy(dAtA[i:], m.Contracts[iNdEx])
			i = encodeVarintCsr(dAtA, i, uint64(len(m.Contracts[iNdEx])))
			i--
			dAtA[i] = 0xa
		}
	}
	return len(dAtA) - i, nil
}

func encodeVarintCsr(dAtA []byte, offset int, v uint64) int {
	offset -= sovCsr(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *CSR) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if len(m.Contracts) > 0 {
		for _, s := range m.Contracts {
			l = len(s)
			n += 1 + l + sovCsr(uint64(l))
		}
	}
	if m.Id != 0 {
		n += 1 + sovCsr(uint64(m.Id))
	}
	if m.Txs != 0 {
		n += 1 + sovCsr(uint64(m.Txs))
	}
	l = m.Revenue.Size()
	n += 1 + l + sovCsr(uint64(l))
	return n
}

func sovCsr(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozCsr(x uint64) (n int) {
	return sovCsr(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *CSR) 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 ErrIntOverflowCsr
			}
			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: CSR: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: CSR: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Contracts", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowCsr
				}
				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 ErrInvalidLengthCsr
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthCsr
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Contracts = append(m.Contracts, string(dAtA[iNdEx:postIndex]))
			iNdEx = postIndex
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
			}
			m.Id = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowCsr
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Id |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType)
			}
			m.Txs = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowCsr
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Txs |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Revenue", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowCsr
				}
				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 ErrInvalidLengthCsr
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthCsr
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if err := m.Revenue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipCsr(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthCsr
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipCsr(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, ErrIntOverflowCsr
			}
			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, ErrIntOverflowCsr
				}
				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, ErrIntOverflowCsr
				}
				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, ErrInvalidLengthCsr
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupCsr
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthCsr
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthCsr        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCsr          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupCsr = fmt.Errorf("proto: unexpected end of group")
)
