mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-25 07:45:18 +00:00
e2e test for kava 9 -> kava 10 migration (#1232)
* e2e test for kava9 export * fix bad chain id
This commit is contained in:
parent
014038ee57
commit
a21d16f297
@ -15,7 +15,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
// TODO: needs verification before release
|
// TODO: needs verification before release
|
||||||
GenesisTime = time.Date(2022, 5, 10, 17, 0, 0, 0, time.UTC)
|
GenesisTime = time.Date(2022, 5, 10, 17, 0, 0, 0, time.UTC)
|
||||||
ChainID = "kava-2222-10"
|
ChainID = "kava_2222-10"
|
||||||
)
|
)
|
||||||
|
|
||||||
func setConfigIfUnsealed() {
|
func setConfigIfUnsealed() {
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
bridgetypes "github.com/kava-labs/kava-bridge/x/bridge/types"
|
bridgetypes "github.com/kava-labs/kava-bridge/x/bridge/types"
|
||||||
"github.com/kava-labs/kava/app"
|
"github.com/kava-labs/kava/app"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
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) {
|
func migrateToV17AndGetAppMap(t *testing.T) (genutiltypes.AppMap, client.Context) {
|
||||||
genDoc, err := tmtypes.GenesisDocFromFile(filepath.Join("testdata", "genesis-v16.json"))
|
genDoc, err := tmtypes.GenesisDocFromFile(filepath.Join("testdata", "genesis-v16.json"))
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
2
migrate/v0_17/testdata/genesis-v17.json
vendored
2
migrate/v0_17/testdata/genesis-v17.json
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"genesis_time": "2022-05-10T17:00:00Z",
|
"genesis_time": "2022-05-10T17:00:00Z",
|
||||||
"chain_id": "kava-2222-10",
|
"chain_id": "kava_2222-10",
|
||||||
"initial_height": "1",
|
"initial_height": "1",
|
||||||
"consensus_params": {
|
"consensus_params": {
|
||||||
"block": {
|
"block": {
|
||||||
|
Loading…
Reference in New Issue
Block a user