From 8165335a3762484d9051af1c37cbd91362917275 Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Fri, 18 Nov 2022 13:38:45 +0100 Subject: [PATCH 1/2] Save gas on IsFeeEnabled --- modules/apps/29-fee/keeper/keeper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/apps/29-fee/keeper/keeper.go b/modules/apps/29-fee/keeper/keeper.go index caf6a55b0d0..e506ef8118f 100644 --- a/modules/apps/29-fee/keeper/keeper.go +++ b/modules/apps/29-fee/keeper/keeper.go @@ -123,7 +123,7 @@ func (k Keeper) DeleteFeeEnabled(ctx sdk.Context, portID, channelID string) { // fee enabled flag for the given port and channel identifiers func (k Keeper) IsFeeEnabled(ctx sdk.Context, portID, channelID string) bool { store := ctx.KVStore(k.storeKey) - return store.Get(types.KeyFeeEnabled(portID, channelID)) != nil + return store.Has(types.KeyFeeEnabled(portID, channelID)) } // GetAllFeeEnabledChannels returns a list of all ics29 enabled channels containing portID & channelID that are stored in state From ea8fb89714a0301f620deac9445ac4f29630f500 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Mon, 21 Nov 2022 13:05:29 +0100 Subject: [PATCH 2/2] add entry for #2786 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f70c712e94f..f0037ce86be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -108,6 +108,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#2434](https://github.com/cosmos/ibc-go/pull/2478) Removed all `TypeMsg` constants * (modules/core/exported) [#1689] (https://github.com/cosmos/ibc-go/pull/2539) Removing `GetVersions` from `ConnectionI` interface. * (core/03-connection) [\#2745](https://github.com/cosmos/ibc-go/pull/2745) Adding `ConnectionParams` grpc query and CLI to 03-connection. +* (apps/29-fee) [\#2786](https://github.com/cosmos/ibc-go/pull/2786) Save gas by checking key existence with `KVStore`'s `Has` method. ### Features