Skip to content

Commit

Permalink
add additinal test case
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Jul 22, 2024
1 parent b1d4bbf commit 85f119e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion x/observer/migrations/v8/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ var chainNoncesArray = []types.ChainNonces{
}

func TestMigrateStore(t *testing.T) {
t.Run("MigrateStore", func(t *testing.T) {
t.Run("can migrate chain nonces", func(t *testing.T) {
k, ctx, _, _ := keepertest.ObserverKeeper(t)

// set chain nonces
Expand Down Expand Up @@ -108,6 +108,19 @@ func TestMigrateStore(t *testing.T) {
}
})

t.Run("migrate nothing with empty array", func(t *testing.T) {
k, ctx, _, _ := keepertest.ObserverKeeper(t)

allChainNonces := k.GetAllChainNonces(ctx)
require.Len(t, allChainNonces, 0)

// migrate the store
err := v8.MigrateStore(ctx, *k)
require.NoError(t, err)

allChainNonces = k.GetAllChainNonces(ctx)
require.Len(t, allChainNonces, 0)
})
}

// setChainNoncesLegacy set a specific chainNonces in the store from its index
Expand Down

0 comments on commit 85f119e

Please sign in to comment.