diff --git a/x/auth/module.go b/x/auth/module.go index 45e845a02527..03394db7bd51 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -11,12 +11,12 @@ import ( "cosmossdk.io/collections" "cosmossdk.io/core/appmodule" appmodulev2 "cosmossdk.io/core/appmodule/v2" + "cosmossdk.io/core/codec" "cosmossdk.io/core/registry" "cosmossdk.io/core/transaction" "cosmossdk.io/schema" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/simsx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" @@ -123,7 +123,11 @@ func (am AppModule) RegisterMigrations(mr appmodule.MigrationRegistrar) error { // DefaultGenesis returns default genesis state as raw bytes for the auth module. func (am AppModule) DefaultGenesis() json.RawMessage { - return am.cdc.MustMarshalJSON(types.DefaultGenesisState()) + data, err := am.cdc.MarshalJSON(types.DefaultGenesisState()) + if err != nil { + panic(err) + } + return data } // ValidateGenesis performs genesis state validation for the auth module. diff --git a/x/auth/tx/decoder.go b/x/auth/tx/decoder.go index 93474a6bb5b7..7141cc054b9d 100644 --- a/x/auth/tx/decoder.go +++ b/x/auth/tx/decoder.go @@ -5,10 +5,10 @@ import ( txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" "cosmossdk.io/core/address" + "cosmossdk.io/core/codec" errorsmod "cosmossdk.io/errors" "cosmossdk.io/x/tx/decode" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/tx" diff --git a/x/auth/tx/encoder.go b/x/auth/tx/encoder.go index f40e75962686..03845177a23d 100644 --- a/x/auth/tx/encoder.go +++ b/x/auth/tx/encoder.go @@ -6,7 +6,8 @@ import ( gogoproto "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/proto" - "github.com/cosmos/cosmos-sdk/codec" + "cosmossdk.io/core/codec" + sdk "github.com/cosmos/cosmos-sdk/types" sdktx "github.com/cosmos/cosmos-sdk/types/tx" ) diff --git a/x/auth/types/genesis.go b/x/auth/types/genesis.go index d0b6db9dbefd..8c706511adba 100644 --- a/x/auth/types/genesis.go +++ b/x/auth/types/genesis.go @@ -9,7 +9,8 @@ import ( "github.com/cosmos/gogoproto/proto" gogoprotoany "github.com/cosmos/gogoproto/types/any" - "github.com/cosmos/cosmos-sdk/codec" + "cosmossdk.io/core/codec" + "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" @@ -55,7 +56,9 @@ func GetGenesisStateFromAppState(cdc codec.Codec, appState map[string]json.RawMe var genesisState GenesisState if appState[ModuleName] != nil { - cdc.MustUnmarshalJSON(appState[ModuleName], &genesisState) + if err := cdc.UnmarshalJSON(appState[ModuleName], &genesisState); err != nil { + panic(err) + } } return genesisState