-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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/staking)!: KVStoreService, return errors and use context.Context #16324
Conversation
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.
CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) | ||
|
||
k.TrackHistoricalInfo(ctx) | ||
return k.TrackHistoricalInfo(ctx) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
} | ||
|
||
// Called every block, update validator set | ||
func (k *Keeper) EndBlocker(ctx context.Context) ([]abci.ValidatorUpdate, error) { | ||
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) | ||
|
||
return k.BlockValidatorUpdates(sdk.UnwrapSDKContext(ctx)), nil | ||
return k.BlockValidatorUpdates(ctx) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
|
||
am.keeper.BeginBlocker(c) | ||
return nil | ||
return am.keeper.BeginBlocker(ctx) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
@@ -26,11 +26,21 @@ | |||
} | |||
|
|||
// recalculate inflation rate | |||
totalStakingSupply := k.StakingTokenSupply(ctx) | |||
bondedRatio := k.BondedRatio(ctx) | |||
totalStakingSupply, err := k.StakingTokenSupply(ctx) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
return err | ||
} | ||
|
||
bondedRatio, err := k.BondedRatio(ctx) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
…/kvstore-staking2
…ontext (#16324) Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> (cherry picked from commit 1be7d98) # Conflicts: # CHANGELOG.md # x/distribution/keeper/delegation.go # x/distribution/keeper/hooks.go # x/evidence/go.mod # x/evidence/go.sum # x/staking/migrations/v2/store.go # x/staking/simulation/operations_test.go # x/staking/types/errors.go
Description
Notes for reviewers:
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