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

Start global capability index at 1 #6047

Merged
merged 3 commits into from
Apr 22, 2020
Merged

Start global capability index at 1 #6047

merged 3 commits into from
Apr 22, 2020

Conversation

AdityaSripal
Copy link
Member

Closes: #6039

Description

An annoying quirk in the capability testing setup prevented us from catching the bug reported above. Created a new testcase TestOriginalCapabilityKeeper that reproduced the failure above and is now passing.

Created InitGenesis logic to set initial global index to 1


For contributor use:

  • 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

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

Copy link
Collaborator

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

utACK

x/capability/keeper/keeper.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Apr 21, 2020

Codecov Report

Merging #6047 into master will increase coverage by 0.00%.
The diff coverage is 71.42%.

@@           Coverage Diff           @@
##           master    #6047   +/-   ##
=======================================
  Coverage   54.69%   54.69%           
=======================================
  Files         424      424           
  Lines       25808    25814    +6     
=======================================
+ Hits        14115    14119    +4     
- Misses      10716    10717    +1     
- Partials      977      978    +1     

@fedekunze fedekunze merged commit 5e40869 into master Apr 22, 2020
@fedekunze fedekunze deleted the aditya/non-zero-cap branch April 22, 2020 01:04
@@ -98,7 +98,10 @@ func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}

// InitGenesis performs the capability module's genesis initialization It returns
// no validator updates.
func (am AppModule) InitGenesis(_ sdk.Context, _ codec.JSONMarshaler, _ json.RawMessage) []abci.ValidatorUpdate {
func (am AppModule) InitGenesis(ctx sdk.Context, _ codec.JSONMarshaler, _ json.RawMessage) []abci.ValidatorUpdate {
Copy link
Contributor

Choose a reason for hiding this comment

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

Won't this be run after port binding in app.go? That seems problematic

Copy link
Contributor

Choose a reason for hiding this comment

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

... never mind - however, somehow, this is not being called

larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
* start index at 1

* Update x/capability/keeper/keeper.go

Co-authored-by: Federico Kunze <[email protected]>
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.

Impossible to initialize two or more IBC modules
3 participants