Skip to content

Commit

Permalink
change map iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
GNaD13 committed Dec 5, 2023
1 parent 8f21fc9 commit 24dec5f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/apps/transfer/types/transfer_authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"strings"

"github.com/cosmos/gogoproto/proto"
"golang.org/x/exp/maps"

errorsmod "cosmossdk.io/errors"
sdkmath "cosmossdk.io/math"
Expand Down Expand Up @@ -180,7 +181,9 @@ func areAllowedPacketDataKeys(ctx sdk.Context, memo string, allowedPacketDataLis

gasCostPerIteration := ctx.KVGasConfig().IterNextCostFlat

for key := range jsonObject {
jsonObjectKeys := maps.Keys(jsonObject)

for _, key := range jsonObjectKeys {
ctx.GasMeter().ConsumeGas(gasCostPerIteration, "transfer authorization")

if !slices.Contains(allowedPacketDataList, key) {
Expand Down

0 comments on commit 24dec5f

Please sign in to comment.