Repository: desmos-labs/desmos
Pull request #1064 (2023-01-10 09:51:53)

feat: improve profiles iteration methods
## Description

Closes: #XXXX
This PR removes the index parameter of iteration methods inside `x/profiles`. The index parameters are not used in current codebase, I believe it was used before applying`query.Paginate`.

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review. -->

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html)
- [ ] included the necessary unit and integration [tests](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)

codecov[bot]: # [Codecov](https://codecov.io/gh/desmos-labs/desmos/pull/1064?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=desmos-labs) Report
Base: **80.24**% // Head: **80.19**% // Decreases project coverage by **`-0.04%`** :warning:
> Coverage data is based on head [(`d5ff94b`)](https://codecov.io/gh/desmos-labs/desmos/pull/1064?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=desmos-labs) compared to base [(`17cc20e`)](https://codecov.io/gh/desmos-labs/desmos/commit/17cc20ebc76d9d7377840fce7e29ce647979d01c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=desmos-labs).
> Patch coverage: 96.15% of modified lines in pull request are covered.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##           master    #1064      +/-   ##
==========================================
- Coverage   80.24%   80.19%   -0.05%     
==========================================
  Files         176      176              
  Lines       15444    15428      -16     
==========================================
- Hits        12393    12373      -20     
- Misses       2509     2511       +2     
- Partials      542      544       +2     
```


| [Impacted Files](https://codecov.io/gh/desmos-labs/desmos/pull/1064?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=desmos-labs) | Coverage Δ | |
|---|---|---|
| [x/profiles/keeper/keeper\_app\_links.go](https://codecov.io/gh/desmos-labs/desmos/pull/1064?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=desmos-labs#diff-eC9wcm9maWxlcy9rZWVwZXIva2VlcGVyX2FwcF9saW5rcy5nbw==) | `84.70% <0.00%> (ø)` | |
| [x/profiles/abci.go](https://codecov.io/gh/desmos-labs/desmos/pull/1064?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=desmos-labs#diff-eC9wcm9maWxlcy9hYmNpLmdv) | `100.00% <100.00%> (ø)` | |
| [x/profiles/keeper/alias\_functions.go](https://codecov.io/gh/desmos-labs/desmos/pull/1064?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=desmos-labs#diff-eC9wcm9maWxlcy9rZWVwZXIvYWxpYXNfZnVuY3Rpb25zLmdv) | `85.80% <100.00%> (-3.53%)` | :arrow_down: |
| [x/profiles/keeper/invariants.go](https://codecov.io/gh/desmos-labs/desmos/pull/1064?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=desmos-labs#diff-eC9wcm9maWxlcy9rZWVwZXIvaW52YXJpYW50cy5nbw==) | `100.00% <100.00%> (ø)` | |
| [x/profiles/keeper/keeper\_chain\_links.go](https://codecov.io/gh/desmos-labs/desmos/pull/1064?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=desmos-labs#diff-eC9wcm9maWxlcy9rZWVwZXIva2VlcGVyX2NoYWluX2xpbmtzLmdv) | `85.14% <100.00%> (ø)` | |
| [x/profiles/keeper/keeper\_dtag\_transfers.go](https://codecov.io/gh/desmos-labs/desmos/pull/1064?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=desmos-labs#diff-eC9wcm9maWxlcy9rZWVwZXIva2VlcGVyX2R0YWdfdHJhbnNmZXJzLmdv) | `89.47% <100.00%> (ø)` | |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=desmos-labs). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=desmos-labs)

</details>

[:umbrella: View full report at Codecov](https://codecov.io/gh/desmos-labs/desmos/pull/1064?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=desmos-labs).   
:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=desmos-labs).


Patch:
diff --git a/x/profiles/abci.go b/x/profiles/abci.go
index edd5647b..baf71750 100644
--- a/x/profiles/abci.go
+++ b/x/profiles/abci.go
@@ -10,7 +10,7 @@ import (
 // BeginBlocker is called every block, processes expired application links
 func BeginBlocker(ctx sdk.Context, keeper keeper.Keeper) {
 	// Iterate over all the expiring application links
-	keeper.IterateExpiringApplicationLinks(ctx, func(_ int64, link types.ApplicationLink) (stop bool) {
+	keeper.IterateExpiringApplicationLinks(ctx, func(link types.ApplicationLink) (stop bool) {
 		// Delete the application link
 		keeper.DeleteApplicationLink(ctx, link)
 		return false
diff --git a/x/profiles/keeper/alias_functions.go b/x/profiles/keeper/alias_functions.go
index a32569a4..1d6ea2fa 100644
--- a/x/profiles/keeper/alias_functions.go
+++ b/x/profiles/keeper/alias_functions.go
@@ -10,15 +10,13 @@ import (
 )
 
 // IterateProfiles iterates through the Profiles set and performs the provided function
-func (k Keeper) IterateProfiles(ctx sdk.Context, fn func(index int64, profile *types.Profile) (stop bool)) {
-	i := int64(0)
+func (k Keeper) IterateProfiles(ctx sdk.Context, fn func(profile *types.Profile) (stop bool)) {
+
 	k.ak.IterateAccounts(ctx, func(account authtypes.AccountI) (stop bool) {
 		profile, ok := account.(*types.Profile)
 
-		stop = false
 		if ok {
-			stop = fn(i, profile)
-			i++
+			stop = fn(profile)
 		}
 
 		return stop
@@ -28,7 +26,7 @@ func (k Keeper) IterateProfiles(ctx sdk.Context, fn func(index int64, profile *t
 // GetProfiles returns all the profiles that are stored inside the given context
 func (k Keeper) GetProfiles(ctx sdk.Context) []*types.Profile {
 	var profiles []*types.Profile
-	k.IterateProfiles(ctx, func(_ int64, profile *types.Profile) (stop bool) {
+	k.IterateProfiles(ctx, func(profile *types.Profile) (stop bool) {
 		profiles = append(profiles, profile)
 		return false
 	})
@@ -48,77 +46,69 @@ func (k Keeper) HasProfile(ctx sdk.Context, user string) bool {
 
 // IterateDTagTransferRequests iterates over all the DTag transfer requests and performs the provided function
 func (k Keeper) IterateDTagTransferRequests(
-	ctx sdk.Context, fn func(index int64, dTagTransferRequest types.DTagTransferRequest) (stop bool),
+	ctx sdk.Context, fn func(dTagTransferRequest types.DTagTransferRequest) (stop bool),
 ) {
 	store := ctx.KVStore(k.storeKey)
 	iterator := sdk.KVStorePrefixIterator(store, types.DTagTransferRequestPrefix)
 	defer iterator.Close()
 
-	i := int64(0)
 	for ; iterator.Valid(); iterator.Next() {
 		request := types.MustUnmarshalDTagTransferRequest(k.cdc, iterator.Value())
-		stop := fn(i, request)
+		stop := fn(request)
 		if stop {
 			break
 		}
-		i++
 	}
 }
 
 // IterateUserIncomingDTagTransferRequests iterates over all the DTag transfer request made to the given user
 // and performs the provided function
 func (k Keeper) IterateUserIncomingDTagTransferRequests(
-	ctx sdk.Context, user string, fn func(index int64, dTagTransferRequest types.DTagTransferRequest) (stop bool),
+	ctx sdk.Context, user string, fn func(dTagTransferRequest types.DTagTransferRequest) (stop bool),
 ) {
 	store := ctx.KVStore(k.storeKey)
 	iterator := sdk.KVStorePrefixIterator(store, types.IncomingDTagTransferRequestsPrefix(user))
 	defer iterator.Close()
 
-	i := int64(0)
 	for ; iterator.Valid(); iterator.Next() {
 		request := types.MustUnmarshalDTagTransferRequest(k.cdc, iterator.Value())
-		stop := fn(i, request)
+		stop := fn(request)
 		if stop {
 			break
 		}
-		i++
 	}
 }
 
 // --------------------------------------------------------------------------------------------------------------------
 
 // IterateApplicationLinks iterates through all the application links and performs the provided function
-func (k Keeper) IterateApplicationLinks(ctx sdk.Context, fn func(index int64, link types.ApplicationLink) (stop bool)) {
+func (k Keeper) IterateApplicationLinks(ctx sdk.Context, fn func(link types.ApplicationLink) (stop bool)) {
 	store := ctx.KVStore(k.storeKey)
 	iterator := sdk.KVStorePrefixIterator(store, types.ApplicationLinkPrefix)
 	defer iterator.Close()
 
-	i := int64(0)
 	for ; iterator.Valid(); iterator.Next() {
 		link := types.MustUnmarshalApplicationLink(k.cdc, iterator.Value())
-		stop := fn(i, link)
+		stop := fn(link)
 		if stop {
 			break
 		}
-		i++
 	}
 }
 
 // IterateUserApplicationLinks iterates through all the application links related to the given user
 // and performs the provided function
-func (k Keeper) IterateUserApplicationLinks(ctx sdk.Context, user string, fn func(index int64, link types.ApplicationLink) (stop bool)) {
+func (k Keeper) IterateUserApplicationLinks(ctx sdk.Context, user string, fn func(link types.ApplicationLink) (stop bool)) {
 	store := ctx.KVStore(k.storeKey)
 	iterator := sdk.KVStorePrefixIterator(store, types.UserApplicationLinksPrefix(user))
 	defer iterator.Close()
 
-	i := int64(0)
 	for ; iterator.Valid(); iterator.Next() {
 		link := types.MustUnmarshalApplicationLink(k.cdc, iterator.Value())
-		stop := fn(i, link)
+		stop := fn(link)
 		if stop {
 			break
 		}
-		i++
 	}
 }
 
@@ -126,7 +116,7 @@ func (k Keeper) IterateUserApplicationLinks(ctx sdk.Context, user string, fn fun
 // applications links entries stored inside the current context
 func (k Keeper) GetApplicationLinks(ctx sdk.Context) []types.ApplicationLink {
 	var links []types.ApplicationLink
-	k.IterateApplicationLinks(ctx, func(index int64, link types.ApplicationLink) (stop bool) {
+	k.IterateApplicationLinks(ctx, func(link types.ApplicationLink) (stop bool) {
 		links = append(links, link)
 		return false
 	})
@@ -135,13 +125,12 @@ func (k Keeper) GetApplicationLinks(ctx sdk.Context) []types.ApplicationLink {
 
 // IterateExpiringApplicationLinks iterates through all the expiring application links references.
 // The key will be skipped and deleted if the application link has already been deleted.
-func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, fn func(index int64, link types.ApplicationLink) (stop bool)) {
+func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, fn func(link types.ApplicationLink) (stop bool)) {
 	store := ctx.KVStore(k.storeKey)
 
 	iterator := sdk.KVStorePrefixIterator(store, types.ExpiringAppLinkTimePrefix)
 	defer iterator.Close()
 
-	i := int64(0)
 	for ; iterator.Valid(); iterator.Next() {
 		// This iterator has the following key and value structure:
 		// ExpiringAppLinkTimePrefix | Expiration Time | Client ID ->  Client ID
@@ -172,50 +161,45 @@ func (k Keeper) IterateExpiringApplicationLinks(ctx sdk.Context, fn func(index i
 		if ctx.BlockTime().After(expiringTime) {
 			applicationKey := store.Get(clientIDKey)
 			link := types.MustUnmarshalApplicationLink(k.cdc, store.Get(applicationKey))
-			stop := fn(i, link)
+			stop := fn(link)
 			if stop {
 				break
 			}
 		}
-		i++
 	}
 }
 
 // --------------------------------------------------------------------------------------------------------------------
 
 // IterateChainLinks iterates through the chain links and perform the provided function
-func (k Keeper) IterateChainLinks(ctx sdk.Context, fn func(index int64, link types.ChainLink) (stop bool)) {
+func (k Keeper) IterateChainLinks(ctx sdk.Context, fn func(link types.ChainLink) (stop bool)) {
 	store := ctx.KVStore(k.storeKey)
 	iterator := sdk.KVStorePrefixIterator(store, types.ChainLinksPrefix)
 	defer iterator.Close()
 
-	i := int64(0)
 	for ; iterator.Valid(); iterator.Next() {
 		link := types.MustUnmarshalChainLink(k.cdc, iterator.Value())
-		stop := fn(i, link)
+		stop := fn(link)
 		if stop {
 			break
 		}
-		i++
 	}
 }
 
 // IterateUserChainLinks iterates through all the chain links related to the given user and perform the provided function
-func (k Keeper) IterateUserChainLinks(ctx sdk.Context, user string, fn func(index int64, link types.ChainLink) (stop bool)) {
+func (k Keeper) IterateUserChainLinks(ctx sdk.Context, user string, fn func(link types.ChainLink) (stop bool)) {
 	store := ctx.KVStore(k.storeKey)
 
 	iterator := sdk.KVStorePrefixIterator(store, types.UserChainLinksPrefix(user))
 	defer iterator.Close()
 
-	i := int64(0)
 	for ; iterator.Valid(); iterator.Next() {
 		link := types.MustUnmarshalChainLink(k.cdc, iterator.Value())
 
-		stop := fn(i, link)
+		stop := fn(link)
 		if stop {
 			break
 		}
-		i++
 	}
 }
 
@@ -239,7 +223,7 @@ func (k Keeper) IterateUserChainLinksByChain(ctx sdk.Context, user string, chain
 // GetChainLinks allows to returns the list of all stored chain links
 func (k Keeper) GetChainLinks(ctx sdk.Context) []types.ChainLink {
 	var links []types.ChainLink
-	k.IterateChainLinks(ctx, func(_ int64, link types.ChainLink) (stop bool) {
+	k.IterateChainLinks(ctx, func(link types.ChainLink) (stop bool) {
 		links = append(links, link)
 		return false
 	})
diff --git a/x/profiles/keeper/invariants.go b/x/profiles/keeper/invariants.go
index 1112ff81..67a963ae 100644
--- a/x/profiles/keeper/invariants.go
+++ b/x/profiles/keeper/invariants.go
@@ -46,7 +46,7 @@ func AllInvariants(k Keeper) sdk.Invariant {
 func ValidProfilesInvariant(k Keeper) sdk.Invariant {
 	return func(ctx sdk.Context) (string, bool) {
 		var invalidProfiles []*types.Profile
-		k.IterateProfiles(ctx, func(_ int64, profile *types.Profile) (stop bool) {
+		k.IterateProfiles(ctx, func(profile *types.Profile) (stop bool) {
 			if err := profile.Validate(); err != nil {
 				invalidProfiles = append(invalidProfiles, profile)
 			}
@@ -78,7 +78,7 @@ func formatOutputProfiles(invalidProfiles []*types.Profile) (outputProfiles stri
 func ValidDTagTransferRequests(k Keeper) sdk.Invariant {
 	return func(ctx sdk.Context) (string, bool) {
 		var invalidDTagTransferRequests []types.DTagTransferRequest
-		k.IterateDTagTransferRequests(ctx, func(index int64, request types.DTagTransferRequest) (stop bool) {
+		k.IterateDTagTransferRequests(ctx, func(request types.DTagTransferRequest) (stop bool) {
 			if !k.HasProfile(ctx, request.Receiver) || request.Sender == request.Receiver {
 				invalidDTagTransferRequests = append(invalidDTagTransferRequests, request)
 			}
@@ -109,7 +109,7 @@ func formatOutputDTagTransferRequests(requests []types.DTagTransferRequest) (out
 func ValidChainLinks(k Keeper) sdk.Invariant {
 	return func(ctx sdk.Context) (string, bool) {
 		var invalidChainLinks []types.ChainLink
-		k.IterateChainLinks(ctx, func(index int64, link types.ChainLink) (stop bool) {
+		k.IterateChainLinks(ctx, func(link types.ChainLink) (stop bool) {
 			if !k.HasProfile(ctx, link.User) {
 				invalidChainLinks = append(invalidChainLinks, link)
 			}
@@ -141,7 +141,7 @@ func formatOutputChainLinks(links []types.ChainLink) (output string) {
 func ValidApplicationLinks(k Keeper) sdk.Invariant {
 	return func(ctx sdk.Context) (string, bool) {
 		var invalidApplicationLinks []types.ApplicationLink
-		k.IterateApplicationLinks(ctx, func(index int64, link types.ApplicationLink) (stop bool) {
+		k.IterateApplicationLinks(ctx, func(link types.ApplicationLink) (stop bool) {
 			if !k.HasProfile(ctx, link.User) {
 				invalidApplicationLinks = append(invalidApplicationLinks, link)
 			}
diff --git a/x/profiles/keeper/keeper_app_links.go b/x/profiles/keeper/keeper_app_links.go
index 42e4823d..fdf38500 100644
--- a/x/profiles/keeper/keeper_app_links.go
+++ b/x/profiles/keeper/keeper_app_links.go
@@ -120,7 +120,7 @@ func (k Keeper) DeleteApplicationLink(ctx sdk.Context, appLink types.Application
 // DeleteAllUserApplicationLinks delete all the applications links associated with the given user
 func (k Keeper) DeleteAllUserApplicationLinks(ctx sdk.Context, user string) {
 	var links []types.ApplicationLink
-	k.IterateUserApplicationLinks(ctx, user, func(index int64, link types.ApplicationLink) (stop bool) {
+	k.IterateUserApplicationLinks(ctx, user, func(link types.ApplicationLink) (stop bool) {
 		links = append(links, link)
 		return false
 	})
diff --git a/x/profiles/keeper/keeper_chain_links.go b/x/profiles/keeper/keeper_chain_links.go
index 4571d924..39549c70 100644
--- a/x/profiles/keeper/keeper_chain_links.go
+++ b/x/profiles/keeper/keeper_chain_links.go
@@ -96,7 +96,7 @@ func (k Keeper) DeleteChainLink(ctx sdk.Context, link types.ChainLink) {
 // DeleteAllUserChainLinks deletes all the chain links associated with the given user
 func (k Keeper) DeleteAllUserChainLinks(ctx sdk.Context, user string) {
 	var links []types.ChainLink
-	k.IterateUserChainLinks(ctx, user, func(index int64, link types.ChainLink) (stop bool) {
+	k.IterateUserChainLinks(ctx, user, func(link types.ChainLink) (stop bool) {
 		links = append(links, link)
 		return false
 	})
diff --git a/x/profiles/keeper/keeper_dtag_transfers.go b/x/profiles/keeper/keeper_dtag_transfers.go
index 5e35e2f5..92959874 100644
--- a/x/profiles/keeper/keeper_dtag_transfers.go
+++ b/x/profiles/keeper/keeper_dtag_transfers.go
@@ -81,7 +81,7 @@ func (k Keeper) DeleteDTagTransferRequest(ctx sdk.Context, sender, recipient str
 // DeleteAllUserIncomingDTagTransferRequests deletes all the requests made to the given user
 func (k Keeper) DeleteAllUserIncomingDTagTransferRequests(ctx sdk.Context, receiver string) {
 	var requests []types.DTagTransferRequest
-	k.IterateUserIncomingDTagTransferRequests(ctx, receiver, func(index int64, request types.DTagTransferRequest) (stop bool) {
+	k.IterateUserIncomingDTagTransferRequests(ctx, receiver, func(request types.DTagTransferRequest) (stop bool) {
 		requests = append(requests, request)
 		return false
 	})


Test patch:
diff --git a/x/profiles/keeper/alias_functions_test.go b/x/profiles/keeper/alias_functions_test.go
index 22cf3ce0..37644ea6 100644
--- a/x/profiles/keeper/alias_functions_test.go
+++ b/x/profiles/keeper/alias_functions_test.go
@@ -56,7 +56,7 @@ func (suite *KeeperTestSuite) TestKeeper_IterateProfile() {
 	}
 
 	var validProfiles []*types.Profile
-	suite.k.IterateProfiles(suite.ctx, func(_ int64, profile *types.Profile) (stop bool) {
+	suite.k.IterateProfiles(suite.ctx, func(profile *types.Profile) (stop bool) {
 		if profile.DTag == "not" {
 			return false
 		}
@@ -138,9 +138,9 @@ func (suite *KeeperTestSuite) TestKeeper_IterateUserIncomingDTagTransferRequests
 	}
 
 	iterations := 0
-	suite.k.IterateUserIncomingDTagTransferRequests(suite.ctx, address, func(index int64, request types.DTagTransferRequest) (stop bool) {
-		iterations += 1
-		return index == 1
+	suite.k.IterateUserIncomingDTagTransferRequests(suite.ctx, address, func(request types.DTagTransferRequest) (stop bool) {
+		iterations++
+		return iterations == 1
 	})
 	suite.Require().Equal(iterations, 2)
 }
@@ -204,9 +204,9 @@ func (suite *KeeperTestSuite) TestKeeper_IterateUserApplicationLinks() {
 	}
 
 	var iterated []types.ApplicationLink
-	suite.k.IterateUserApplicationLinks(ctx, address, func(index int64, link types.ApplicationLink) (stop bool) {
+	suite.k.IterateUserApplicationLinks(ctx, address, func(link types.ApplicationLink) (stop bool) {
 		iterated = append(iterated, link)
-		return index == 1
+		return len(iterated) == 1
 	})
 
 	suite.Require().Equal([]types.ApplicationLink{links[0], links[1]}, iterated)
@@ -349,7 +349,7 @@ func (suite *KeeperTestSuite) TestKeeper_IterateExpiringApplicationLinks() {
 			}
 
 			var iteratedLinks []types.ApplicationLink
-			suite.k.IterateExpiringApplicationLinks(ctx, func(index int64, link types.ApplicationLink) (stop bool) {
+			suite.k.IterateExpiringApplicationLinks(ctx, func(link types.ApplicationLink) (stop bool) {
 				iteratedLinks = append(iteratedLinks, link)
 				return false
 			})
diff --git a/x/profiles/keeper/keeper_chain_links_test.go b/x/profiles/keeper/keeper_chain_links_test.go
index 13188d3e..300c00fc 100644
--- a/x/profiles/keeper/keeper_chain_links_test.go
+++ b/x/profiles/keeper/keeper_chain_links_test.go
@@ -551,7 +551,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteAllUserChainLinks() {
 			check: func(ctx sdk.Context) {
 				address := "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"
 				var iterations = 0
-				suite.k.IterateUserChainLinks(ctx, address, func(index int64, link types.ChainLink) (stop bool) {
+				suite.k.IterateUserChainLinks(ctx, address, func(link types.ChainLink) (stop bool) {
 					iterations++
 					return false
 				})
@@ -601,7 +601,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteAllUserChainLinks() {
 			check: func(ctx sdk.Context) {
 				address := "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"
 				var iterations = 0
-				suite.k.IterateUserChainLinks(ctx, address, func(index int64, link types.ChainLink) (stop bool) {
+				suite.k.IterateUserChainLinks(ctx, address, func(link types.ChainLink) (stop bool) {
 					iterations++
 					return false
 				})
diff --git a/x/profiles/keeper/keeper_dtag_transfers_test.go b/x/profiles/keeper/keeper_dtag_transfers_test.go
index 246422f2..90ab2135 100644
--- a/x/profiles/keeper/keeper_dtag_transfers_test.go
+++ b/x/profiles/keeper/keeper_dtag_transfers_test.go
@@ -353,7 +353,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteAllUserIncomingDTagTransferReques
 				user := "cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773"
 
 				var iterations = 0
-				suite.k.IterateUserIncomingDTagTransferRequests(ctx, user, func(_ int64, _ types.DTagTransferRequest) (stop bool) {
+				suite.k.IterateUserIncomingDTagTransferRequests(ctx, user, func(_ types.DTagTransferRequest) (stop bool) {
 					iterations += 1
 					return false
 				})