Skip to content

Commit

Permalink
cherry pick: 6b233a7
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez committed Dec 18, 2023
1 parent 9a88930 commit b726928
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 3 additions & 0 deletions x/authz/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ package authz
import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/legacy"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
types "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
)

var GlobalCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())

// RegisterLegacyAminoCodec registers the necessary x/authz interfaces and concrete types
// on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
Expand Down
10 changes: 2 additions & 8 deletions x/authz/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@ import (

errorsmod "cosmossdk.io/errors"

"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/authz"
)

var (
_ authz.MsgServer = Keeper{}
GlobalCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
)
var _ authz.MsgServer = Keeper{}

// Grant implements the MsgServer.Grant method to create a new grant.
func (k Keeper) Grant(goCtx context.Context, msg *authz.MsgGrant) (*authz.MsgGrantResponse, error) {
Expand Down Expand Up @@ -143,7 +137,7 @@ func (k Keeper) ExecCompat(goCtx context.Context, msg *authz.MsgExecCompat) (*au
subMsgs := make([]sdk.Msg, len(msg.Msgs))
for idx, m := range msg.Msgs {
var iMsg sdk.Msg
err := GlobalCdc.UnmarshalInterfaceJSON([]byte(m), &iMsg)
err := authz.GlobalCdc.UnmarshalInterfaceJSON([]byte(m), &iMsg)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit b726928

Please sign in to comment.