Skip to content

Commit

Permalink
fix simapp/v2 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kocubinski committed Nov 7, 2024
1 parent 5e03575 commit 6fa61a1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions simapp/v2/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ func NewTestApp(t *testing.T) (*SimApp[transaction.Tx], context.Context) {
ChainId: "theChain",
AppHash: ci.Hash,
IsGenesis: true,
Height: 1,
},
genesisBytes,
nil,
Expand All @@ -103,7 +104,7 @@ func NewTestApp(t *testing.T) (*SimApp[transaction.Tx], context.Context) {
changes, err := newState.GetStateChanges()
require.NoError(t, err)

_, err = st.Commit(&store.Changeset{Changes: changes})
_, err = st.Commit(&store.Changeset{Version: 1, Changes: changes})
require.NoError(t, err)

return app, ctx
Expand All @@ -119,6 +120,7 @@ func MoveNextBlock(t *testing.T, app *SimApp[transaction.Tx], ctx context.Contex
require.NoError(t, err)

height, err := app.LoadLatestHeight()
height++
require.NoError(t, err)

// TODO: this is a hack to set the comet info in the context for distribution module dependency.
Expand All @@ -132,7 +134,7 @@ func MoveNextBlock(t *testing.T, app *SimApp[transaction.Tx], ctx context.Contex
_, newState, err := app.DeliverBlock(
ctx,
&server.BlockRequest[transaction.Tx]{
Height: height + 1,
Height: height,
Time: time.Now(),
Hash: bz[:],
AppHash: ci.Hash,
Expand All @@ -142,7 +144,7 @@ func MoveNextBlock(t *testing.T, app *SimApp[transaction.Tx], ctx context.Contex
changes, err := newState.GetStateChanges()
require.NoError(t, err)

_, err = st.Commit(&store.Changeset{Changes: changes})
_, err = st.Commit(&store.Changeset{Version: height, Changes: changes})
require.NoError(t, err)
}

Expand Down

0 comments on commit 6fa61a1

Please sign in to comment.