module/types code hygiene - utilize map access 2nd return value (#9098)

* update docs/code to utilize map access return values

* remove mock module in fromVM to simulate truly non-existent module

* update test docs to refelect change

Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
technicallyty
2021-04-13 19:00:04 +00:00
committed by GitHub
co-authored by technicallyty mergify[bot]
parent a465ae182c
commit 3ebf06ce0d
2 changed files with 12 additions and 15 deletions
+2 -4
View File
@@ -213,12 +213,10 @@ func TestInitGenesisOnMigration(t *testing.T) {
app.mm.Modules["mock"] = mockModule
// Run migrations only for "mock" module. That's why we put the initial
// version for bank as 0 (to run its InitGenesis), and for all other
// modules, we put their latest ConsensusVersion to skip migrations.
// Run migrations only for "mock" module. We exclude it from
// the VersionMap to simulate upgrading with a new module.
_, err := app.mm.RunMigrations(ctx, app.configurator,
module.VersionMap{
"mock": 0,
"bank": bank.AppModule{}.ConsensusVersion(),
"auth": auth.AppModule{}.ConsensusVersion(),
"authz": authz.AppModule{}.ConsensusVersion(),