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

x/cap: fix comments, SetIndex, and some tests #7845

Merged
merged 3 commits into from
Nov 7, 2020

Conversation

ebuchman
Copy link
Member

@ebuchman ebuchman commented Nov 6, 2020

Surfaced from Informal Systems IBC Audit of cosmos-sdk hash 82f15f3.

Description

Fixes comments and some tests and add's more constraints to SetIndex per #7805


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.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@ebuchman ebuchman changed the title x/cap: fix comments and some tests x/cap: fix comments, SetIndex, and some tests Nov 6, 2020
@codecov
Copy link

codecov bot commented Nov 6, 2020

Codecov Report

Merging #7845 (acbfb5b) into master (56c08d1) will decrease coverage by 0.01%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##           master    #7845      +/-   ##
==========================================
- Coverage   54.24%   54.23%   -0.02%     
==========================================
  Files         609      609              
  Lines       38804    38807       +3     
==========================================
- Hits        21049    21046       -3     
- Misses      15601    15604       +3     
- Partials     2154     2157       +3     

Comment on lines +127 to +128
latest := k.GetLatestIndex(ctx)
if latest > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
latest := k.GetLatestIndex(ctx)
if latest > 0 {
if latest := k.GetLatestIndex(ctx); latest > 0 {

Copy link
Contributor

Choose a reason for hiding this comment

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

There isn't even a need to store this in a variable.

Copy link
Member Author

Choose a reason for hiding this comment

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

I kind of prefer the clarity of how its written currently for symmetry with the other index value being evaluated.

Co-authored-by: Alessio Treglia <[email protected]>
@alessio alessio added the A:automerge Automatically merge PR once all prerequisites pass. label Nov 7, 2020
@mergify mergify bot merged commit dd9ef12 into master Nov 7, 2020
@mergify mergify bot deleted the bucky/x-cap-minor-fixes branch November 7, 2020 20:38
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants