Skip to content

wip: state migration msg #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

wip: state migration msg #169

wants to merge 7 commits into from

Conversation

vladjdk
Copy link
Member

@vladjdk vladjdk commented May 20, 2025

todo: finish feegrants and work on pagination

closes: #147

todo: finish feegrants and work on pagination
// ===============
func (k *Keeper) migrateDelegations(ctx sdk.Context, originalAddress sdk.AccAddress, maxValidators uint16, newAddress sdk.AccAddress) error {

delegations, err := k.stakingKeeper.GetDelegatorDelegations(ctx, originalAddress, maxValidators)

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This definition of err is never used.

Copilot Autofix

AI 17 days ago

To fix the issue, we should remove the unused assignment to the err variable on line 39. Since the delegations variable is used in the subsequent loop, we can retain the call to k.stakingKeeper.GetDelegatorDelegations but discard the unused err assignment by replacing it with the blank identifier _. This ensures that the code remains functional while eliminating the unnecessary variable assignment.


Suggested changeset 1
x/vm/keeper/account_migration.go

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/x/vm/keeper/account_migration.go b/x/vm/keeper/account_migration.go
--- a/x/vm/keeper/account_migration.go
+++ b/x/vm/keeper/account_migration.go
@@ -38,3 +38,3 @@
 
-	delegations, err := k.stakingKeeper.GetDelegatorDelegations(ctx, originalAddress, maxValidators)
+	delegations, _ := k.stakingKeeper.GetDelegatorDelegations(ctx, originalAddress, maxValidators)
 
EOF
@@ -38,3 +38,3 @@

delegations, err := k.stakingKeeper.GetDelegatorDelegations(ctx, originalAddress, maxValidators)
delegations, _ := k.stakingKeeper.GetDelegatorDelegations(ctx, originalAddress, maxValidators)

Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Account Migration Message
1 participant