From bb58086634dfdebcf68339c40a570c448efebcf2 Mon Sep 17 00:00:00 2001 From: Alex Gartner Date: Wed, 4 Sep 2024 12:44:32 -0700 Subject: [PATCH 1/2] fix: register all interfaces in encoding config --- app/encoding.go | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/app/encoding.go b/app/encoding.go index fed40e3286..a22bef2df0 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -1,17 +1,47 @@ package app import ( + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/authz" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" evmenc "github.com/zeta-chain/ethermint/encoding" ethermint "github.com/zeta-chain/ethermint/types" + evmtypes "github.com/zeta-chain/ethermint/x/evm/types" + + crosschaintypes "github.com/zeta-chain/node/x/crosschain/types" + emissionstypes "github.com/zeta-chain/node/x/emissions/types" + fungibletypes "github.com/zeta-chain/node/x/fungible/types" + observertypes "github.com/zeta-chain/node/x/observer/types" ) // MakeEncodingConfig creates an EncodingConfig for testing func MakeEncodingConfig() ethermint.EncodingConfig { - //encodingConfig := params.MakeEncodingConfig() encodingConfig := evmenc.MakeConfig(ModuleBasics) - //std.RegisterLegacyAminoCodec(encodingConfig.Amino) - //std.RegisterInterfaces(encodingConfig.InterfaceRegistry) - //ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) - //ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) + registry := encodingConfig.InterfaceRegistry + + cryptocodec.RegisterInterfaces(registry) + authtypes.RegisterInterfaces(registry) + authz.RegisterInterfaces(registry) + banktypes.RegisterInterfaces(registry) + stakingtypes.RegisterInterfaces(registry) + slashingtypes.RegisterInterfaces(registry) + upgradetypes.RegisterInterfaces(registry) + distrtypes.RegisterInterfaces(registry) + evidencetypes.RegisterInterfaces(registry) + crisistypes.RegisterInterfaces(registry) + evmtypes.RegisterInterfaces(registry) + ethermint.RegisterInterfaces(registry) + crosschaintypes.RegisterInterfaces(registry) + emissionstypes.RegisterInterfaces(registry) + fungibletypes.RegisterInterfaces(registry) + observertypes.RegisterInterfaces(registry) + return encodingConfig } From 5c99a7c586b52cd42cf07b9e1f2254b44715ff6f Mon Sep 17 00:00:00 2001 From: Alex Gartner Date: Tue, 10 Sep 2024 09:38:06 -0700 Subject: [PATCH 2/2] register more types --- app/encoding.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/encoding.go b/app/encoding.go index a22bef2df0..2e8c728b0f 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -15,9 +15,11 @@ import ( ethermint "github.com/zeta-chain/ethermint/types" evmtypes "github.com/zeta-chain/ethermint/x/evm/types" + authoritytypes "github.com/zeta-chain/node/x/authority/types" crosschaintypes "github.com/zeta-chain/node/x/crosschain/types" emissionstypes "github.com/zeta-chain/node/x/emissions/types" fungibletypes "github.com/zeta-chain/node/x/fungible/types" + lightclienttypes "github.com/zeta-chain/node/x/lightclient/types" observertypes "github.com/zeta-chain/node/x/observer/types" ) @@ -38,10 +40,12 @@ func MakeEncodingConfig() ethermint.EncodingConfig { crisistypes.RegisterInterfaces(registry) evmtypes.RegisterInterfaces(registry) ethermint.RegisterInterfaces(registry) + authoritytypes.RegisterInterfaces(registry) crosschaintypes.RegisterInterfaces(registry) emissionstypes.RegisterInterfaces(registry) fungibletypes.RegisterInterfaces(registry) observertypes.RegisterInterfaces(registry) + lightclienttypes.RegisterInterfaces(registry) return encodingConfig }