Skip to content

Commit

Permalink
Merge pull request #9 from neutron-org/fix/capability-no-gas-meter
Browse files Browse the repository at this point in the history
Fix: capability no gas meter
  • Loading branch information
pr0n00gler authored Nov 19, 2023
2 parents 050d219 + 3789cd6 commit 12cd838
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x/capability/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ func (k *Keeper) InitMemStore(ctx sdk.Context) {
panic(fmt.Sprintf("invalid memory store type; got %s, expected: %s", memStoreType, storetypes.StoreTypeMemory))
}

// create context with no block gas meter to ensure we do not consume gas during local initialization logic.
noGasCtx := ctx.WithBlockGasMeter(sdk.NewInfiniteGasMeter())
// Create a context with no `BlockGasMeter`, and no `GasMeter`. This ensures we do not consume gas during local
// initialization logic.
noGasCtx := ctx.WithBlockGasMeter(sdk.NewInfiniteGasMeter()).WithGasMeter(sdk.NewInfiniteGasMeter())

// check if memory store has not been initialized yet by checking if initialized flag is nil.
if !k.IsInitialized(noGasCtx) {
Expand Down

0 comments on commit 12cd838

Please sign in to comment.