From 23577ab7e0d6bdfaa630beefa52a6a111fdfd00a Mon Sep 17 00:00:00 2001 From: GnaD13 Date: Wed, 25 Oct 2023 12:48:44 +0700 Subject: [PATCH 1/2] correct iterator --- x/transfermiddleware/keeper/keeper.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x/transfermiddleware/keeper/keeper.go b/x/transfermiddleware/keeper/keeper.go index a154677d4..4b8828f78 100644 --- a/x/transfermiddleware/keeper/keeper.go +++ b/x/transfermiddleware/keeper/keeper.go @@ -4,6 +4,7 @@ import ( "time" errorsmod "cosmossdk.io/errors" + "cosmossdk.io/store/prefix" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -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() { From 197602959d3bd09d471ee42524e3839e1786747e Mon Sep 17 00:00:00 2001 From: GnaD13 Date: Wed, 25 Oct 2023 13:07:18 +0700 Subject: [PATCH 2/2] import --- x/transfermiddleware/keeper/keeper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/transfermiddleware/keeper/keeper.go b/x/transfermiddleware/keeper/keeper.go index 4b8828f78..4988afd09 100644 --- a/x/transfermiddleware/keeper/keeper.go +++ b/x/transfermiddleware/keeper/keeper.go @@ -4,9 +4,9 @@ import ( "time" errorsmod "cosmossdk.io/errors" - "cosmossdk.io/store/prefix" "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"