From 1581f89164b6128eafa27b34b15c077703ce94ac Mon Sep 17 00:00:00 2001 From: beer-1 <147697694+beer-1@users.noreply.github.com> Date: Fri, 18 Oct 2024 20:52:00 +0900 Subject: [PATCH] add missing genesis (#72) --- proto/minievm/evm/v1/genesis.proto | 40 +- x/evm/keeper/genesis.go | 82 ++- x/evm/keeper/genesis_test.go | 28 +- x/evm/types/genesis.pb.go | 840 ++++++++++++++++++++++++++--- 4 files changed, 893 insertions(+), 97 deletions(-) diff --git a/proto/minievm/evm/v1/genesis.proto b/proto/minievm/evm/v1/genesis.proto index a207438..e70eff6 100644 --- a/proto/minievm/evm/v1/genesis.proto +++ b/proto/minievm/evm/v1/genesis.proto @@ -17,19 +17,36 @@ message GenesisState { (gogoproto.nullable) = false ]; + // erc20 contracts + repeated bytes erc20s = 3 [ + (gogoproto.moretags) = "yaml:\"erc20s\"", + (gogoproto.customname) = "ERC20s" + ]; + // erc20 stores - repeated GenesisERC20Stores erc20_stores = 3 [ + repeated GenesisERC20Stores erc20_stores = 4 [ (gogoproto.moretags) = "yaml:\"erc20_stores\"", (gogoproto.nullable) = false ]; - repeated GenesisDenomAddress denom_addresses = 4 [ - (gogoproto.moretags) = "yaml:\"denom_addresses\"", + repeated GenesisDenomTrace denom_traces = 5 [ + (gogoproto.moretags) = "yaml:\"denom_traces\"", + (gogoproto.nullable) = false + ]; + + repeated GenesisClassTrace class_traces = 6 [ + (gogoproto.moretags) = "yaml:\"class_traces\"", + (gogoproto.nullable) = false + ]; + + repeated GenesisEVMBlockHash evm_block_hashes = 7 [ + (gogoproto.moretags) = "yaml:\"evm_block_hashes\"", + (gogoproto.customname) = "EVMBlockHashes", (gogoproto.nullable) = false ]; // erc20 factory contract address - bytes erc20_factory = 5; + bytes erc20_factory = 8; } // GenesisKeyValue defines store KV values. @@ -44,8 +61,19 @@ message GenesisERC20Stores { repeated bytes stores = 2; } -// GenesisDenomAddress defines erc20 contract address of denom. -message GenesisDenomAddress { +// GenesisDenomTrace defines erc20 contract address of denom. +message GenesisDenomTrace { string denom = 1; bytes contract_address = 2; } + +message GenesisClassTrace { + string class_id = 1; + bytes contract_address = 2; + string uri = 3; +} + +message GenesisEVMBlockHash { + bytes hash = 1; + uint64 height = 2; +} diff --git a/x/evm/keeper/genesis.go b/x/evm/keeper/genesis.go index 1bc066e..b099877 100644 --- a/x/evm/keeper/genesis.go +++ b/x/evm/keeper/genesis.go @@ -73,6 +73,12 @@ func (k Keeper) InitGenesis(ctx context.Context, genState types.GenesisState) er } } + for _, erc20 := range genState.ERC20s { + if err := k.ERC20s.Set(ctx, erc20); err != nil { + return err + } + } + for _, stores := range genState.Erc20Stores { for _, store := range stores.Stores { if err := k.ERC20Stores.Set(ctx, collections.Join(stores.Address, store)); err != nil { @@ -81,12 +87,32 @@ func (k Keeper) InitGenesis(ctx context.Context, genState types.GenesisState) er } } - for _, denomAddress := range genState.DenomAddresses { - if err := k.ERC20ContractAddrsByDenom.Set(ctx, denomAddress.Denom, denomAddress.ContractAddress); err != nil { + for _, denomTrace := range genState.DenomTraces { + if err := k.ERC20ContractAddrsByDenom.Set(ctx, denomTrace.Denom, denomTrace.ContractAddress); err != nil { + return err + } + + if err := k.ERC20DenomsByContractAddr.Set(ctx, denomTrace.ContractAddress, denomTrace.Denom); err != nil { + return err + } + } + + for _, classTrace := range genState.ClassTraces { + if err := k.ERC721ContractAddrsByClassId.Set(ctx, classTrace.ClassId, classTrace.ContractAddress); err != nil { return err } - if err := k.ERC20DenomsByContractAddr.Set(ctx, denomAddress.ContractAddress, denomAddress.Denom); err != nil { + if err := k.ERC721ClassIdsByContractAddr.Set(ctx, classTrace.ContractAddress, classTrace.ClassId); err != nil { + return err + } + + if err := k.ERC721ClassURIs.Set(ctx, classTrace.ContractAddress, classTrace.Uri); err != nil { + return err + } + } + + for _, blockHash := range genState.EVMBlockHashes { + if err := k.EVMBlockHashes.Set(ctx, blockHash.Height, blockHash.Hash); err != nil { return err } } @@ -109,6 +135,15 @@ func (k Keeper) ExportGenesis(ctx context.Context) *types.GenesisState { panic(err) } + erc20s := [][]byte{} + err = k.ERC20s.Walk(ctx, nil, func(erc20 []byte) (stop bool, err error) { + erc20s = append(erc20s, erc20) + return false, nil + }) + if err != nil { + panic(err) + } + var stores *types.GenesisERC20Stores erc20Stores := []types.GenesisERC20Stores{} err = k.ERC20Stores.Walk(ctx, nil, func(key collections.Pair[[]byte, []byte]) (stop bool, err error) { @@ -129,9 +164,9 @@ func (k Keeper) ExportGenesis(ctx context.Context) *types.GenesisState { panic(err) } - denomAddresses := []types.GenesisDenomAddress{} + denomTraces := []types.GenesisDenomTrace{} err = k.ERC20ContractAddrsByDenom.Walk(ctx, nil, func(denom string, contractAddr []byte) (stop bool, err error) { - denomAddresses = append(denomAddresses, types.GenesisDenomAddress{ + denomTraces = append(denomTraces, types.GenesisDenomTrace{ Denom: denom, ContractAddress: contractAddr, }) @@ -142,6 +177,38 @@ func (k Keeper) ExportGenesis(ctx context.Context) *types.GenesisState { panic(err) } + classTraces := []types.GenesisClassTrace{} + err = k.ERC721ContractAddrsByClassId.Walk(ctx, nil, func(classId string, contractAddr []byte) (stop bool, err error) { + uri, err := k.ERC721ClassURIs.Get(ctx, contractAddr) + if err != nil { + panic(err) + } + + classTraces = append(classTraces, types.GenesisClassTrace{ + ClassId: classId, + ContractAddress: contractAddr, + Uri: uri, + }) + + return false, nil + }) + if err != nil { + panic(err) + } + + evmBlockHashes := []types.GenesisEVMBlockHash{} + err = k.EVMBlockHashes.Walk(ctx, nil, func(height uint64, hash []byte) (stop bool, err error) { + evmBlockHashes = append(evmBlockHashes, types.GenesisEVMBlockHash{ + Height: height, + Hash: hash, + }) + + return false, nil + }) + if err != nil { + panic(err) + } + factoryAddr, err := k.ERC20FactoryAddr.Get(ctx) if err != nil { panic(err) @@ -150,8 +217,11 @@ func (k Keeper) ExportGenesis(ctx context.Context) *types.GenesisState { return &types.GenesisState{ Params: params, KeyValues: kvs, + ERC20s: erc20s, Erc20Stores: erc20Stores, - DenomAddresses: denomAddresses, + DenomTraces: denomTraces, + ClassTraces: classTraces, Erc20Factory: factoryAddr, + EVMBlockHashes: evmBlockHashes, } } diff --git a/x/evm/keeper/genesis_test.go b/x/evm/keeper/genesis_test.go index 9238d64..7008cde 100644 --- a/x/evm/keeper/genesis_test.go +++ b/x/evm/keeper/genesis_test.go @@ -12,6 +12,10 @@ func Test_Genesis(t *testing.T) { genState := types.DefaultGenesis() genState.Erc20Factory = []byte{5, 6, 7, 8} + genState.ERC20s = [][]byte{ + {1, 2, 3}, + {4, 5, 6}, + } genState.Erc20Stores = []types.GenesisERC20Stores{ { Address: []byte{1, 2, 3}, @@ -36,7 +40,7 @@ func Test_Genesis(t *testing.T) { Value: []byte{1, 2, 3, 5, 32, 4}, }, } - genState.DenomAddresses = []types.GenesisDenomAddress{ + genState.DenomTraces = []types.GenesisDenomTrace{ { Denom: "denom1", ContractAddress: []byte{1, 2, 3, 4, 5, 6, 7}, @@ -46,6 +50,28 @@ func Test_Genesis(t *testing.T) { ContractAddress: []byte{8, 9, 1, 2, 3, 4}, }, } + genState.ClassTraces = []types.GenesisClassTrace{ + { + ClassId: "class1", + ContractAddress: []byte{1, 2, 3, 4, 5, 6, 7}, + Uri: "uri1", + }, + { + ClassId: "class2", + ContractAddress: []byte{8, 9, 1, 2, 3, 4}, + Uri: "uri2", + }, + } + genState.EVMBlockHashes = []types.GenesisEVMBlockHash{ + { + Height: 1, + Hash: []byte{1, 2, 3, 4, 5, 6, 7}, + }, + { + Height: 2, + Hash: []byte{8, 9, 1, 2, 3, 4}, + }, + } err := input.EVMKeeper.InitGenesis(ctx, *genState) require.NoError(t, err) diff --git a/x/evm/types/genesis.pb.go b/x/evm/types/genesis.pb.go index 120f942..65bc6fb 100644 --- a/x/evm/types/genesis.pb.go +++ b/x/evm/types/genesis.pb.go @@ -29,11 +29,15 @@ type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // vm kv store KeyValues []GenesisKeyValue `protobuf:"bytes,2,rep,name=key_values,json=keyValues,proto3" json:"key_values" yaml:"key_values"` + // erc20 contracts + ERC20s [][]byte `protobuf:"bytes,3,rep,name=erc20s,proto3" json:"erc20s,omitempty" yaml:"erc20s"` // erc20 stores - Erc20Stores []GenesisERC20Stores `protobuf:"bytes,3,rep,name=erc20_stores,json=erc20Stores,proto3" json:"erc20_stores" yaml:"erc20_stores"` - DenomAddresses []GenesisDenomAddress `protobuf:"bytes,4,rep,name=denom_addresses,json=denomAddresses,proto3" json:"denom_addresses" yaml:"denom_addresses"` + Erc20Stores []GenesisERC20Stores `protobuf:"bytes,4,rep,name=erc20_stores,json=erc20Stores,proto3" json:"erc20_stores" yaml:"erc20_stores"` + DenomTraces []GenesisDenomTrace `protobuf:"bytes,5,rep,name=denom_traces,json=denomTraces,proto3" json:"denom_traces" yaml:"denom_traces"` + ClassTraces []GenesisClassTrace `protobuf:"bytes,6,rep,name=class_traces,json=classTraces,proto3" json:"class_traces" yaml:"class_traces"` + EVMBlockHashes []GenesisEVMBlockHash `protobuf:"bytes,7,rep,name=evm_block_hashes,json=evmBlockHashes,proto3" json:"evm_block_hashes" yaml:"evm_block_hashes"` // erc20 factory contract address - Erc20Factory []byte `protobuf:"bytes,5,opt,name=erc20_factory,json=erc20Factory,proto3" json:"erc20_factory,omitempty"` + Erc20Factory []byte `protobuf:"bytes,8,opt,name=erc20_factory,json=erc20Factory,proto3" json:"erc20_factory,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -83,6 +87,13 @@ func (m *GenesisState) GetKeyValues() []GenesisKeyValue { return nil } +func (m *GenesisState) GetERC20s() [][]byte { + if m != nil { + return m.ERC20s + } + return nil +} + func (m *GenesisState) GetErc20Stores() []GenesisERC20Stores { if m != nil { return m.Erc20Stores @@ -90,9 +101,23 @@ func (m *GenesisState) GetErc20Stores() []GenesisERC20Stores { return nil } -func (m *GenesisState) GetDenomAddresses() []GenesisDenomAddress { +func (m *GenesisState) GetDenomTraces() []GenesisDenomTrace { + if m != nil { + return m.DenomTraces + } + return nil +} + +func (m *GenesisState) GetClassTraces() []GenesisClassTrace { + if m != nil { + return m.ClassTraces + } + return nil +} + +func (m *GenesisState) GetEVMBlockHashes() []GenesisEVMBlockHash { if m != nil { - return m.DenomAddresses + return m.EVMBlockHashes } return nil } @@ -210,24 +235,24 @@ func (m *GenesisERC20Stores) GetStores() [][]byte { return nil } -// GenesisDenomAddress defines erc20 contract address of denom. -type GenesisDenomAddress struct { +// GenesisDenomTrace defines erc20 contract address of denom. +type GenesisDenomTrace struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` ContractAddress []byte `protobuf:"bytes,2,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` } -func (m *GenesisDenomAddress) Reset() { *m = GenesisDenomAddress{} } -func (m *GenesisDenomAddress) String() string { return proto.CompactTextString(m) } -func (*GenesisDenomAddress) ProtoMessage() {} -func (*GenesisDenomAddress) Descriptor() ([]byte, []int) { +func (m *GenesisDenomTrace) Reset() { *m = GenesisDenomTrace{} } +func (m *GenesisDenomTrace) String() string { return proto.CompactTextString(m) } +func (*GenesisDenomTrace) ProtoMessage() {} +func (*GenesisDenomTrace) Descriptor() ([]byte, []int) { return fileDescriptor_2f1b77281e8b59af, []int{3} } -func (m *GenesisDenomAddress) XXX_Unmarshal(b []byte) error { +func (m *GenesisDenomTrace) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GenesisDenomAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *GenesisDenomTrace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GenesisDenomAddress.Marshal(b, m, deterministic) + return xxx_messageInfo_GenesisDenomTrace.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -237,72 +262,197 @@ func (m *GenesisDenomAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *GenesisDenomAddress) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisDenomAddress.Merge(m, src) +func (m *GenesisDenomTrace) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisDenomTrace.Merge(m, src) } -func (m *GenesisDenomAddress) XXX_Size() int { +func (m *GenesisDenomTrace) XXX_Size() int { return m.Size() } -func (m *GenesisDenomAddress) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisDenomAddress.DiscardUnknown(m) +func (m *GenesisDenomTrace) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisDenomTrace.DiscardUnknown(m) } -var xxx_messageInfo_GenesisDenomAddress proto.InternalMessageInfo +var xxx_messageInfo_GenesisDenomTrace proto.InternalMessageInfo -func (m *GenesisDenomAddress) GetDenom() string { +func (m *GenesisDenomTrace) GetDenom() string { if m != nil { return m.Denom } return "" } -func (m *GenesisDenomAddress) GetContractAddress() []byte { +func (m *GenesisDenomTrace) GetContractAddress() []byte { + if m != nil { + return m.ContractAddress + } + return nil +} + +type GenesisClassTrace struct { + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + ContractAddress []byte `protobuf:"bytes,2,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` + Uri string `protobuf:"bytes,3,opt,name=uri,proto3" json:"uri,omitempty"` +} + +func (m *GenesisClassTrace) Reset() { *m = GenesisClassTrace{} } +func (m *GenesisClassTrace) String() string { return proto.CompactTextString(m) } +func (*GenesisClassTrace) ProtoMessage() {} +func (*GenesisClassTrace) Descriptor() ([]byte, []int) { + return fileDescriptor_2f1b77281e8b59af, []int{4} +} +func (m *GenesisClassTrace) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisClassTrace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisClassTrace.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 *GenesisClassTrace) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisClassTrace.Merge(m, src) +} +func (m *GenesisClassTrace) XXX_Size() int { + return m.Size() +} +func (m *GenesisClassTrace) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisClassTrace.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisClassTrace proto.InternalMessageInfo + +func (m *GenesisClassTrace) GetClassId() string { + if m != nil { + return m.ClassId + } + return "" +} + +func (m *GenesisClassTrace) GetContractAddress() []byte { if m != nil { return m.ContractAddress } return nil } +func (m *GenesisClassTrace) GetUri() string { + if m != nil { + return m.Uri + } + return "" +} + +type GenesisEVMBlockHash struct { + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` +} + +func (m *GenesisEVMBlockHash) Reset() { *m = GenesisEVMBlockHash{} } +func (m *GenesisEVMBlockHash) String() string { return proto.CompactTextString(m) } +func (*GenesisEVMBlockHash) ProtoMessage() {} +func (*GenesisEVMBlockHash) Descriptor() ([]byte, []int) { + return fileDescriptor_2f1b77281e8b59af, []int{5} +} +func (m *GenesisEVMBlockHash) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisEVMBlockHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisEVMBlockHash.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 *GenesisEVMBlockHash) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisEVMBlockHash.Merge(m, src) +} +func (m *GenesisEVMBlockHash) XXX_Size() int { + return m.Size() +} +func (m *GenesisEVMBlockHash) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisEVMBlockHash.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisEVMBlockHash proto.InternalMessageInfo + +func (m *GenesisEVMBlockHash) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +func (m *GenesisEVMBlockHash) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + func init() { proto.RegisterType((*GenesisState)(nil), "minievm.evm.v1.GenesisState") proto.RegisterType((*GenesisKeyValue)(nil), "minievm.evm.v1.GenesisKeyValue") proto.RegisterType((*GenesisERC20Stores)(nil), "minievm.evm.v1.GenesisERC20Stores") - proto.RegisterType((*GenesisDenomAddress)(nil), "minievm.evm.v1.GenesisDenomAddress") + proto.RegisterType((*GenesisDenomTrace)(nil), "minievm.evm.v1.GenesisDenomTrace") + proto.RegisterType((*GenesisClassTrace)(nil), "minievm.evm.v1.GenesisClassTrace") + proto.RegisterType((*GenesisEVMBlockHash)(nil), "minievm.evm.v1.GenesisEVMBlockHash") } func init() { proto.RegisterFile("minievm/evm/v1/genesis.proto", fileDescriptor_2f1b77281e8b59af) } var fileDescriptor_2f1b77281e8b59af = []byte{ - // 460 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcf, 0x6e, 0xd3, 0x40, - 0x10, 0xc6, 0xe3, 0xa6, 0x0d, 0xea, 0xc4, 0x34, 0x65, 0x5b, 0x45, 0x26, 0x20, 0x27, 0xda, 0x5e, - 0x02, 0x12, 0x76, 0x1b, 0xb8, 0xc0, 0x8d, 0x50, 0xca, 0x81, 0x0b, 0xda, 0x4a, 0x95, 0xe0, 0x12, - 0x6d, 0x9c, 0xc5, 0x58, 0xb1, 0xbd, 0x91, 0x77, 0x6b, 0xe1, 0xb7, 0xe0, 0xc4, 0x33, 0xf5, 0xd8, - 0x23, 0xa7, 0x0a, 0x25, 0x6f, 0xc0, 0x13, 0xa0, 0xfd, 0x63, 0x51, 0x0c, 0x3d, 0x58, 0xda, 0xd9, - 0xf9, 0xfc, 0xfb, 0x66, 0x66, 0x07, 0x1e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0xff, 0xff, 0x4e, 0xce, 0x4b, 0xd8, 0x22, 0x03, 0x00, 0x00, + // 626 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xcd, 0x4e, 0xdb, 0x4c, + 0x14, 0x86, 0x63, 0x12, 0x0c, 0x4c, 0xcc, 0xdf, 0x80, 0xf8, 0x0c, 0x7c, 0xb2, 0xd3, 0x61, 0x93, + 0x56, 0x6a, 0x42, 0x42, 0x37, 0xed, 0x0e, 0x43, 0x69, 0xab, 0xaa, 0x52, 0x35, 0x20, 0xa4, 0x76, + 0x63, 0x4d, 0xec, 0x69, 0x6c, 0x25, 0x8e, 0x23, 0x8f, 0x63, 0xd5, 0xbb, 0x5e, 0x42, 0xaf, 0xa2, + 0xd7, 0xc2, 0x92, 0x65, 0x57, 0x51, 0x95, 0xdc, 0x01, 0x57, 0x50, 0xcd, 0x4f, 0x42, 0x1a, 0x48, + 0xa5, 0x2e, 0x2c, 0x9d, 0x73, 0xe6, 0xf5, 0xf3, 0x8e, 0xce, 0x39, 0x1a, 0xf0, 0x7f, 0x14, 0xf6, + 0x42, 0x9a, 0x45, 0x75, 0xfe, 0x65, 0x8d, 0x7a, 0x9b, 0xf6, 0x28, 0x0b, 0x59, 0xad, 0x9f, 0xc4, + 0x69, 0x0c, 0x37, 0xd4, 0x69, 0x8d, 0x7f, 0x59, 0xe3, 0x60, 0xb7, 0x1d, 0xb7, 0x63, 0x71, 0x54, + 0xe7, 0x91, 0x54, 0x1d, 0x1c, 0xcc, 0x31, 0xd2, 0xbc, 0x4f, 0x15, 0x01, 0xfd, 0x58, 0x06, 0xc6, + 0x1b, 0xc9, 0xbc, 0x4c, 0x49, 0x4a, 0xe1, 0x0b, 0xa0, 0xf7, 0x49, 0x42, 0x22, 0x66, 0x6a, 0x15, + 0xad, 0x5a, 0x6e, 0xee, 0xd5, 0xfe, 0xf4, 0xa8, 0x7d, 0x14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, 0x19, 0x22, 0x84, 0xa0, 0xc4, 0x87, 0xa3, 0x1a, 0x21, 0x62, + 0xde, 0x85, 0x80, 0x86, 0xed, 0x20, 0x15, 0xf4, 0x12, 0x56, 0x99, 0x73, 0x7e, 0x33, 0xb2, 0xb4, + 0xdb, 0x91, 0xa5, 0xfd, 0x1a, 0x59, 0xda, 0xf7, 0xb1, 0x55, 0xb8, 0x1d, 0x5b, 0x85, 0x9f, 0x63, + 0xab, 0xf0, 0xf9, 0x59, 0x3b, 0x4c, 0x83, 0x41, 0xab, 0xe6, 0xc5, 0x51, 0x3d, 0xec, 0x85, 0x69, + 0x48, 0x9e, 0x77, 0x49, 0x8b, 0xd5, 0x27, 0xcf, 0xcf, 0x57, 0xf1, 0x00, 0x89, 0xd7, 0xa7, 0xa5, + 0x8b, 0xe7, 0xe7, 0xe4, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x41, 0xe3, 0x75, 0x71, 0xe0, 0x04, + 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -330,12 +480,12 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Erc20Factory) i = encodeVarintGenesis(dAtA, i, uint64(len(m.Erc20Factory))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x42 } - if len(m.DenomAddresses) > 0 { - for iNdEx := len(m.DenomAddresses) - 1; iNdEx >= 0; iNdEx-- { + if len(m.EVMBlockHashes) > 0 { + for iNdEx := len(m.EVMBlockHashes) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.DenomAddresses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.EVMBlockHashes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -343,7 +493,35 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x3a + } + } + if len(m.ClassTraces) > 0 { + for iNdEx := len(m.ClassTraces) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ClassTraces[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.DenomTraces) > 0 { + for iNdEx := len(m.DenomTraces) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DenomTraces[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a } } if len(m.Erc20Stores) > 0 { @@ -357,6 +535,15 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x22 + } + } + if len(m.ERC20s) > 0 { + for iNdEx := len(m.ERC20s) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ERC20s[iNdEx]) + copy(dAtA[i:], m.ERC20s[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ERC20s[iNdEx]))) + i-- dAtA[i] = 0x1a } } @@ -463,7 +650,7 @@ func (m *GenesisERC20Stores) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *GenesisDenomAddress) Marshal() (dAtA []byte, err error) { +func (m *GenesisDenomTrace) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -473,12 +660,12 @@ func (m *GenesisDenomAddress) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GenesisDenomAddress) MarshalTo(dAtA []byte) (int, error) { +func (m *GenesisDenomTrace) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GenesisDenomAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *GenesisDenomTrace) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -500,6 +687,85 @@ func (m *GenesisDenomAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *GenesisClassTrace) 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 *GenesisClassTrace) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisClassTrace) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Uri) > 0 { + i -= len(m.Uri) + copy(dAtA[i:], m.Uri) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Uri))) + i-- + dAtA[i] = 0x1a + } + if len(m.ContractAddress) > 0 { + i -= len(m.ContractAddress) + copy(dAtA[i:], m.ContractAddress) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ContractAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GenesisEVMBlockHash) 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 *GenesisEVMBlockHash) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisEVMBlockHash) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + } + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { offset -= sovGenesis(v) base := offset @@ -525,14 +791,32 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.ERC20s) > 0 { + for _, b := range m.ERC20s { + l = len(b) + n += 1 + l + sovGenesis(uint64(l)) + } + } if len(m.Erc20Stores) > 0 { for _, e := range m.Erc20Stores { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.DenomAddresses) > 0 { - for _, e := range m.DenomAddresses { + if len(m.DenomTraces) > 0 { + for _, e := range m.DenomTraces { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.ClassTraces) > 0 { + for _, e := range m.ClassTraces { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.EVMBlockHashes) > 0 { + for _, e := range m.EVMBlockHashes { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } @@ -580,7 +864,7 @@ func (m *GenesisERC20Stores) Size() (n int) { return n } -func (m *GenesisDenomAddress) Size() (n int) { +func (m *GenesisDenomTrace) Size() (n int) { if m == nil { return 0 } @@ -597,6 +881,43 @@ func (m *GenesisDenomAddress) Size() (n int) { return n } +func (m *GenesisClassTrace) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClassId) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.ContractAddress) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Uri) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *GenesisEVMBlockHash) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovGenesis(uint64(m.Height)) + } + return n +} + func sovGenesis(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -700,6 +1021,38 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ERC20s", 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.ERC20s = append(m.ERC20s, make([]byte, postIndex-iNdEx)) + copy(m.ERC20s[len(m.ERC20s)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Erc20Stores", wireType) } @@ -733,9 +1086,9 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DenomAddresses", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DenomTraces", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -762,16 +1115,16 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DenomAddresses = append(m.DenomAddresses, GenesisDenomAddress{}) - if err := m.DenomAddresses[len(m.DenomAddresses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.DenomTraces = append(m.DenomTraces, GenesisDenomTrace{}) + if err := m.DenomTraces[len(m.DenomTraces)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Erc20Factory", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClassTraces", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -781,30 +1134,98 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenesis } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } - m.Erc20Factory = append(m.Erc20Factory[:0], dAtA[iNdEx:postIndex]...) - if m.Erc20Factory == nil { - m.Erc20Factory = []byte{} + m.ClassTraces = append(m.ClassTraces, GenesisClassTrace{}) + if err := m.ClassTraces[len(m.ClassTraces)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EVMBlockHashes", 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.EVMBlockHashes = append(m.EVMBlockHashes, GenesisEVMBlockHash{}) + if err := m.EVMBlockHashes[len(m.EVMBlockHashes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Erc20Factory", 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.Erc20Factory = append(m.Erc20Factory[:0], dAtA[iNdEx:postIndex]...) + if m.Erc20Factory == nil { + m.Erc20Factory = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { @@ -1056,7 +1477,7 @@ func (m *GenesisERC20Stores) Unmarshal(dAtA []byte) error { } return nil } -func (m *GenesisDenomAddress) Unmarshal(dAtA []byte) error { +func (m *GenesisDenomTrace) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1079,10 +1500,10 @@ func (m *GenesisDenomAddress) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GenesisDenomAddress: wiretype end group for non-group") + return fmt.Errorf("proto: GenesisDenomTrace: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisDenomAddress: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GenesisDenomTrace: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1172,6 +1593,257 @@ func (m *GenesisDenomAddress) Unmarshal(dAtA []byte) error { } return nil } +func (m *GenesisClassTrace) 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: GenesisClassTrace: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisClassTrace: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClassId", 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.ClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", 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.ContractAddress = append(m.ContractAddress[:0], dAtA[iNdEx:postIndex]...) + if m.ContractAddress == nil { + m.ContractAddress = []byte{} + } + 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 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.Uri = string(dAtA[iNdEx:postIndex]) + 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 *GenesisEVMBlockHash) 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: GenesisEVMBlockHash: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisEVMBlockHash: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", 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.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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