Skip to content

Commit

Permalink
fix: TestInitGenesisOnMigration
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Jan 5, 2023
1 parent 1e46a31 commit c740cd4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion simapp/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ func TestInitGenesisOnMigration(t *testing.T) {
encCfg := MakeTestEncodingConfig()
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
app := NewSimApp(logger, db, nil, true, DefaultNodeHome, 0, encCfg, EmptyAppOptions{})
app.SetUpgradeChecker(app.UpgradeKeeper.IsUpgraded)
ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()})

// Create a mock module. This module will serve as the new module we're
Expand All @@ -216,7 +217,7 @@ func TestInitGenesisOnMigration(t *testing.T) {
mockModule := mocks.NewMockAppModule(mockCtrl)
mockDefaultGenesis := json.RawMessage(`{"key": "value"}`)
mockModule.EXPECT().DefaultGenesis(gomock.Eq(app.appCodec)).Times(1).Return(mockDefaultGenesis)
mockModule.EXPECT().InitGenesis(gomock.Eq(ctx), gomock.Eq(app.appCodec), gomock.Eq(mockDefaultGenesis)).Times(1).Return(nil)
mockModule.EXPECT().InitGenesis(gomock.Any(), gomock.Eq(app.appCodec), gomock.Eq(mockDefaultGenesis)).Times(1).Return(nil)
mockModule.EXPECT().ConsensusVersion().Times(1).Return(uint64(0))

app.mm.Modules["mock"] = mockModule
Expand Down

0 comments on commit c740cd4

Please sign in to comment.