chore(x/auth): use cosmossdk.io/core/codec instead of github.com/cosmos/cosmos-sdk/codec (#23403)

Co-authored-by: Alex | Interchain Labs <alex@skip.money>
This commit is contained in:
caseylove 2025-01-17 17:53:22 +08:00 committed by GitHub
parent b8638f892c
commit ef285497fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 6 deletions

View File

@ -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.

View File

@ -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"

View File

@ -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"
)

View File

@ -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