Skip to content

Commit 056e225

Browse files
authored
Save gas on IsFeeEnabled (#2786) (#2817)
improvements: save some gas in fee keeper
1 parent 5cee5d0 commit 056e225

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
7777
* (modules/core/keeper) [\#1728](https://github.com/cosmos/ibc-go/pull/2399) Updated channel callback errors to include portID & channelID for better identification of errors.
7878
* (testing) [\#2657](https://github.com/cosmos/ibc-go/pull/2657) Carry `ProposerAddress` through commited blocks. Allow `DefaultGenTxGas` to be modified.
7979
* (core/03-connection) [\#2745](https://github.com/cosmos/ibc-go/pull/2745) Adding `ConnectionParams` grpc query and CLI to 03-connection.
80+
* (apps/29-fee) [\#2786](https://github.com/cosmos/ibc-go/pull/2786) Save gas by checking key existence with `KVStore`'s `Has` method.
8081

8182
### Features
8283

modules/apps/29-fee/keeper/keeper.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (k Keeper) DeleteFeeEnabled(ctx sdk.Context, portID, channelID string) {
123123
// fee enabled flag for the given port and channel identifiers
124124
func (k Keeper) IsFeeEnabled(ctx sdk.Context, portID, channelID string) bool {
125125
store := ctx.KVStore(k.storeKey)
126-
return store.Get(types.KeyFeeEnabled(portID, channelID)) != nil
126+
return store.Has(types.KeyFeeEnabled(portID, channelID))
127127
}
128128

129129
// GetAllFeeEnabledChannels returns a list of all ics29 enabled channels containing portID & channelID that are stored in state

0 commit comments

Comments
 (0)