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

chore(tm): use the second return value of GetConsensusState to check if consensus state exists #3570

Merged
merged 4 commits into from
May 15, 2023

Conversation

siburu
Copy link
Contributor

@siburu siburu commented May 9, 2023

Description

In some places, codes like below are used to check whether a consensus state exists or not.
I think this is not a bug, but a bit different from the intention of GetConsensusState.
Probably, callers of this function should see the second return value to check it.

if cons, _ := GetConsensusState(....); cons != nil {
    ....
}

Commit Message / Changelog Entry

chore(tm): use the second return value of GetConsensusState to check if consensus state exists

see the guidelines for commit messages. (view raw markdown for examples)


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

…if consensus state exists

Signed-off-by: Masanori Yoshida <[email protected]>
@siburu siburu marked this pull request as ready for review May 9, 2023 20:11
Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

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

Thank you, @siburu!

@codecov-commenter
Copy link

codecov-commenter commented May 14, 2023

Codecov Report

Merging #3570 (8709a02) into main (8e9d797) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3570      +/-   ##
==========================================
- Coverage   78.76%   78.76%   -0.01%     
==========================================
  Files         182      182              
  Lines       12688    12687       -1     
==========================================
- Hits         9994     9993       -1     
  Misses       2262     2262              
  Partials      432      432              
Impacted Files Coverage Δ
...light-clients/07-tendermint/misbehaviour_handle.go 85.43% <100.00%> (-0.15%) ⬇️
modules/light-clients/07-tendermint/update.go 87.50% <100.00%> (ø)

Copy link
Contributor

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

🙏

@mergify mergify bot merged commit 201a5bb into cosmos:main May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants