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

R4R [Staging PR 2/3] genesis generalization #4128

Closed

Conversation

rigelrozanski
Copy link
Contributor

@rigelrozanski rigelrozanski commented Apr 16, 2019

Staging PR
Downstream #4033

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

  • Wrote tests

  • Updated relevant documentation (docs/)

  • Added a relevant changelog entry: sdkch add [section] [stanza] [message]

  • rereviewed Files changed in the github PR explorer


For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

var moduleBasics []sdk.AppModuleBasics

func init() {
moduleBasics := []sdk.AppModuleBasics{
Copy link
Contributor

Choose a reason for hiding this comment

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

ineffectual assignment to moduleBasics (from ineffassign)

Copy link
Contributor

Choose a reason for hiding this comment

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

Good to know that this thing actually works :)

@codecov
Copy link

codecov bot commented Apr 18, 2019

Codecov Report

❗ No coverage uploaded for pull request base (rigel/genesis-generalization@8008e48). Click here to learn what that means.
The diff coverage is 32.53%.

@@                       Coverage Diff                       @@
##             rigel/genesis-generalization    #4128   +/-   ##
===============================================================
  Coverage                                ?   59.03%           
===============================================================
  Files                                   ?      222           
  Lines                                   ?    15351           
  Branches                                ?        0           
===============================================================
  Hits                                    ?     9062           
  Misses                                  ?     5672           
  Partials                                ?      617

@rigelrozanski rigelrozanski changed the title WIP genesis generalization R4R [Staging PR] genesis generalization Apr 18, 2019
@rigelrozanski rigelrozanski changed the title R4R [Staging PR] genesis generalization R4R [Staging PR 2/3] genesis generalization Apr 18, 2019
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.

looking good so far. Sorry for being picky, I added some suggestions on variable naming

cmd/gaia/app/sim_test.go Show resolved Hide resolved
x/auth/module.go Show resolved Hide resolved
func (a AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate {
var genesisState GenesisState
moduleCdc.MustUnmarshalJSON(data, &genesisState)
InitGenesis(ctx, a.accountKeeper, a.feeCollectionKeeper, genesisState)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
InitGenesis(ctx, a.accountKeeper, a.feeCollectionKeeper, genesisState)
InitGenesis(ctx, appModule.accountKeeper, appModule.feeCollectionKeeper, genesisState)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see first comment

}

// module export genesis
func (a AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
func (a AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage {
func (appModule AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see first comment


// module export genesis
func (a AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage {
gs := ExportGenesis(ctx, a.accountKeeper, a.feeCollectionKeeper)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
gs := ExportGenesis(ctx, a.accountKeeper, a.feeCollectionKeeper)
gs := ExportGenesis(ctx, appModule.accountKeeper, appModule.feeCollectionKeeper)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see first comment


// module export genesis
func (a AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage {
gs := ExportGenesis(ctx, a.keeper)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
gs := ExportGenesis(ctx, a.keeper)
gs := ExportGenesis(ctx, appModule.keeper)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see first comment

var genesisState GenesisState
moduleCdc.MustUnmarshalJSON(data, &genesisState)
InitGenesis(ctx, a.keeper, genesisState)

a.keeper.AssertInvariants(ctx, a.logger)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
a.keeper.AssertInvariants(ctx, a.logger)
appModule.keeper.AssertInvariants(ctx, appModule.logger)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see first comment


// module export genesis
func (a AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage {
gs := ExportGenesis(ctx, a.keeper)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
gs := ExportGenesis(ctx, a.keeper)
gs := ExportGenesis(ctx, appModule.keeper)

x/bank/module.go Show resolved Hide resolved
x/staking/module.go Show resolved Hide resolved
@alexanderbez alexanderbez added the T: State Machine Breaking State machine breaking changes (impacts consensus). label Apr 27, 2019
Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

ACK

x/auth/module.go Show resolved Hide resolved
@rigelrozanski
Copy link
Contributor Author

closing in favour of #4159

@rigelrozanski rigelrozanski deleted the rigel/genesis-generalization2 branch May 29, 2019 20:56
@rigelrozanski rigelrozanski restored the rigel/genesis-generalization2 branch May 29, 2019 20:56
@rigelrozanski rigelrozanski deleted the rigel/genesis-generalization2 branch May 29, 2019 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: State Machine Breaking State machine breaking changes (impacts consensus).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants