From c538dd33bb15af03db737566ec3ca654ea4467ba Mon Sep 17 00:00:00 2001 From: ruthishvitwit Date: Wed, 17 May 2023 17:30:30 +0530 Subject: [PATCH 1/5] Feat : Removed SDK general error types --- ante/ante.go | 17 +++++++++-------- ante/gov_ante.go | 8 +++++--- go.mod | 1 + go.sum | 2 ++ types/errors/errors.go | 34 ++++++++++++++++++++++++++++++++++ x/globalfee/ante/fee.go | 13 +++++++------ x/globalfee/ante/fee_utils.go | 5 +++-- x/globalfee/module.go | 4 ++-- x/globalfee/types/genesis.go | 4 ++-- x/globalfee/types/params.go | 9 +++++---- 10 files changed, 70 insertions(+), 27 deletions(-) create mode 100644 types/errors/errors.go diff --git a/ante/ante.go b/ante/ante.go index 3adc9605fdb..f6a7df3a862 100644 --- a/ante/ante.go +++ b/ante/ante.go @@ -1,12 +1,13 @@ package ante import ( + errorsmod "cosmossdk.io/errors" "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/x/auth/ante" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + gaiaerrors "github.com/cosmos/gaia/v9/types/errors" ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante" ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" @@ -27,25 +28,25 @@ type HandlerOptions struct { func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { if opts.AccountKeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler") + return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "account keeper is required for AnteHandler") } if opts.BankKeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler") + return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "bank keeper is required for AnteHandler") } if opts.SignModeHandler == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for AnteHandler") + return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "sign mode handler is required for AnteHandler") } if opts.IBCkeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "IBC keeper is required for AnteHandler") + return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "IBC keeper is required for AnteHandler") } if opts.GlobalFeeSubspace.Name() == "" { - return nil, sdkerrors.Wrap(sdkerrors.ErrNotFound, "globalfee param store is required for AnteHandler") + return nil, errorsmod.Wrap(gaiaerrors.ErrNotFound, "globalfee param store is required for AnteHandler") } if opts.StakingSubspace.Name() == "" { - return nil, sdkerrors.Wrap(sdkerrors.ErrNotFound, "staking param store is required for AnteHandler") + return nil, errorsmod.Wrap(gaiaerrors.ErrNotFound, "staking param store is required for AnteHandler") } if opts.GovKeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "gov keeper is required for AnteHandler") + return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "gov keeper is required for AnteHandler") } sigGasConsumer := opts.SigGasConsumer diff --git a/ante/gov_ante.go b/ante/gov_ante.go index faca639b771..acacb65ee74 100644 --- a/ante/gov_ante.go +++ b/ante/gov_ante.go @@ -1,9 +1,11 @@ package ante import ( + errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + gaiaerrors "github.com/cosmos/gaia/v9/types/errors" + "github.com/cosmos/cosmos-sdk/x/authz" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -49,7 +51,7 @@ func (g GovPreventSpamDecorator) ValidateGovMsgs(ctx sdk.Context, msgs []sdk.Msg depositParams := g.govKeeper.GetDepositParams(ctx) minInitialDeposit := g.calcMinInitialDeposit(depositParams.MinDeposit) if msg.InitialDeposit.IsAllLT(minInitialDeposit) { - return sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "insufficient initial deposit amount - required: %v", minInitialDeposit) + return errorsmod.Wrapf(gaiaerrors.ErrInsufficientFunds, "insufficient initial deposit amount - required: %v", minInitialDeposit) } } @@ -60,7 +62,7 @@ func (g GovPreventSpamDecorator) ValidateGovMsgs(ctx sdk.Context, msgs []sdk.Msg for _, v := range execMsg.Msgs { var innerMsg sdk.Msg if err := g.cdc.UnpackAny(v, &innerMsg); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "cannot unmarshal authz exec msgs") + return errorsmod.Wrap(gaiaerrors.ErrUnauthorized, "cannot unmarshal authz exec msgs") } if err := validMsg(innerMsg); err != nil { return err diff --git a/go.mod b/go.mod index e1d079e4525..4e52fa7190e 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/cosmos/gaia/v9 go 1.20 require ( + cosmossdk.io/errors v1.0.0-beta.7 cosmossdk.io/math v1.0.0 github.com/cosmos/cosmos-sdk v0.45.15 github.com/cosmos/go-bip39 v1.0.0 diff --git a/go.sum b/go.sum index ca78434c99a..971846ddeb9 100644 --- a/go.sum +++ b/go.sum @@ -48,6 +48,8 @@ cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= +cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= +cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= cosmossdk.io/math v1.0.0 h1:ro9w7eKx23om2tZz/VM2Pf+z2WAbGX1yDQQOJ6iGeJw= cosmossdk.io/math v1.0.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= diff --git a/types/errors/errors.go b/types/errors/errors.go new file mode 100644 index 00000000000..6921a7bef9f --- /dev/null +++ b/types/errors/errors.go @@ -0,0 +1,34 @@ +package errors + +import ( + errorsmod "cosmossdk.io/errors" +) + +const codespace = "gaia" + +var ( + // ErrTxDecode is returned if we cannot parse a transaction + ErrTxDecode = errorsmod.Register(codespace, 1, "tx parse error") + // ErrUnauthorized is used whenever a request without sufficient + // authorization is handled. + ErrUnauthorized = errorsmod.Register(codespace, 2, "unauthorized") + + // ErrInsufficientFunds is used when the account cannot pay requested amount. + ErrInsufficientFunds = errorsmod.Register(codespace, 3, "insufficient funds") + + // ErrInsufficientFunds is used when the account cannot pay requested amount. + ErrInsufficientFee = errorsmod.Register(codespace, 4, "insufficient fee") + + // ErrInvalidCoins is used when sdk.Coins are invalid. + ErrInvalidCoins = errorsmod.Register(codespace, 5, "invalid coins") + + // ErrInvalidType defines an error an invalid type. + ErrInvalidType = errorsmod.Register(codespace, 6, "invalid type") + + // ErrLogic defines an internal logic error, e.g. an invariant or assertion + // that is violated. It is a programmer error, not a user-facing error. + ErrLogic = errorsmod.Register(codespace, 7, "internal logic error") + + // ErrNotFound defines an error when requested entity doesn't exist in the state. + ErrNotFound = errorsmod.Register(codespace, 8, "not found") +) diff --git a/x/globalfee/ante/fee.go b/x/globalfee/ante/fee.go index 071cc0eee78..f5c6801f35f 100644 --- a/x/globalfee/ante/fee.go +++ b/x/globalfee/ante/fee.go @@ -4,10 +4,11 @@ import ( "errors" "fmt" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + gaiaerrors "github.com/cosmos/gaia/v9/types/errors" tmstrings "github.com/tendermint/tendermint/libs/strings" "github.com/cosmos/gaia/v9/x/globalfee" @@ -51,7 +52,7 @@ func NewFeeDecorator(globalfeeSubspace, stakingSubspace paramtypes.Subspace) Fee func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { feeTx, ok := tx.(sdk.FeeTx) if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "Tx must implement the sdk.FeeTx interface") + return ctx, errorsmod.Wrapf(gaiaerrors.ErrTxDecode, "Tx must implement the sdk.FeeTx interface") } // Do not check minimum-gas-prices and global fees during simulations @@ -68,7 +69,7 @@ func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne // reject the transaction early if the feeCoins have more denoms than the fee requirement // feeRequired cannot be empty if feeTx.GetFee().Len() > feeRequired.Len() { - return ctx, sdkerrors.Wrapf(sdkerrors.ErrInvalidCoins, "fee is not a subset of required fees; got %s, required: %s", feeTx.GetFee().String(), feeRequired.String()) + return ctx, errorsmod.Wrapf(gaiaerrors.ErrInvalidCoins, "fee is not a subset of required fees; got %s, required: %s", feeTx.GetFee().String(), feeRequired.String()) } // Sort fee tx's coins, zero coins in feeCoins are already removed @@ -92,7 +93,7 @@ func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne // special case: if feeCoinsNonZeroDenom=[], DenomsSubsetOf returns true // special case: if feeCoinsNonZeroDenom is not empty, but nonZeroCoinFeesReq empty, return false if !feeCoinsNonZeroDenom.DenomsSubsetOf(nonZeroCoinFeesReq) { - return ctx, sdkerrors.Wrapf(sdkerrors.ErrInsufficientFee, "fee is not a subset of required fees; got %s, required: %s", feeCoins.String(), feeRequired.String()) + return ctx, errorsmod.Wrapf(gaiaerrors.ErrInsufficientFee, "fee is not a subset of required fees; got %s, required: %s", feeCoins.String(), feeRequired.String()) } // If the feeCoins pass the denoms check, check they are bypass-msg types. @@ -122,7 +123,7 @@ func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne if len(zeroCoinFeesDenomReq) != 0 { return next(ctx, tx, simulate) } - return ctx, sdkerrors.Wrapf(sdkerrors.ErrInsufficientFee, "insufficient fees; got: %s required: %s", feeCoins.String(), feeRequired.String()) + return ctx, errorsmod.Wrapf(gaiaerrors.ErrInsufficientFee, "insufficient fees; got: %s required: %s", feeCoins.String(), feeRequired.String()) } // when feeCoins != [] @@ -144,7 +145,7 @@ func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne errMsg = fmt.Sprintf("Insufficient fees; bypass-min-fee-msg-types with gas consumption %v exceeds the maximum allowed gas value of %v.", gas, maxTotalBypassMinFeeMsgGasUsage) } - return ctx, sdkerrors.Wrap(sdkerrors.ErrInsufficientFee, errMsg) + return ctx, errorsmod.Wrapf(gaiaerrors.ErrInsufficientFee, errMsg) } return next(ctx, tx, simulate) diff --git a/x/globalfee/ante/fee_utils.go b/x/globalfee/ante/fee_utils.go index 31c44aa3c2c..454578dccb4 100644 --- a/x/globalfee/ante/fee_utils.go +++ b/x/globalfee/ante/fee_utils.go @@ -1,8 +1,9 @@ package ante import ( + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + gaiaerrors "github.com/cosmos/gaia/v9/types/errors" ) // ContainZeroCoins returns true if the given coins are empty or contain zero coins, @@ -28,7 +29,7 @@ func CombinedFeeRequirement(globalFees, minGasPrices sdk.Coins) (sdk.Coins, erro // global fees should never be empty // since it has a default value using the staking module's bond denom if len(globalFees) == 0 { - return sdk.Coins{}, sdkerrors.Wrapf(sdkerrors.ErrNotFound, "global fee cannot be empty") + return sdk.Coins{}, errorsmod.Wrapf(gaiaerrors.ErrNotFound, "global fee cannot be empty") } // empty min_gas_price diff --git a/x/globalfee/module.go b/x/globalfee/module.go index d2cf91c0f41..d2262ccbcaa 100644 --- a/x/globalfee/module.go +++ b/x/globalfee/module.go @@ -4,11 +4,11 @@ import ( "context" "encoding/json" + errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/client" "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/types/module" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/gorilla/mux" @@ -46,7 +46,7 @@ func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEn return err } if err := data.Params.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "params") + return errorsmod.Wrap(err, "params") } return nil } diff --git a/x/globalfee/types/genesis.go b/x/globalfee/types/genesis.go index a87d8d9891a..253df889c6a 100644 --- a/x/globalfee/types/genesis.go +++ b/x/globalfee/types/genesis.go @@ -3,8 +3,8 @@ package types import ( "encoding/json" + errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // NewGenesisState - Create a new genesis state @@ -33,7 +33,7 @@ func GetGenesisStateFromAppState(cdc codec.Codec, appState map[string]json.RawMe func ValidateGenesis(data GenesisState) error { if err := data.Params.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "globalfee params") + return errorsmod.Wrap(err, "globalfee params") } return nil diff --git a/x/globalfee/types/params.go b/x/globalfee/types/params.go index 07e67a983fc..89331dd25a1 100644 --- a/x/globalfee/types/params.go +++ b/x/globalfee/types/params.go @@ -4,9 +4,10 @@ import ( "fmt" "strings" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + gaiaerrors "github.com/cosmos/gaia/v9/types/errors" ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" ) @@ -80,7 +81,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { func validateMinimumGasPrices(i interface{}) error { v, ok := i.(sdk.DecCoins) if !ok { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "type: %T, expected sdk.DecCoins", i) + return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected sdk.DecCoins", i) } dec := DecCoins(v) @@ -93,7 +94,7 @@ type BypassMinFeeMsgTypes []string func validateBypassMinFeeMsgTypes(i interface{}) error { bypassMinFeeMsgTypes, ok := i.([]string) if !ok { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "type: %T, expected []sdk.Msg", i) + return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected []sdk.Msg", i) } for _, msgType := range bypassMinFeeMsgTypes { @@ -112,7 +113,7 @@ func validateBypassMinFeeMsgTypes(i interface{}) error { func validateMaxTotalBypassMinFeeMsgGasUsage(i interface{}) error { _, ok := i.(uint64) if !ok { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "type: %T, expected uint64", i) + return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected uint64", i) } return nil From 18e45136fbe8db389045c84359ebf14accac3701 Mon Sep 17 00:00:00 2001 From: ruthishvitwit Date: Thu, 18 May 2023 10:52:58 +0530 Subject: [PATCH 2/5] Changed unnecessary wrapf to wrap --- x/globalfee/ante/fee.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/globalfee/ante/fee.go b/x/globalfee/ante/fee.go index f5c6801f35f..e6f76b9c64d 100644 --- a/x/globalfee/ante/fee.go +++ b/x/globalfee/ante/fee.go @@ -52,7 +52,7 @@ func NewFeeDecorator(globalfeeSubspace, stakingSubspace paramtypes.Subspace) Fee func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { feeTx, ok := tx.(sdk.FeeTx) if !ok { - return ctx, errorsmod.Wrapf(gaiaerrors.ErrTxDecode, "Tx must implement the sdk.FeeTx interface") + return ctx, errorsmod.Wrap(gaiaerrors.ErrTxDecode, "Tx must implement the sdk.FeeTx interface") } // Do not check minimum-gas-prices and global fees during simulations @@ -145,7 +145,7 @@ func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne errMsg = fmt.Sprintf("Insufficient fees; bypass-min-fee-msg-types with gas consumption %v exceeds the maximum allowed gas value of %v.", gas, maxTotalBypassMinFeeMsgGasUsage) } - return ctx, errorsmod.Wrapf(gaiaerrors.ErrInsufficientFee, errMsg) + return ctx, errorsmod.Wrap(gaiaerrors.ErrInsufficientFee, errMsg) } return next(ctx, tx, simulate) From 1d7120cf0be913869e039725da0c17595bbd36ce Mon Sep 17 00:00:00 2001 From: ruthishvitwit Date: Wed, 14 Jun 2023 12:33:38 +0530 Subject: [PATCH 3/5] made some required changes --- ante/ante.go | 2 +- ante/gov_ante.go | 2 +- x/globalfee/ante/fee.go | 2 +- x/globalfee/ante/fee_utils.go | 2 +- x/globalfee/types/params.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ante/ante.go b/ante/ante.go index a2714213b3c..ee28e19c66f 100644 --- a/ante/ante.go +++ b/ante/ante.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/ante" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - gaiaerrors "github.com/cosmos/gaia/v9/types/errors" + gaiaerrors "github.com/cosmos/gaia/v10/types/errors" ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante" ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" diff --git a/ante/gov_ante.go b/ante/gov_ante.go index acacb65ee74..3a5c8d35de5 100644 --- a/ante/gov_ante.go +++ b/ante/gov_ante.go @@ -4,7 +4,7 @@ import ( errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - gaiaerrors "github.com/cosmos/gaia/v9/types/errors" + gaiaerrors "github.com/cosmos/gaia/v10/types/errors" "github.com/cosmos/cosmos-sdk/x/authz" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" diff --git a/x/globalfee/ante/fee.go b/x/globalfee/ante/fee.go index 8b9e67c6579..a664f185779 100644 --- a/x/globalfee/ante/fee.go +++ b/x/globalfee/ante/fee.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - gaiaerrors "github.com/cosmos/gaia/v9/types/errors" + gaiaerrors "github.com/cosmos/gaia/v10/types/errors" tmstrings "github.com/tendermint/tendermint/libs/strings" "github.com/cosmos/gaia/v10/x/globalfee" diff --git a/x/globalfee/ante/fee_utils.go b/x/globalfee/ante/fee_utils.go index 454578dccb4..797e15d2776 100644 --- a/x/globalfee/ante/fee_utils.go +++ b/x/globalfee/ante/fee_utils.go @@ -3,7 +3,7 @@ package ante import ( errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - gaiaerrors "github.com/cosmos/gaia/v9/types/errors" + gaiaerrors "github.com/cosmos/gaia/v10/types/errors" ) // ContainZeroCoins returns true if the given coins are empty or contain zero coins, diff --git a/x/globalfee/types/params.go b/x/globalfee/types/params.go index 89331dd25a1..f037be70775 100644 --- a/x/globalfee/types/params.go +++ b/x/globalfee/types/params.go @@ -7,7 +7,7 @@ import ( errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - gaiaerrors "github.com/cosmos/gaia/v9/types/errors" + gaiaerrors "github.com/cosmos/gaia/v10/types/errors" ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" ) From e96bed94fc3598e8470a24fd8a87092b496f51cb Mon Sep 17 00:00:00 2001 From: ruthishvitwit Date: Wed, 14 Jun 2023 18:17:07 +0530 Subject: [PATCH 4/5] changed version 10 to 11 --- ante/ante.go | 2 +- ante/gov_ante.go | 2 +- go.mod | 4 +--- go.sum | 11 +++++------ x/globalfee/ante/fee.go | 2 +- x/globalfee/ante/fee_utils.go | 2 +- x/globalfee/types/params.go | 2 +- 7 files changed, 11 insertions(+), 14 deletions(-) diff --git a/ante/ante.go b/ante/ante.go index 54f782d5eb4..b6ae8811aaf 100644 --- a/ante/ante.go +++ b/ante/ante.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/ante" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - gaiaerrors "github.com/cosmos/gaia/v10/types/errors" + gaiaerrors "github.com/cosmos/gaia/v11/types/errors" ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante" ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" diff --git a/ante/gov_ante.go b/ante/gov_ante.go index 3a5c8d35de5..88dbddea157 100644 --- a/ante/gov_ante.go +++ b/ante/gov_ante.go @@ -4,7 +4,7 @@ import ( errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - gaiaerrors "github.com/cosmos/gaia/v10/types/errors" + gaiaerrors "github.com/cosmos/gaia/v11/types/errors" "github.com/cosmos/cosmos-sdk/x/authz" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" diff --git a/go.mod b/go.mod index 61f71ece38b..8eb31e59e8c 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( cosmossdk.io/errors v1.0.0-beta.7 - cosmossdk.io/math v1.0.0 + cosmossdk.io/math v1.0.1 github.com/cosmos/cosmos-sdk v0.45.16-ics github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/ibc-go/v4 v4.4.2 @@ -124,8 +124,6 @@ require ( github.com/go-toolsmith/typep v1.1.0 // indirect github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect github.com/gobwas/glob v0.2.3 // indirect - github.com/gobwas/httphead v0.1.0 // indirect - github.com/gobwas/pool v0.2.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/gateway v1.1.0 // indirect diff --git a/go.sum b/go.sum index 4899413ae3c..f6deb762daf 100644 --- a/go.sum +++ b/go.sum @@ -400,8 +400,8 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/math v1.0.0 h1:ro9w7eKx23om2tZz/VM2Pf+z2WAbGX1yDQQOJ6iGeJw= -cosmossdk.io/math v1.0.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= +cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= +cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-beta.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= @@ -1373,12 +1373,10 @@ github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6C github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= -github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= +github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= -github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= @@ -2727,6 +2725,7 @@ github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= diff --git a/x/globalfee/ante/fee.go b/x/globalfee/ante/fee.go index 0cc031f9cfe..2191106fdaf 100644 --- a/x/globalfee/ante/fee.go +++ b/x/globalfee/ante/fee.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - gaiaerrors "github.com/cosmos/gaia/v10/types/errors" + gaiaerrors "github.com/cosmos/gaia/v11/types/errors" tmstrings "github.com/tendermint/tendermint/libs/strings" "github.com/cosmos/gaia/v11/x/globalfee" diff --git a/x/globalfee/ante/fee_utils.go b/x/globalfee/ante/fee_utils.go index 797e15d2776..289f45e250b 100644 --- a/x/globalfee/ante/fee_utils.go +++ b/x/globalfee/ante/fee_utils.go @@ -3,7 +3,7 @@ package ante import ( errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - gaiaerrors "github.com/cosmos/gaia/v10/types/errors" + gaiaerrors "github.com/cosmos/gaia/v11/types/errors" ) // ContainZeroCoins returns true if the given coins are empty or contain zero coins, diff --git a/x/globalfee/types/params.go b/x/globalfee/types/params.go index f037be70775..f3fc120acb4 100644 --- a/x/globalfee/types/params.go +++ b/x/globalfee/types/params.go @@ -7,7 +7,7 @@ import ( errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - gaiaerrors "github.com/cosmos/gaia/v10/types/errors" + gaiaerrors "github.com/cosmos/gaia/v11/types/errors" ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" ) From 5e948d8e469d6b6308620cc1ed0ba273b1b4a7f4 Mon Sep 17 00:00:00 2001 From: ruthishvitwit Date: Fri, 16 Jun 2023 12:42:11 +0530 Subject: [PATCH 5/5] ran go mod tidy --- go.sum | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/go.sum b/go.sum index 31b872c9be6..7e354033d0b 100644 --- a/go.sum +++ b/go.sum @@ -491,10 +491,12 @@ github.com/go-xmlfmt/xmlfmt v1.1.2 h1:Nea7b4icn8s57fTx1M5AI4qQT5HEM3rVUO8MuE6g80 github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= +github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= +github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= +github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/gobwas/ws v1.1.0 h1:7RFti/xnNkMJnrK7D1yQ/iCIB5OrrY/54/H930kIbHA= github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0=