Skip to content

Commit

Permalink
Add finalize block to make test pass and help ensure encoder/decoders…
Browse files Browse the repository at this point in the history
… are working.
  • Loading branch information
Taztingo committed Mar 21, 2024
1 parent 5884af3 commit 5ae8427
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"sort"
"testing"

abci "github.com/cometbft/cometbft/abci/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -43,12 +44,17 @@ func TestSimAppExportAndBlockedAddrs(t *testing.T) {
)
}

// finalize block so we have CheckTx state set
_, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{
Height: 1,
})
require.NoError(t, err)

app.Commit()

// Making a new app object with the db, so that initchain hasn't been called
app2 := New(log.NewTestLogger(t), opts.DB, nil, true,
map[int64]bool{}, opts.HomePath, 0, MakeEncodingConfig(), simtestutil.EmptyAppOptions{})
var err error
require.NotPanics(t, func() {
_, err = app2.ExportAppStateAndValidators(false, nil, nil)
}, "exporting app state at current height")
Expand Down

0 comments on commit 5ae8427

Please sign in to comment.