Skip to content

Commit

Permalink
fix classIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
tkxkd0159 committed Feb 15, 2024
1 parent 9a7effc commit 3e2d2eb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions x/collection/keeper/alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3e2d2eb

Please sign in to comment.