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

feat!: add error handling to staking hooks #9571

Merged
merged 4 commits into from
Jun 30, 2021
Merged

Conversation

fedekunze
Copy link
Collaborator

@fedekunze fedekunze commented Jun 23, 2021

Description

  • Adds error handling for staking hooks

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)

@fedekunze fedekunze changed the title feat: add error handling to staking hooks !feat: add error handling to staking hooks Jun 23, 2021
@codecov
Copy link

codecov bot commented Jun 23, 2021

Codecov Report

Merging #9571 (1b40966) into master (aef416f) will increase coverage by 0.01%.
The diff coverage is 30.09%.

❗ Current head 1b40966 differs from pull request most recent head 5819d52. Consider uploading reports for the commit 5819d52 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9571      +/-   ##
==========================================
+ Coverage   60.59%   60.61%   +0.01%     
==========================================
  Files         588      588              
  Lines       37402    37300     -102     
==========================================
- Hits        22665    22609      -56     
+ Misses      12751    12741      -10     
+ Partials     1986     1950      -36     
Impacted Files Coverage Δ
simapp/export.go 13.18% <0.00%> (ø)
x/staking/genesis.go 57.89% <0.00%> (-2.11%) ⬇️
x/staking/keeper/msg_server.go 0.43% <0.00%> (-0.01%) ⬇️
x/staking/types/hooks.go 3.22% <0.00%> (-5.87%) ⬇️
x/staking/keeper/delegation.go 69.06% <33.33%> (-1.67%) ⬇️
x/staking/keeper/hooks.go 30.00% <47.36%> (+30.00%) ⬆️
x/distribution/keeper/hooks.go 30.95% <53.84%> (+5.95%) ⬆️
x/slashing/keeper/hooks.go 80.00% <76.92%> (-2.76%) ⬇️
server/logger.go 0.00% <0.00%> (-33.34%) ⬇️
x/bank/keeper/grpc_query.go 40.25% <0.00%> (-10.20%) ⬇️
... and 30 more

@fedekunze fedekunze marked this pull request as ready for review June 29, 2021 18:11
@aaronc aaronc added T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). T: State Machine Breaking State machine breaking changes (impacts consensus). and removed T: State Machine Breaking State machine breaking changes (impacts consensus). labels Jun 29, 2021
@amaury1093 amaury1093 changed the title !feat: add error handling to staking hooks feat!: add error handling to staking hooks Jun 30, 2021
Copy link
Contributor

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. It's unfortunate we didn't think of doing this in the 1st place

@amaury1093 amaury1093 added the A:automerge Automatically merge PR once all prerequisites pass. label Jun 30, 2021
@fedekunze
Copy link
Collaborator Author

I see some unrelated tests failing:

    grpc_web_test.go:51: 
        	Error Trace:	grpc_web_test.go:51
        	            				suite.go:118
        	            				grpc_web_test.go:314
        	Error:      	Received unexpected error:
        	            	listen tcp 0.0.0.0:40973: bind: address already in use
        	Test:       	TestGRPCWebTestSuite
coverage: 37.5% of statements
panic: test timed out after 30m0s

@fedekunze
Copy link
Collaborator Author

@AmauryM @aaronc do you think that we could add this functionality for the upcoming v0.43.0 release?

@mergify mergify bot merged commit f5b11bc into master Jun 30, 2021
@mergify mergify bot deleted the fedekunze/hooks-err branch June 30, 2021 10:13
@amaury1093
Copy link
Contributor

@AmauryM @aaronc do you think that we could add this functionality for the upcoming v0.43.0 release?

It's an API-breaking change, I would rahter not include it in 0.43

larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
<!--
The default pull request template is for types feat, fix, or refactor.
For other templates, add one of the following parameters to the url:
- template=docs.md
- template=other.md
-->

## Description

- Adds error handling for staking hooks

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review. -->

---

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

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [x] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [x] 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. C:x/distribution distribution module related C:x/slashing C:x/staking T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants