-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
R4R [Staging PR 2/3] genesis generalization #4128
Conversation
cmd/gaia/app/app.go
Outdated
var moduleBasics []sdk.AppModuleBasics | ||
|
||
func init() { | ||
moduleBasics := []sdk.AppModuleBasics{ |
There was a problem hiding this comment.
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
)
There was a problem hiding this comment.
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 Report
@@ Coverage Diff @@
## rigel/genesis-generalization #4128 +/- ##
===============================================================
Coverage ? 59.03%
===============================================================
Files ? 222
Lines ? 15351
Branches ? 0
===============================================================
Hits ? 9062
Misses ? 5672
Partials ? 617 |
There was a problem hiding this 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InitGenesis(ctx, a.accountKeeper, a.feeCollectionKeeper, genesisState) | |
InitGenesis(ctx, appModule.accountKeeper, appModule.feeCollectionKeeper, genesisState) |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (a AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage { | |
func (appModule AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gs := ExportGenesis(ctx, a.accountKeeper, a.feeCollectionKeeper) | |
gs := ExportGenesis(ctx, appModule.accountKeeper, appModule.feeCollectionKeeper) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gs := ExportGenesis(ctx, a.keeper) | |
gs := ExportGenesis(ctx, appModule.keeper) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a.keeper.AssertInvariants(ctx, a.logger) | |
appModule.keeper.AssertInvariants(ctx, appModule.logger) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gs := ExportGenesis(ctx, a.keeper) | |
gs := ExportGenesis(ctx, appModule.keeper) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
closing in favour of #4159 |
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 explorerFor Admin Use: