Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: register all interfaces in encoding config #2828

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions app/encoding.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,51 @@
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"

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"
)

// 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)
authoritytypes.RegisterInterfaces(registry)
crosschaintypes.RegisterInterfaces(registry)
emissionstypes.RegisterInterfaces(registry)
fungibletypes.RegisterInterfaces(registry)
observertypes.RegisterInterfaces(registry)
gartnera marked this conversation as resolved.
Show resolved Hide resolved
lightclienttypes.RegisterInterfaces(registry)

return encodingConfig
}
Loading