-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
refactor(x/slashing)!: use kvStoreService, context.Context and return errors #16246
Conversation
c := sdk.UnwrapSDKContext(ctx) | ||
BeginBlocker(c, am.keeper) | ||
return nil | ||
return BeginBlocker(ctx, am.keeper) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
…cosmos-sdk into facu/slashing-kvstoresvc
…/slashing-kvstoresvc
k.HandleValidatorSignature(ctx, voteInfo.Validator.Address, voteInfo.Validator.Power, comet.BlockIDFlag(voteInfo.BlockIdFlag)) | ||
sdkCtx := sdk.UnwrapSDKContext(ctx) | ||
for _, voteInfo := range sdkCtx.VoteInfos() { | ||
err := k.HandleValidatorSignature(ctx, voteInfo.Validator.Address, voteInfo.Validator.Power, comet.BlockIDFlag(voteInfo.BlockIdFlag)) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
…/slashing-kvstoresvc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
iter, err := store.Iterator(types.ValidatorSigningInfoKeyPrefix, storetypes.PrefixEndBytes(types.ValidatorSigningInfoKeyPrefix)) | ||
if err != nil { | ||
return err | ||
} | ||
defer iter.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this go above the if err so its added to the stack or the assumption is the error would mean that iterator is not opened
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assumption is that the error means the iterator is not open, there's also a static check for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left two comments but otherwise looks good
… errors
Description
Closes: #XXXX
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
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...
!
in the type prefix if API or client breaking change