We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Create iterator functions for gov keepers
Currently gov iterators are duplicated and defined within each function in the governance keeper. For eg:
// Deletes all the deposits on a specific proposal without refunding them func (keeper Keeper) DeleteDeposits(ctx sdk.Context, proposalID uint64) { store := ctx.KVStore(keeper.storeKey) depositsIterator := keeper.GetDeposits(ctx, proposalID) defer depositsIterator.Close() for ; depositsIterator.Valid(); depositsIterator.Next() { deposit := &Deposit{} keeper.cdc.MustUnmarshalBinaryLengthPrefixed(depositsIterator.Value(), deposit) err := keeper.sk.BurnCoins(ctx, ModuleName, deposit.Amount) if err != nil { panic(err) } store.Delete(depositsIterator.Key()) } }
Define the following iterators:
func (k Keeper) IterateProposals(ctx sdk.Context, fn func(proposalID uint64) (stop bool)) func (k Keeper) IterateRedelegations(ctx sdk.Context, fn func(proposalID uint64, depositorAddr sdk.AccAddress) (stop bool)) func (k Keeper) IterateRedelegations(ctx sdk.Context, fn func(proposalID uint64, voterAddr sdk.AccAddress) (stop bool))
The text was updated successfully, but these errors were encountered:
This seems like a quick one. Maybe also tackle this issue: #3386
Sorry, something went wrong.
This seems like a quick one.
👍 I think this is blocked by #4437 tho...
Thanks @fedekunze
fedekunze
Successfully merging a pull request may close this issue.
Summary
Create iterator functions for gov keepers
Problem Definition
Currently gov iterators are duplicated and defined within each function in the governance keeper. For eg:
Proposal
Define the following iterators:
For Admin Use
The text was updated successfully, but these errors were encountered: