From 6b4188dfe24b4abe97169e8ef65c5847cb19e2e2 Mon Sep 17 00:00:00 2001 From: pr0n00gler Date: Mon, 13 Jan 2025 15:26:54 +0200 Subject: [PATCH] linter --- x/dex/types/keys.go | 16 ---------------- x/globalfee/ante/fee.go | 4 ++-- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/x/dex/types/keys.go b/x/dex/types/keys.go index 15f030d09..b0f979a9b 100644 --- a/x/dex/types/keys.go +++ b/x/dex/types/keys.go @@ -1,7 +1,6 @@ package types import ( - "errors" "time" sdk "github.com/cosmos/cosmos-sdk/types" @@ -76,21 +75,6 @@ func TickIndexToBytes(tickTakerToMaker int64) []byte { return key } -func BytesToTickIndex(bz []byte) (int64, error) { - if len(bz) != 9 { - return 0, errors.New("input should be 9 bytes long") - } - - isNegative := bz[0] == 0 - tickTakerToMaker := sdk.BigEndianToUint64(bz[1:]) - - if isNegative { - return int64(-tickTakerToMaker), nil - } - // else - return int64(tickTakerToMaker), nil -} - // LimitOrderTrancheUserKey returns the store key to retrieve a LimitOrderTrancheUser from the index fields func LimitOrderTrancheUserKey(address, trancheKey string) []byte { var key []byte diff --git a/x/globalfee/ante/fee.go b/x/globalfee/ante/fee.go index 01300368d..086864dc9 100644 --- a/x/globalfee/ante/fee.go +++ b/x/globalfee/ante/fee.go @@ -156,7 +156,7 @@ func (mfd FeeDecorator) GetTxFeeRequired(ctx sdk.Context, tx sdk.FeeTx) (sdk.Coi // to form the tx fee requirements // Get local minimum-gas-prices - localFees := GetMinGasPrice(ctx, int64(tx.GetGas())) + localFees := GetMinGasPrice(ctx, int64(tx.GetGas())) //nolint:gosec c, err := CombinedFeeRequirement(globalFees, localFees) // Return combined fee requirements @@ -180,7 +180,7 @@ func (mfd FeeDecorator) GetGlobalFee(ctx sdk.Context, feeTx sdk.FeeTx) sdk.Coins requiredGlobalFees := make(sdk.Coins, len(globalMinGasPrices)) // Determine the required fees by multiplying each required minimum gas // price by the gas limit, where fee = ceil(minGasPrice * gasLimit). - glDec := math.LegacyNewDec(int64(feeTx.GetGas())) + glDec := math.LegacyNewDec(int64(feeTx.GetGas())) //nolint:gosec for i, gp := range globalMinGasPrices { fee := gp.Amount.Mul(glDec) requiredGlobalFees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt())