Skip to content

Commit edc46ce

Browse files
committed
patch fix
1 parent 51c7dc6 commit edc46ce

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

x/masterchef/keeper/abci.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,8 @@ func (k Keeper) ConvertGasFeesToUsdc(ctx sdk.Context, baseCurrency string, addre
344344
continue
345345
}
346346

347-
tokenOutAmount, _, err := k.amm.InternalSwapExactAmountIn(ctx, address, address, pool, tokenIn, baseCurrency, math.ZeroInt(), osmomath.ZeroBigDec(), osmomath.ZeroBigDec())
347+
cacheCtx, write := ctx.CacheContext()
348+
tokenOutAmount, _, err := k.amm.InternalSwapExactAmountIn(cacheCtx, address, address, pool, tokenIn, baseCurrency, math.ZeroInt(), osmomath.ZeroBigDec(), osmomath.ZeroBigDec())
348349
if err != nil {
349350
// Continue as we can swap it when this amount is higher
350351
if err == ammtypes.ErrTokenOutAmountZero {
@@ -356,10 +357,10 @@ func (k Keeper) ConvertGasFeesToUsdc(ctx sdk.Context, baseCurrency string, addre
356357
sdk.NewAttribute("Token amount", "0"),
357358
),
358359
})
359-
continue
360360
}
361-
return sdk.Coins{}, err
361+
continue
362362
}
363+
write()
363364

364365
// Swapped USDC coin
365366
swappedCoins := sdk.NewCoins(sdk.NewCoin(baseCurrency, tokenOutAmount))

0 commit comments

Comments
 (0)