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
configure mainnet using build tags #700
Conversation
Codecov Report
@@ Coverage Diff @@
## master #700 +/- ##
==========================================
+ Coverage 30.41% 30.82% +0.40%
==========================================
Files 147 149 +2
Lines 7020 7063 +43
==========================================
+ Hits 2135 2177 +42
- Misses 4776 4778 +2
+ Partials 109 108 -1
Continue to review full report at Codecov.
|
@akhilkumarpilli looks good, file namings are bit odd. Lets think of different namings. How about |
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.
Very cool, thank you.
I left some comments inline.
Can you see if there's a way that we can reduce the amount of common code that is duplicated? These areas are really tedious and easy to do wrong.
), | ||
|
||
provider.NewAppModule(app.keeper.provider, app.keeper.bank, app.keeper.market), | ||
) |
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.
same here. for instance, does ModuleManager
have an AppendModule()
function or something that can be used in the tag-specific functions?
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.
I am not able to find a way to append modules in ModuleManager
. Tried to reduce the amount of duplicate code and left with these.
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.
hmm, how about
app.mm = module.NewManager(
genutil.NewModule(),
// ...
app.createAkashModules()...,
)
// ...
func (app *App) createAkashModules() []sdk.AppModule {
// ...
}
or even
module.NewManager(app.createAppModules()...)
//...
func (app *App) createAppModules() []sdk.AppModules {
return append(app.createCoreAppModules(),app.createAkashAppModules()...)
}
func (app *App) createCoreModulesBase() []sdk.AppModules {
return []sdk.AppModule{
}
}
// mainnet version:
func (app *App) createAkashAppModules() []sdk.AppModule {
return []sdk.AppModule{}
}
// !mainnet version
func (app *App) createAkashAppModules() []sdk.AppModule {
return []sdk.AppModule{
deployment.NewAppModule(),
// ...
}
}
If we rename files to |
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.
nice work, thank you.
we have to reduce the amount of duplicated setup code if we're going to go this route, tho. I put some ideas in comments inline.
), | ||
|
||
provider.NewAppModule(app.keeper.provider, app.keeper.bank, app.keeper.market), | ||
) |
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.
hmm, how about
app.mm = module.NewManager(
genutil.NewModule(),
// ...
app.createAkashModules()...,
)
// ...
func (app *App) createAkashModules() []sdk.AppModule {
// ...
}
or even
module.NewManager(app.createAppModules()...)
//...
func (app *App) createAppModules() []sdk.AppModules {
return append(app.createCoreAppModules(),app.createAkashAppModules()...)
}
func (app *App) createCoreModulesBase() []sdk.AppModules {
return []sdk.AppModule{
}
}
// mainnet version:
func (app *App) createAkashAppModules() []sdk.AppModule {
return []sdk.AppModule{}
}
// !mainnet version
func (app *App) createAkashAppModules() []sdk.AppModule {
return []sdk.AppModule{
deployment.NewAppModule(),
// ...
}
}
deployment.ModuleName, | ||
provider.ModuleName, | ||
market.ModuleName, | ||
) |
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.
same here.
deployment.NewAppModuleSimulation(app.keeper.deployment, app.keeper.acct), | ||
market.NewAppModuleSimulation(app.keeper.market, app.keeper.acct, app.keeper.deployment, | ||
app.keeper.provider, app.keeper.bank), | ||
provider.NewAppModuleSimulation(app.keeper.provider, app.keeper.acct), |
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.
and here
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.
Love it, great work.
sorry @akhilkumarpilli I forgot to merge this. |
Fixes #683