From ac7aa4fce12f3d829d66ad3ae0ac34c3a139e363 Mon Sep 17 00:00:00 2001 From: Masih Yeganeh Date: Tue, 19 Nov 2024 17:07:33 +0330 Subject: [PATCH] Fix linting --- app/upgrade/v5/upgrade.go | 2 ++ x/asset/ft/keeper/keeper_dex.go | 5 ++++- x/asset/ft/keeper/keeper_dex_test.go | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/upgrade/v5/upgrade.go b/app/upgrade/v5/upgrade.go index 28c9d676c..d5578ec34 100644 --- a/app/upgrade/v5/upgrade.go +++ b/app/upgrade/v5/upgrade.go @@ -59,9 +59,11 @@ func New(mm *module.Manager, configurator module.Configurator, } sdkCtx := sdk.UnwrapSDKContext(ctx) + //nolint:contextcheck // this is correct context passing. dexParams := dexKeeper.GetParams(sdkCtx) // 10core dexParams.OrderReserve = sdk.NewInt64Coin(chosenNetwork.Denom(), 10_000_000) + //nolint:contextcheck // this is correct context passing. if err = dexKeeper.SetParams(sdkCtx, dexParams); err != nil { return nil, err } diff --git a/x/asset/ft/keeper/keeper_dex.go b/x/asset/ft/keeper/keeper_dex.go index 723911364..3de9a442b 100644 --- a/x/asset/ft/keeper/keeper_dex.go +++ b/x/asset/ft/keeper/keeper_dex.go @@ -566,7 +566,10 @@ func (k Keeper) updateDEXSettings( } } - k.SetDEXSettings(ctx, denom, newSettings) + err = k.SetDEXSettings(ctx, denom, newSettings) + if err != nil { + return err + } if err := ctx.EventManager().EmitTypedEvent(&types.EventDEXSettingsChanged{ PreviousSettings: prevSettings, diff --git a/x/asset/ft/keeper/keeper_dex_test.go b/x/asset/ft/keeper/keeper_dex_test.go index 950a6353d..ed5e20b0b 100644 --- a/x/asset/ft/keeper/keeper_dex_test.go +++ b/x/asset/ft/keeper/keeper_dex_test.go @@ -638,7 +638,7 @@ func TestKeeper_DEXLimitsWithGlobalFreeze(t *testing.T) { ) // globally freeze - ftKeeper.SetGlobalFreeze(ctx, ft1CoinToSend.Denom, true) + requireT.NoError(ftKeeper.SetGlobalFreeze(ctx, ft1CoinToSend.Denom, true)) requireT.ErrorContains( ftKeeper.DEXCheckOrderAmounts( simapp.CopyContextWithMultiStore(ctx), @@ -649,8 +649,8 @@ func TestKeeper_DEXLimitsWithGlobalFreeze(t *testing.T) { fmt.Sprintf("usage of %s for DEX is blocked because the token is globally frozen", ft1CoinToSend.Denom), ) - ftKeeper.SetGlobalFreeze(ctx, ft1CoinToSend.Denom, false) - ftKeeper.SetGlobalFreeze(ctx, ft2CoinToSend.Denom, true) + requireT.NoError(ftKeeper.SetGlobalFreeze(ctx, ft1CoinToSend.Denom, false)) + requireT.NoError(ftKeeper.SetGlobalFreeze(ctx, ft2CoinToSend.Denom, true)) requireT.ErrorContains( ftKeeper.DEXCheckOrderAmounts( simapp.CopyContextWithMultiStore(ctx),