Skip to content

Commit

Permalink
register msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
yutianwu committed Dec 20, 2022
1 parent 8d535bf commit 2f18dd5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
8 changes: 6 additions & 2 deletions x/oracle/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 {
Expand Down
25 changes: 22 additions & 3 deletions x/oracle/types/codec.go
Original file line number Diff line number Diff line change
@@ -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())
)

0 comments on commit 2f18dd5

Please sign in to comment.