diff --git a/x/dex/contract/abci.go b/x/dex/contract/abci.go index 16b155a820..914dc1204a 100644 --- a/x/dex/contract/abci.go +++ b/x/dex/contract/abci.go @@ -49,7 +49,7 @@ func EndBlockerAtomic(ctx sdk.Context, keeper *keeper.Keeper, validContractsInfo env := newEnv(ctx, validContractsInfo, keeper) cachedCtx, msCached := cacheContext(ctx, env) memStateCopy := dexutils.GetMemState(cachedCtx.Context()).DeepCopy() - preRunRents := keeper.GetRentsForContracts(ctx, seiutils.Map(validContractsInfo, func(c types.ContractInfoV2) string { return c.ContractAddr })) + preRunRents := keeper.GetRentsForContracts(cachedCtx, seiutils.Map(validContractsInfo, func(c types.ContractInfoV2) string { return c.ContractAddr })) handleDeposits(spanCtx, cachedCtx, env, keeper, tracer) @@ -71,7 +71,7 @@ func EndBlockerAtomic(ctx sdk.Context, keeper *keeper.Keeper, validContractsInfo // No error is thrown for any contract. This should happen most of the time. if env.failedContractAddresses.Size() == 0 { - postRunRents := keeper.GetRentsForContracts(ctx, seiutils.Map(validContractsInfo, func(c types.ContractInfoV2) string { return c.ContractAddr })) + postRunRents := keeper.GetRentsForContracts(cachedCtx, seiutils.Map(validContractsInfo, func(c types.ContractInfoV2) string { return c.ContractAddr })) TransferRentFromDexToCollector(ctx, keeper.BankKeeper, preRunRents, postRunRents) msCached.Write() return env.validContractsInfo, ctx, true