e2e test for kava 9 -> kava 10 migration (#1232)

* e2e test for kava9 export

* fix bad chain id
This commit is contained in:
Draco Li 2022-04-29 12:08:04 -04:00 committed by GitHub
parent 014038ee57
commit a21d16f297
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 2 deletions

View File

@ -15,7 +15,7 @@ import (
var (
// TODO: needs verification before release
GenesisTime = time.Date(2022, 5, 10, 17, 0, 0, 0, time.UTC)
ChainID = "kava-2222-10"
ChainID = "kava_2222-10"
)
func setConfigIfUnsealed() {

View File

@ -8,6 +8,7 @@ import (
bridgetypes "github.com/kava-labs/kava-bridge/x/bridge/types"
"github.com/kava-labs/kava/app"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/cosmos/cosmos-sdk/client"
sdk "github.com/cosmos/cosmos-sdk/types"
@ -125,6 +126,29 @@ func TestMigrateSavings(t *testing.T) {
})
}
func TestMigrateFull(t *testing.T) {
t.Skip()
// File: https://s3.us-west-2.amazonaws.com/levi.testing.kava.io/kava-9-4-19-export-genesis.json
// Height: 1145621
genDoc, err := tmtypes.GenesisDocFromFile(filepath.Join("testdata", "kava-9-4-19-export-genesis.json"))
assert.NoError(t, err)
ctx := newClientContext()
newGenDoc, err := Migrate(genDoc, ctx)
assert.NoError(t, err)
var appMap genutiltypes.AppMap
err = tmjson.Unmarshal(newGenDoc.AppState, &appMap)
assert.NoError(t, err)
config := app.MakeEncodingConfig()
err = app.ModuleBasics.ValidateGenesis(ctx.Codec, config.TxConfig, appMap)
assert.NoError(t, err)
tApp := app.NewTestApp()
require.NotPanics(t, func() {
tApp.InitializeFromGenesisStatesWithTimeAndChainID(newGenDoc.GenesisTime, newGenDoc.ChainID, app.GenesisState(appMap))
})
}
func migrateToV17AndGetAppMap(t *testing.T) (genutiltypes.AppMap, client.Context) {
genDoc, err := tmtypes.GenesisDocFromFile(filepath.Join("testdata", "genesis-v16.json"))
assert.NoError(t, err)

View File

@ -1,6 +1,6 @@
{
"genesis_time": "2022-05-10T17:00:00Z",
"chain_id": "kava-2222-10",
"chain_id": "kava_2222-10",
"initial_height": "1",
"consensus_params": {
"block": {