cosmos-sdk/x/accounts/v1/genesis.pb.go
testinginprod 40492cdf10
feat(accounts): add genesis account initialization (#20642)
Co-authored-by: unknown unknown <unknown@unknown>
2024-06-12 14:19:13 +00:00

953 lines
23 KiB
Go

// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: cosmos/accounts/v1/genesis.proto
package v1
import (
fmt "fmt"
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
// GenesisState defines the accounts' module's genesis state.
type GenesisState struct {
// accounts are the genesis accounts.
Accounts []*GenesisAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"`
// init_accounts_msgs defines the genesis messages that will be executed to init the account.
InitAccountMsgs []*MsgInit `protobuf:"bytes,2,rep,name=init_account_msgs,json=initAccountMsgs,proto3" json:"init_account_msgs,omitempty"`
}
func (m *GenesisState) Reset() { *m = GenesisState{} }
func (m *GenesisState) String() string { return proto.CompactTextString(m) }
func (*GenesisState) ProtoMessage() {}
func (*GenesisState) Descriptor() ([]byte, []int) {
return fileDescriptor_409859d32eae9438, []int{0}
}
func (m *GenesisState) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) {
xxx_messageInfo_GenesisState.Merge(m, src)
}
func (m *GenesisState) XXX_Size() int {
return m.Size()
}
func (m *GenesisState) XXX_DiscardUnknown() {
xxx_messageInfo_GenesisState.DiscardUnknown(m)
}
var xxx_messageInfo_GenesisState proto.InternalMessageInfo
func (m *GenesisState) GetAccounts() []*GenesisAccount {
if m != nil {
return m.Accounts
}
return nil
}
func (m *GenesisState) GetInitAccountMsgs() []*MsgInit {
if m != nil {
return m.InitAccountMsgs
}
return nil
}
// GenesisAccount defines an account to be initialized in the genesis state.
type GenesisAccount struct {
// address is the address of the account.
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
// account_type is the account type of the account.
AccountType string `protobuf:"bytes,2,opt,name=account_type,json=accountType,proto3" json:"account_type,omitempty"`
// account_number is the account number of the account.
AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"`
// state is the account state represented as a slice of raw key value byte pairs.
State []*KVPair `protobuf:"bytes,4,rep,name=state,proto3" json:"state,omitempty"`
}
func (m *GenesisAccount) Reset() { *m = GenesisAccount{} }
func (m *GenesisAccount) String() string { return proto.CompactTextString(m) }
func (*GenesisAccount) ProtoMessage() {}
func (*GenesisAccount) Descriptor() ([]byte, []int) {
return fileDescriptor_409859d32eae9438, []int{1}
}
func (m *GenesisAccount) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GenesisAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GenesisAccount.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 *GenesisAccount) XXX_Merge(src proto.Message) {
xxx_messageInfo_GenesisAccount.Merge(m, src)
}
func (m *GenesisAccount) XXX_Size() int {
return m.Size()
}
func (m *GenesisAccount) XXX_DiscardUnknown() {
xxx_messageInfo_GenesisAccount.DiscardUnknown(m)
}
var xxx_messageInfo_GenesisAccount proto.InternalMessageInfo
func (m *GenesisAccount) GetAddress() string {
if m != nil {
return m.Address
}
return ""
}
func (m *GenesisAccount) GetAccountType() string {
if m != nil {
return m.AccountType
}
return ""
}
func (m *GenesisAccount) GetAccountNumber() uint64 {
if m != nil {
return m.AccountNumber
}
return 0
}
func (m *GenesisAccount) GetState() []*KVPair {
if m != nil {
return m.State
}
return nil
}
// KVPair defines a key value pair.
type KVPair struct {
// key is the key of the pair.
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
// value is the value of the pair.
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}
func (m *KVPair) Reset() { *m = KVPair{} }
func (m *KVPair) String() string { return proto.CompactTextString(m) }
func (*KVPair) ProtoMessage() {}
func (*KVPair) Descriptor() ([]byte, []int) {
return fileDescriptor_409859d32eae9438, []int{2}
}
func (m *KVPair) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *KVPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_KVPair.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 *KVPair) XXX_Merge(src proto.Message) {
xxx_messageInfo_KVPair.Merge(m, src)
}
func (m *KVPair) XXX_Size() int {
return m.Size()
}
func (m *KVPair) XXX_DiscardUnknown() {
xxx_messageInfo_KVPair.DiscardUnknown(m)
}
var xxx_messageInfo_KVPair proto.InternalMessageInfo
func (m *KVPair) GetKey() []byte {
if m != nil {
return m.Key
}
return nil
}
func (m *KVPair) GetValue() []byte {
if m != nil {
return m.Value
}
return nil
}
func init() {
proto.RegisterType((*GenesisState)(nil), "cosmos.accounts.v1.GenesisState")
proto.RegisterType((*GenesisAccount)(nil), "cosmos.accounts.v1.GenesisAccount")
proto.RegisterType((*KVPair)(nil), "cosmos.accounts.v1.KVPair")
}
func init() { proto.RegisterFile("cosmos/accounts/v1/genesis.proto", fileDescriptor_409859d32eae9438) }
var fileDescriptor_409859d32eae9438 = []byte{
// 331 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcd, 0x4a, 0xc3, 0x40,
0x14, 0x85, 0x3b, 0xfd, 0x53, 0x6f, 0x63, 0xd5, 0xc1, 0x45, 0x68, 0x21, 0xd4, 0x80, 0xd0, 0x55,
0xd2, 0xaa, 0x6b, 0x41, 0x37, 0x45, 0xa4, 0x22, 0xa3, 0xb8, 0x70, 0x53, 0xd2, 0x76, 0x08, 0x43,
0x6d, 0xa6, 0xe4, 0x4e, 0x4b, 0xfb, 0x16, 0xee, 0x7c, 0x03, 0x9f, 0xc5, 0x65, 0x97, 0x2e, 0xa5,
0x7d, 0x11, 0xc9, 0x4c, 0x22, 0x8a, 0xd9, 0xe5, 0x7e, 0x39, 0xe7, 0xdc, 0xc3, 0x5c, 0x68, 0x8d,
0x24, 0x4e, 0x25, 0xfa, 0xc1, 0x68, 0x24, 0xe7, 0x91, 0x42, 0x7f, 0xd1, 0xf5, 0x43, 0x1e, 0x71,
0x14, 0xe8, 0xcd, 0x62, 0xa9, 0x24, 0xa5, 0x46, 0xe1, 0x65, 0x0a, 0x6f, 0xd1, 0x6d, 0x34, 0x73,
0x5c, 0x6a, 0x69, 0x0c, 0xee, 0x1b, 0x01, 0xab, 0x67, 0x22, 0x1e, 0x54, 0xa0, 0x38, 0xbd, 0x84,
0xdd, 0x4c, 0x68, 0x93, 0x56, 0xa9, 0x5d, 0x3b, 0x73, 0xbd, 0xff, 0xa1, 0x5e, 0xea, 0xb9, 0x32,
0x88, 0xfd, 0x78, 0x68, 0x0f, 0x8e, 0x44, 0x24, 0xd4, 0x20, 0x05, 0x83, 0x29, 0x86, 0x68, 0x17,
0x75, 0x50, 0x33, 0x2f, 0xa8, 0x8f, 0xe1, 0x4d, 0x24, 0x14, 0x3b, 0x48, 0x5c, 0x69, 0x5c, 0x1f,
0x43, 0x74, 0xdf, 0x09, 0xd4, 0xff, 0x6e, 0xa1, 0x36, 0xec, 0x04, 0xe3, 0x71, 0xcc, 0x31, 0xa9,
0x46, 0xda, 0x7b, 0x2c, 0x1b, 0xe9, 0x09, 0x58, 0xd9, 0x42, 0xb5, 0x9a, 0x71, 0xbb, 0xa8, 0x7f,
0xd7, 0x52, 0xf6, 0xb8, 0x9a, 0x71, 0x7a, 0x0a, 0xf5, 0x4c, 0x12, 0xcd, 0xa7, 0x43, 0x1e, 0xdb,
0xa5, 0x16, 0x69, 0x97, 0xd9, 0x7e, 0x4a, 0xef, 0x34, 0xa4, 0x1d, 0xa8, 0x60, 0xf2, 0x10, 0x76,
0x59, 0x77, 0x6e, 0xe4, 0x75, 0xbe, 0x7d, 0xba, 0x0f, 0x44, 0xcc, 0x8c, 0xd0, 0xed, 0x40, 0xd5,
0x00, 0x7a, 0x08, 0xa5, 0x09, 0x5f, 0xe9, 0x6e, 0x16, 0x4b, 0x3e, 0xe9, 0x31, 0x54, 0x16, 0xc1,
0xcb, 0xdc, 0x14, 0xb2, 0x98, 0x19, 0xae, 0x2f, 0x3e, 0x36, 0x0e, 0x59, 0x6f, 0x1c, 0xf2, 0xb5,
0x71, 0xc8, 0xeb, 0xd6, 0x29, 0xac, 0xb7, 0x4e, 0xe1, 0x73, 0xeb, 0x14, 0x9e, 0x1b, 0x66, 0x1b,
0x8e, 0x27, 0x9e, 0x90, 0xfe, 0xf2, 0xf7, 0xcd, 0x86, 0x55, 0x7d, 0xb1, 0xf3, 0xef, 0x00, 0x00,
0x00, 0xff, 0xff, 0x06, 0xd4, 0x9c, 0x6a, 0x06, 0x02, 0x00, 0x00,
}
func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.InitAccountMsgs) > 0 {
for iNdEx := len(m.InitAccountMsgs) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.InitAccountMsgs[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
}
}
if len(m.Accounts) > 0 {
for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Accounts[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func (m *GenesisAccount) 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 *GenesisAccount) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GenesisAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.State) > 0 {
for iNdEx := len(m.State) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.State[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x22
}
}
if m.AccountNumber != 0 {
i = encodeVarintGenesis(dAtA, i, uint64(m.AccountNumber))
i--
dAtA[i] = 0x18
}
if len(m.AccountType) > 0 {
i -= len(m.AccountType)
copy(dAtA[i:], m.AccountType)
i = encodeVarintGenesis(dAtA, i, uint64(len(m.AccountType)))
i--
dAtA[i] = 0x12
}
if len(m.Address) > 0 {
i -= len(m.Address)
copy(dAtA[i:], m.Address)
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Address)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *KVPair) 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 *KVPair) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *KVPair) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Value) > 0 {
i -= len(m.Value)
copy(dAtA[i:], m.Value)
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Value)))
i--
dAtA[i] = 0x12
}
if len(m.Key) > 0 {
i -= len(m.Key)
copy(dAtA[i:], m.Key)
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Key)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int {
offset -= sovGenesis(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *GenesisState) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Accounts) > 0 {
for _, e := range m.Accounts {
l = e.Size()
n += 1 + l + sovGenesis(uint64(l))
}
}
if len(m.InitAccountMsgs) > 0 {
for _, e := range m.InitAccountMsgs {
l = e.Size()
n += 1 + l + sovGenesis(uint64(l))
}
}
return n
}
func (m *GenesisAccount) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Address)
if l > 0 {
n += 1 + l + sovGenesis(uint64(l))
}
l = len(m.AccountType)
if l > 0 {
n += 1 + l + sovGenesis(uint64(l))
}
if m.AccountNumber != 0 {
n += 1 + sovGenesis(uint64(m.AccountNumber))
}
if len(m.State) > 0 {
for _, e := range m.State {
l = e.Size()
n += 1 + l + sovGenesis(uint64(l))
}
}
return n
}
func (m *KVPair) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Key)
if l > 0 {
n += 1 + l + sovGenesis(uint64(l))
}
l = len(m.Value)
if l > 0 {
n += 1 + l + sovGenesis(uint64(l))
}
return n
}
func sovGenesis(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozGenesis(x uint64) (n int) {
return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *GenesisState) 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 ErrIntOverflowGenesis
}
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: GenesisState: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Accounts = append(m.Accounts, &GenesisAccount{})
if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field InitAccountMsgs", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.InitAccountMsgs = append(m.InitAccountMsgs, &MsgInit{})
if err := m.InitAccountMsgs[len(m.InitAccountMsgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenesis(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthGenesis
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *GenesisAccount) 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 ErrIntOverflowGenesis
}
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: GenesisAccount: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GenesisAccount: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
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 ErrInvalidLengthGenesis
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Address = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field AccountType", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
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 ErrInvalidLengthGenesis
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.AccountType = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field AccountNumber", wireType)
}
m.AccountNumber = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.AccountNumber |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field State", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.State = append(m.State, &KVPair{})
if err := m.State[len(m.State)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenesis(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthGenesis
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *KVPair) 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 ErrIntOverflowGenesis
}
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: KVPair: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: KVPair: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
if m.Key == nil {
m.Key = []byte{}
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
if m.Value == nil {
m.Value = []byte{}
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenesis(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthGenesis
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipGenesis(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, ErrIntOverflowGenesis
}
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, ErrIntOverflowGenesis
}
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, ErrIntOverflowGenesis
}
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, ErrInvalidLengthGenesis
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupGenesis
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthGenesis
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)