Skip to content

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

Closed
rigelrozanski wants to merge 19 commits intorigel/genesis-generalizationfrom
rigel/genesis-generalization2
Closed

R4R [Staging PR 2/3] genesis generalization#4128
rigelrozanski wants to merge 19 commits intorigel/genesis-generalizationfrom
rigel/genesis-generalization2

Conversation

@rigelrozanski
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Contributor

@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

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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
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

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

a.keeper.AssertInvariants(ctx, a.logger)
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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)

@rigelrozanski rigelrozanski requested a review from fedekunze April 26, 2019 17:37
@alexanderbez alexanderbez added the T: State Machine Breaking State machine breaking changes (impacts consensus). label Apr 27, 2019
Copy link
Copy Markdown
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

@rigelrozanski
Copy link
Copy Markdown
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