From 684b2ea00488db7b6bb4153096114747b5f66c39 Mon Sep 17 00:00:00 2001 From: Sergi Rene Date: Tue, 3 Dec 2024 17:46:53 +0100 Subject: [PATCH] fix: lint fix deprecated packages (#167) --- app/apptesting/apptesting.go | 3 +- go.mod | 2 +- x/tokenfactory/bindings/message_plugin.go | 35 +++++++------ x/tokenfactory/bindings/query_plugin.go | 9 ++-- x/tokenfactory/bindings/types/msg.go | 2 +- x/tokenfactory/types/denoms.go | 8 +-- x/tokenfactory/types/errors.go | 20 +++---- x/tokenfactory/types/genesis.go | 6 +-- x/tokenfactory/types/msgs.go | 64 ++++------------------- 9 files changed, 54 insertions(+), 95 deletions(-) diff --git a/app/apptesting/apptesting.go b/app/apptesting/apptesting.go index 1d278ee..10da006 100644 --- a/app/apptesting/apptesting.go +++ b/app/apptesting/apptesting.go @@ -20,6 +20,7 @@ import ( tmtypes "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" + sdkmath "cosmossdk.io/math" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/dymensionxyz/rollapp-wasm/app" ) @@ -177,7 +178,7 @@ func (s *KeeperTestHelper) EndBlock() { } // AllocateRewardsToValidator allocates reward tokens to a distribution module then allocates rewards to the validator address. -func (s *KeeperTestHelper) AllocateRewardsToValidator(valAddr sdk.ValAddress, rewardAmt sdk.Int) { +func (s *KeeperTestHelper) AllocateRewardsToValidator(valAddr sdk.ValAddress, rewardAmt sdkmath.Int) { validator, found := s.App.StakingKeeper.GetValidator(s.Ctx, valAddr) s.Require().True(found) diff --git a/go.mod b/go.mod index dbf32c6..d31063e 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( cosmossdk.io/collections v0.4.0 cosmossdk.io/core v0.12.0 cosmossdk.io/errors v1.0.1 + cosmossdk.io/math v1.4.0 github.com/CosmWasm/wasmd v0.33.0 github.com/CosmWasm/wasmvm v1.3.0 github.com/bcdevtools/block-explorer-rpc-cosmos v1.2.3 @@ -46,7 +47,6 @@ require ( cloud.google.com/go/storage v1.38.0 // indirect cosmossdk.io/api v0.7.0 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/math v1.4.0 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect diff --git a/x/tokenfactory/bindings/message_plugin.go b/x/tokenfactory/bindings/message_plugin.go index 1009507..056ac4f 100644 --- a/x/tokenfactory/bindings/message_plugin.go +++ b/x/tokenfactory/bindings/message_plugin.go @@ -3,6 +3,7 @@ package bindings import ( "encoding/json" + errorsmod "cosmossdk.io/errors" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmvmtypes "github.com/CosmWasm/wasmvm/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -41,10 +42,10 @@ func (m *CustomMessenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddre // leave everything else for the wrapped version var contractMsg bindingstypes.TokenFactoryMsg if err := json.Unmarshal(msg.Custom, &contractMsg); err != nil { - return nil, nil, sdkerrors.Wrap(err, "token factory msg") + return nil, nil, errorsmod.Wrap(err, "token factory msg") } if contractMsg.Token == nil { - return nil, nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "nil token field") + return nil, nil, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "nil token field") } tokenMsg := contractMsg.Token @@ -71,7 +72,7 @@ func (m *CustomMessenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddre func (m *CustomMessenger) createDenom(ctx sdk.Context, contractAddr sdk.AccAddress, createDenom *bindingstypes.CreateDenom) ([]sdk.Event, [][]byte, error) { bz, err := PerformCreateDenom(m.tokenFactory, m.bank, ctx, contractAddr, createDenom) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "perform create denom") + return nil, nil, errorsmod.Wrap(err, "perform create denom") } // TODO: double check how this is all encoded to the contract return nil, [][]byte{bz}, nil @@ -88,7 +89,7 @@ func PerformCreateDenom(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, msgCreateDenom := tokenfactorytypes.NewMsgCreateDenom(contractAddr.String(), createDenom.Subdenom) if err := msgCreateDenom.ValidateBasic(); err != nil { - return nil, sdkerrors.Wrap(err, "failed validating MsgCreateDenom") + return nil, errorsmod.Wrap(err, "failed validating MsgCreateDenom") } // Create denom @@ -97,14 +98,14 @@ func PerformCreateDenom(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, msgCreateDenom, ) if err != nil { - return nil, sdkerrors.Wrap(err, "creating denom") + return nil, errorsmod.Wrap(err, "creating denom") } if createDenom.Metadata != nil { newDenom := resp.NewTokenDenom err := PerformSetMetadata(f, b, ctx, contractAddr, newDenom, *createDenom.Metadata) if err != nil { - return nil, sdkerrors.Wrap(err, "setting metadata") + return nil, errorsmod.Wrap(err, "setting metadata") } } @@ -115,7 +116,7 @@ func PerformCreateDenom(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, func (m *CustomMessenger) mintTokens(ctx sdk.Context, contractAddr sdk.AccAddress, mint *bindingstypes.MintTokens) ([]sdk.Event, [][]byte, error) { err := PerformMint(m.tokenFactory, m.bank, ctx, contractAddr, mint) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "perform mint") + return nil, nil, errorsmod.Wrap(err, "perform mint") } return nil, nil, nil } @@ -140,11 +141,11 @@ func PerformMint(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk msgServer := tokenfactorykeeper.NewMsgServerImpl(*f) _, err = msgServer.Mint(sdk.WrapSDKContext(ctx), sdkMsg) if err != nil { - return sdkerrors.Wrap(err, "minting coins from message") + return errorsmod.Wrap(err, "minting coins from message") } err = b.SendCoins(ctx, contractAddr, rcpt, sdk.NewCoins(coin)) if err != nil { - return sdkerrors.Wrap(err, "sending newly minted coins from message") + return errorsmod.Wrap(err, "sending newly minted coins from message") } return nil } @@ -153,7 +154,7 @@ func PerformMint(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk func (m *CustomMessenger) changeAdmin(ctx sdk.Context, contractAddr sdk.AccAddress, changeAdmin *bindingstypes.ChangeAdmin) ([]sdk.Event, [][]byte, error) { err := ChangeAdmin(m.tokenFactory, ctx, contractAddr, changeAdmin) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "failed to change admin") + return nil, nil, errorsmod.Wrap(err, "failed to change admin") } return nil, nil, nil } @@ -176,7 +177,7 @@ func ChangeAdmin(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk msgServer := tokenfactorykeeper.NewMsgServerImpl(*f) _, err = msgServer.ChangeAdmin(sdk.WrapSDKContext(ctx), changeAdminMsg) if err != nil { - return sdkerrors.Wrap(err, "failed changing admin from message") + return errorsmod.Wrap(err, "failed changing admin from message") } return nil } @@ -185,7 +186,7 @@ func ChangeAdmin(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk func (m *CustomMessenger) burnTokens(ctx sdk.Context, contractAddr sdk.AccAddress, burn *bindingstypes.BurnTokens) ([]sdk.Event, [][]byte, error) { err := PerformBurn(m.tokenFactory, ctx, contractAddr, burn) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "perform burn") + return nil, nil, errorsmod.Wrap(err, "perform burn") } return nil, nil, nil } @@ -209,7 +210,7 @@ func PerformBurn(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk msgServer := tokenfactorykeeper.NewMsgServerImpl(*f) _, err := msgServer.Burn(sdk.WrapSDKContext(ctx), sdkMsg) if err != nil { - return sdkerrors.Wrap(err, "burning coins from message") + return errorsmod.Wrap(err, "burning coins from message") } return nil } @@ -218,7 +219,7 @@ func PerformBurn(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk func (m *CustomMessenger) setMetadata(ctx sdk.Context, contractAddr sdk.AccAddress, setMetadata *bindingstypes.SetMetadata) ([]sdk.Event, [][]byte, error) { err := PerformSetMetadata(m.tokenFactory, m.bank, ctx, contractAddr, setMetadata.Denom, setMetadata.Metadata) if err != nil { - return nil, nil, sdkerrors.Wrap(err, "perform create denom") + return nil, nil, errorsmod.Wrap(err, "perform create denom") } return nil, nil, nil } @@ -261,7 +262,7 @@ func GetFullDenom(contract string, subDenom string) (string, error) { } fullDenom, err := tokenfactorytypes.GetTokenDenom(contract, subDenom) if err != nil { - return "", sdkerrors.Wrap(err, "validate sub-denom") + return "", errorsmod.Wrap(err, "validate sub-denom") } return fullDenom, nil @@ -271,11 +272,11 @@ func GetFullDenom(contract string, subDenom string) (string, error) { func parseAddress(addr string) (sdk.AccAddress, error) { parsed, err := sdk.AccAddressFromBech32(addr) if err != nil { - return nil, sdkerrors.Wrap(err, "address from bech32") + return nil, errorsmod.Wrap(err, "address from bech32") } err = sdk.VerifyAddressFormat(parsed) if err != nil { - return nil, sdkerrors.Wrap(err, "verify address format") + return nil, errorsmod.Wrap(err, "verify address format") } return parsed, nil } diff --git a/x/tokenfactory/bindings/query_plugin.go b/x/tokenfactory/bindings/query_plugin.go index 720acd1..6b0f3db 100644 --- a/x/tokenfactory/bindings/query_plugin.go +++ b/x/tokenfactory/bindings/query_plugin.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" + errorsmod "cosmossdk.io/errors" wasmvmtypes "github.com/CosmWasm/wasmvm/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -16,10 +17,10 @@ func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessag return func(ctx sdk.Context, request json.RawMessage) ([]byte, error) { var contractQuery bindingstypes.TokenFactoryQuery if err := json.Unmarshal(request, &contractQuery); err != nil { - return nil, sdkerrors.Wrap(err, "osmosis query") + return nil, errorsmod.Wrap(err, "osmosis query") } if contractQuery.Token == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "nil token field") + return nil, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "nil token field") } tokenQuery := contractQuery.Token @@ -30,7 +31,7 @@ func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessag fullDenom, err := GetFullDenom(creator, subdenom) if err != nil { - return nil, sdkerrors.Wrap(err, "osmo full denom query") + return nil, errorsmod.Wrap(err, "osmo full denom query") } res := bindingstypes.FullDenomResponse{ @@ -39,7 +40,7 @@ func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessag bz, err := json.Marshal(res) if err != nil { - return nil, sdkerrors.Wrap(err, "failed to marshal FullDenomResponse") + return nil, errorsmod.Wrap(err, "failed to marshal FullDenomResponse") } return bz, nil diff --git a/x/tokenfactory/bindings/types/msg.go b/x/tokenfactory/bindings/types/msg.go index b1dabe0..6ec5998 100644 --- a/x/tokenfactory/bindings/types/msg.go +++ b/x/tokenfactory/bindings/types/msg.go @@ -1,6 +1,6 @@ package types -import sdk "github.com/cosmos/cosmos-sdk/types" +import sdk "cosmossdk.io/math" type TokenFactoryMsg struct { Token *TokenMsg `json:"token,omitempty"` diff --git a/x/tokenfactory/types/denoms.go b/x/tokenfactory/types/denoms.go index 7a9f2f9..6583998 100644 --- a/x/tokenfactory/types/denoms.go +++ b/x/tokenfactory/types/denoms.go @@ -3,8 +3,8 @@ package types import ( "strings" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) const ( @@ -46,17 +46,17 @@ func DeconstructDenom(denom string) (creator string, subdenom string, err error) strParts := strings.Split(denom, "/") if len(strParts) < 3 { - return "", "", sdkerrors.Wrapf(ErrInvalidDenom, "not enough parts of denom %s", denom) + return "", "", errorsmod.Wrapf(ErrInvalidDenom, "not enough parts of denom %s", denom) } if strParts[0] != ModuleDenomPrefix { - return "", "", sdkerrors.Wrapf(ErrInvalidDenom, "denom prefix is incorrect. Is: %s. Should be: %s", strParts[0], ModuleDenomPrefix) + return "", "", errorsmod.Wrapf(ErrInvalidDenom, "denom prefix is incorrect. Is: %s. Should be: %s", strParts[0], ModuleDenomPrefix) } creator = strParts[1] creatorAddr, err := sdk.AccAddressFromBech32(creator) if err != nil { - return "", "", sdkerrors.Wrapf(ErrInvalidDenom, "Invalid creator address (%s)", err) + return "", "", errorsmod.Wrapf(ErrInvalidDenom, "Invalid creator address (%s)", err) } // Handle the case where a denom has a slash in its subdenom. For example, diff --git a/x/tokenfactory/types/errors.go b/x/tokenfactory/types/errors.go index 06991f1..7742014 100644 --- a/x/tokenfactory/types/errors.go +++ b/x/tokenfactory/types/errors.go @@ -5,18 +5,18 @@ package types import ( fmt "fmt" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) // x/tokenfactory module sentinel errors var ( - ErrDenomExists = sdkerrors.Register(ModuleName, 2, "attempting to create a denom that already exists (has bank metadata)") - ErrUnauthorized = sdkerrors.Register(ModuleName, 3, "unauthorized account") - ErrInvalidDenom = sdkerrors.Register(ModuleName, 4, "invalid denom") - ErrInvalidCreator = sdkerrors.Register(ModuleName, 5, "invalid creator") - ErrInvalidAuthorityMetadata = sdkerrors.Register(ModuleName, 6, "invalid authority metadata") - ErrInvalidGenesis = sdkerrors.Register(ModuleName, 7, "invalid genesis") - ErrSubdenomTooLong = sdkerrors.Register(ModuleName, 8, fmt.Sprintf("subdenom too long, max length is %d bytes", MaxSubdenomLength)) - ErrCreatorTooLong = sdkerrors.Register(ModuleName, 9, fmt.Sprintf("creator too long, max length is %d bytes", MaxCreatorLength)) - ErrDenomDoesNotExist = sdkerrors.Register(ModuleName, 10, "denom does not exist") + ErrDenomExists = errorsmod.Register(ModuleName, 2, "attempting to create a denom that already exists (has bank metadata)") + ErrUnauthorized = errorsmod.Register(ModuleName, 3, "unauthorized account") + ErrInvalidDenom = errorsmod.Register(ModuleName, 4, "invalid denom") + ErrInvalidCreator = errorsmod.Register(ModuleName, 5, "invalid creator") + ErrInvalidAuthorityMetadata = errorsmod.Register(ModuleName, 6, "invalid authority metadata") + ErrInvalidGenesis = errorsmod.Register(ModuleName, 7, "invalid genesis") + ErrSubdenomTooLong = errorsmod.Register(ModuleName, 8, fmt.Sprintf("subdenom too long, max length is %d bytes", MaxSubdenomLength)) + ErrCreatorTooLong = errorsmod.Register(ModuleName, 9, fmt.Sprintf("creator too long, max length is %d bytes", MaxCreatorLength)) + ErrDenomDoesNotExist = errorsmod.Register(ModuleName, 10, "denom does not exist") ) diff --git a/x/tokenfactory/types/genesis.go b/x/tokenfactory/types/genesis.go index b1ba181..aef9370 100644 --- a/x/tokenfactory/types/genesis.go +++ b/x/tokenfactory/types/genesis.go @@ -1,8 +1,8 @@ package types import ( + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // this line is used by starport scaffolding # genesis/types/import @@ -30,7 +30,7 @@ func (gs GenesisState) Validate() error { for _, denom := range gs.GetFactoryDenoms() { if seenDenoms[denom.GetDenom()] { - return sdkerrors.Wrapf(ErrInvalidGenesis, "duplicate denom: %s", denom.GetDenom()) + return errorsmod.Wrapf(ErrInvalidGenesis, "duplicate denom: %s", denom.GetDenom()) } seenDenoms[denom.GetDenom()] = true @@ -42,7 +42,7 @@ func (gs GenesisState) Validate() error { if denom.AuthorityMetadata.Admin != "" { _, err = sdk.AccAddressFromBech32(denom.AuthorityMetadata.Admin) if err != nil { - return sdkerrors.Wrapf(ErrInvalidAuthorityMetadata, "Invalid admin address (%s)", err) + return errorsmod.Wrapf(ErrInvalidAuthorityMetadata, "Invalid admin address (%s)", err) } } } diff --git a/x/tokenfactory/types/msgs.go b/x/tokenfactory/types/msgs.go index 9c78328..f41689e 100644 --- a/x/tokenfactory/types/msgs.go +++ b/x/tokenfactory/types/msgs.go @@ -1,6 +1,7 @@ package types import ( + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -31,12 +32,12 @@ func (m MsgCreateDenom) Type() string { return TypeMsgCreateDenom } func (m MsgCreateDenom) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(m.Sender) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) } _, err = GetTokenDenom(m.Sender, m.Subdenom) if err != nil { - return sdkerrors.Wrap(ErrInvalidDenom, err.Error()) + return errorsmod.Wrap(ErrInvalidDenom, err.Error()) } return nil @@ -66,11 +67,11 @@ func (m MsgMint) Type() string { return TypeMsgMint } func (m MsgMint) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(m.Sender) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) } if !m.Amount.IsValid() || m.Amount.Amount.Equal(sdk.ZeroInt()) { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) } return nil @@ -100,11 +101,11 @@ func (m MsgBurn) Type() string { return TypeMsgBurn } func (m MsgBurn) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(m.Sender) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) } if !m.Amount.IsValid() || m.Amount.Amount.Equal(sdk.ZeroInt()) { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) } return nil @@ -119,51 +120,6 @@ func (m MsgBurn) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{sender} } -// var _ sdk.Msg = &MsgForceTransfer{} - -// // NewMsgForceTransfer creates a transfer funds from one account to another -// func NewMsgForceTransfer(sender string, amount sdk.Coin, fromAddr, toAddr string) *MsgForceTransfer { -// return &MsgForceTransfer{ -// Sender: sender, -// Amount: amount, -// TransferFromAddress: fromAddr, -// TransferToAddress: toAddr, -// } -// } - -// func (m MsgForceTransfer) Route() string { return RouterKey } -// func (m MsgForceTransfer) Type() string { return TypeMsgForceTransfer } -// func (m MsgForceTransfer) ValidateBasic() error { -// _, err := sdk.AccAddressFromBech32(m.Sender) -// if err != nil { -// return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) -// } - -// _, err = sdk.AccAddressFromBech32(m.TransferFromAddress) -// if err != nil { -// return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err) -// } -// _, err = sdk.AccAddressFromBech32(m.TransferToAddress) -// if err != nil { -// return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err) -// } - -// if !m.Amount.IsValid() { -// return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String()) -// } - -// return nil -// } - -// func (m MsgForceTransfer) GetSignBytes() []byte { -// return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) -// } - -// func (m MsgForceTransfer) GetSigners() []sdk.AccAddress { -// sender, _ := sdk.AccAddressFromBech32(m.Sender) -// return []sdk.AccAddress{sender} -// } - var _ sdk.Msg = &MsgChangeAdmin{} // NewMsgChangeAdmin creates a message to burn tokens @@ -180,12 +136,12 @@ func (m MsgChangeAdmin) Type() string { return TypeMsgChangeAdmin } func (m MsgChangeAdmin) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(m.Sender) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) } _, err = sdk.AccAddressFromBech32(m.NewAdmin) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err) } _, _, err = DeconstructDenom(m.Denom) @@ -220,7 +176,7 @@ func (m MsgSetDenomMetadata) Type() string { return TypeMsgSetDenomMetadata } func (m MsgSetDenomMetadata) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(m.Sender) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) } err = m.Metadata.Validate()