From 3e2d2eb9a3e5811d45703ca272e5691b649bd6c7 Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Thu, 15 Feb 2024 23:14:54 +0900 Subject: [PATCH] fix classIterator --- x/collection/keeper/alias.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/x/collection/keeper/alias.go b/x/collection/keeper/alias.go index b007118805..5dcd90a21e 100644 --- a/x/collection/keeper/alias.go +++ b/x/collection/keeper/alias.go @@ -268,12 +268,11 @@ func (k Keeper) iterateNextTokenIDsImpl(ctx sdk.Context, prefix []byte, fn func( // iterate through the classes and perform the provided function func (k Keeper) iterateClassStoreIDs(ctx sdk.Context, fn func(id string) (stop bool)) { - iterator := k.iterWithPrefix(ctx, classStorePrefix) + iterator := k.iterWithPrefix(ctx, append(classStorePrefix, idKeyPrefix...)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - id := splitIDKey(iterator.Key()) - + id := splitIDKey(iterator.Key()[len(classStorePrefix):]) stop := fn(id) if stop { break