diff --git a/x/oracle/module.go b/x/oracle/module.go index 55443315f7..a34e6d4531 100644 --- a/x/oracle/module.go +++ b/x/oracle/module.go @@ -34,7 +34,9 @@ func (AppModuleBasic) Name() string { } // RegisterLegacyAminoCodec registers the params module's types on the given LegacyAmino codec. -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} // DefaultGenesis returns default genesis state as raw bytes for the params // module. @@ -58,7 +60,9 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command { return cli.NewQueryCmd() } -func (am AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {} +func (am AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) +} // AppModule implements an application module for the distribution module. type AppModule struct { diff --git a/x/oracle/types/codec.go b/x/oracle/types/codec.go index 956b536831..33d0a6da80 100644 --- a/x/oracle/types/codec.go +++ b/x/oracle/types/codec.go @@ -1,8 +1,27 @@ package types -import "github.com/cosmos/cosmos-sdk/codec" +import ( + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +func RegisterCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgClaim{}, "oracle/Claim", nil) + // this line is used by starport scaffolding # 2 +} + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgClaim{}, + ) + // this line is used by starport scaffolding # 3 + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} var ( - amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewAminoCodec(amino) + Amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) )