Skip to content

Commit

Permalink
register codec
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Apr 26, 2024
1 parent baff86e commit 30e51cd
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 40 deletions.
9 changes: 6 additions & 3 deletions x/e2ee/module.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package e2ee

import (
"context"
"encoding/json"
"fmt"

Expand Down Expand Up @@ -46,14 +47,13 @@ func (AppModuleBasic) Name() string {
return types.ModuleName
}

func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) {
}

func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
types.RegisterLegacyAminoCodec(cdc)
}

// RegisterInterfaces registers the module's interface types
func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) {
types.RegisterInterfaces(reg)
}

// DefaultGenesis returns the capability module's default genesis state.
Expand All @@ -76,6 +76,9 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout

// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module.
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil {
panic(err)
}
}

// ----------------------------------------------------------------------------
Expand Down
20 changes: 20 additions & 0 deletions x/e2ee/types/codec.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package types

import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
)

// RegisterLegacyAminoCodec registers the necessary x/bank interfaces and concrete types
// on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
func RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {}

func RegisterInterfaces(registry types.InterfaceRegistry) {
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgRegisterEncryptionKey{},
)

msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}
38 changes: 18 additions & 20 deletions x/e2ee/types/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 15 additions & 17 deletions x/e2ee/types/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 30e51cd

Please sign in to comment.