From 85f119e771b45a82bece947180e9c6b0556837b8 Mon Sep 17 00:00:00 2001 From: lumtis Date: Mon, 22 Jul 2024 13:58:59 +0200 Subject: [PATCH] add additinal test case --- x/observer/migrations/v8/migrate_test.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/x/observer/migrations/v8/migrate_test.go b/x/observer/migrations/v8/migrate_test.go index 56fb061bc3..8a2aba9a87 100644 --- a/x/observer/migrations/v8/migrate_test.go +++ b/x/observer/migrations/v8/migrate_test.go @@ -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 @@ -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