Skip to content

Commit

Permalink
Merge pull request #259 from notional-labs/dang/correct-iterator
Browse files Browse the repository at this point in the history
correct iterator
  • Loading branch information
vuong177 authored Oct 25, 2023
2 parents e21200c + 1976029 commit 88cb4f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion x/transfermiddleware/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
errorsmod "cosmossdk.io/errors"
"github.com/cometbft/cometbft/libs/log"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/store/prefix"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
Expand Down Expand Up @@ -168,7 +169,8 @@ func (keeper Keeper) HasAllowRlyAddress(ctx sdk.Context, rlyAddress string) bool

func (keeper Keeper) IterateAllowRlyAddress(ctx sdk.Context, cb func(rlyAddress string) (stop bool)) {
store := ctx.KVStore(keeper.storeKey)
iterator := sdk.KVStorePrefixIterator(store, types.KeyRlyAddress)
prefixStore := prefix.NewStore(store, types.KeyRlyAddress)
iterator := sdk.KVStorePrefixIterator(prefixStore, nil)

defer iterator.Close()
for ; iterator.Valid(); iterator.Next() {
Expand Down

0 comments on commit 88cb4f1

Please sign in to comment.