Skip to content
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: simplify hooks implementation #13396

Merged
merged 9 commits into from
Sep 27, 2022
Merged

refactor: simplify hooks implementation #13396

merged 9 commits into from
Sep 27, 2022

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Sep 26, 2022

Description

Closes: #12079


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...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • 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 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)

x/staking/keeper/validator.go Fixed Show fixed Hide fixed
x/staking/keeper/val_state_change.go Fixed Show fixed Hide fixed
x/staking/keeper/val_state_change.go Fixed Show fixed Hide fixed
x/staking/keeper/slash.go Fixed Show fixed Hide fixed
x/staking/keeper/slash.go Fixed Show fixed Hide fixed
@@ -24,7 +24,7 @@
keeper.RefundAndDeleteDeposits(ctx, proposal.Id) // refund deposit if proposal got removed without getting 100% of the proposal

// called when proposal become inactive
keeper.AfterProposalFailedMinDeposit(ctx, proposal.Id)
keeper.Hooks().AfterProposalFailedMinDeposit(ctx, proposal.Id)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
@@ -24,7 +24,7 @@
keeper.RefundAndDeleteDeposits(ctx, proposal.Id) // refund deposit if proposal got removed without getting 100% of the proposal

// called when proposal become inactive
keeper.AfterProposalFailedMinDeposit(ctx, proposal.Id)
keeper.Hooks().AfterProposalFailedMinDeposit(ctx, proposal.Id)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
@@ -104,7 +104,7 @@
keeper.RemoveFromActiveProposalQueue(ctx, proposal.Id, *proposal.VotingEndTime)

// when proposal become active
keeper.AfterProposalVotingPeriodEnded(ctx, proposal.Id)
keeper.Hooks().AfterProposalVotingPeriodEnded(ctx, proposal.Id)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
@@ -104,7 +104,7 @@
keeper.RemoveFromActiveProposalQueue(ctx, proposal.Id, *proposal.VotingEndTime)

// when proposal become active
keeper.AfterProposalVotingPeriodEnded(ctx, proposal.Id)
keeper.Hooks().AfterProposalVotingPeriodEnded(ctx, proposal.Id)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
@julienrbrt julienrbrt marked this pull request as ready for review September 27, 2022 10:53
@julienrbrt julienrbrt requested a review from a team as a code owner September 27, 2022 10:53
@codecov
Copy link

codecov bot commented Sep 27, 2022

Codecov Report

Merging #13396 (ab4b89a) into main (4fe7797) will decrease coverage by 1.52%.
The diff coverage is 26.66%.

❗ Current head ab4b89a differs from pull request most recent head 4f4755c. Consider uploading reports for the commit 4f4755c to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #13396      +/-   ##
==========================================
- Coverage   55.87%   54.35%   -1.53%     
==========================================
  Files         646      640       -6     
  Lines       54895    54820      -75     
==========================================
- Hits        30675    29798     -877     
- Misses      21762    22620     +858     
+ Partials     2458     2402      -56     
Impacted Files Coverage Δ
baseapp/grpcrouter.go 90.00% <ø> (ø)
baseapp/grpcrouter_helpers.go 25.00% <ø> (ø)
baseapp/grpcserver.go 1.72% <ø> (ø)
baseapp/msg_service_router.go 85.29% <ø> (+4.41%) ⬆️
baseapp/options.go 67.92% <0.00%> (-0.60%) ⬇️
client/broadcast.go 54.54% <ø> (+2.99%) ⬆️
client/cmd.go 57.73% <ø> (ø)
client/config/toml.go 55.55% <ø> (ø)
client/context.go 54.49% <ø> (-1.79%) ⬇️
client/flags/flags.go 19.35% <ø> (-0.32%) ⬇️
... and 253 more

@julienrbrt julienrbrt merged commit 53519ea into main Sep 27, 2022
@julienrbrt julienrbrt deleted the julien/hooks branch September 27, 2022 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor to delete every modules keeper/hooks.go file
3 participants