diff --git a/x/tradeshield/types/codec.go b/x/tradeshield/types/codec.go index 0b06b90d1..c6438065d 100644 --- a/x/tradeshield/types/codec.go +++ b/x/tradeshield/types/codec.go @@ -4,8 +4,12 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" + authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" + govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec" + groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec" ) func RegisterCodec(cdc *codec.LegacyAmino) { @@ -39,6 +43,18 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { } var ( - Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) + amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewAminoCodec(amino) ) + +func init() { + RegisterCodec(amino) + cryptocodec.RegisterCrypto(amino) + sdk.RegisterLegacyAminoCodec(amino) + + // Register all Amino interfaces and concrete types on the authz and gov Amino codec so that this can later be + // used to properly serialize MsgGrant, MsgExec and MsgSubmitProposal instances + RegisterCodec(authzcodec.Amino) + RegisterCodec(govcodec.Amino) + RegisterCodec(groupcodec.Amino) +}