diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d2533b4b08..c1f28ccafe9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (apps/29-fee) [\#2786](https://github.com/cosmos/ibc-go/pull/2786) Save gas by checking key existence with `KVStore`'s `Has` method. + ### Features ### Bug Fixes diff --git a/modules/apps/29-fee/keeper/keeper.go b/modules/apps/29-fee/keeper/keeper.go index c60942debea..585ea5cbe6b 100644 --- a/modules/apps/29-fee/keeper/keeper.go +++ b/modules/apps/29-fee/keeper/keeper.go @@ -121,7 +121,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