diff --git a/app/consumer/genesis.go b/app/consumer/genesis.go index 27292feaa1..5bf5a5499b 100644 --- a/app/consumer/genesis.go +++ b/app/consumer/genesis.go @@ -59,6 +59,7 @@ func transform(jsonRaw []byte, ctx client.Context) (json.RawMessage, error) { ConsensusState: oldConsumerGenesis.ProviderConsensusState, InitialValSet: oldConsumerGenesis.InitialValSet, }, + NewChain: oldConsumerGenesis.NewChain, } newJson, err := ctx.Codec.MarshalJSON(&newGenesis) diff --git a/app/consumer/genesis_test.go b/app/consumer/genesis_test.go index f23e4c58d1..83dcbb2682 100644 --- a/app/consumer/genesis_test.go +++ b/app/consumer/genesis_test.go @@ -3,6 +3,7 @@ package app_test import ( "bytes" "context" + "encoding/json" "io/fs" "os" "path/filepath" @@ -191,6 +192,10 @@ func TestConsumerGenesisTransformationV2(t *testing.T) { _, err = cmd.ExecuteC() require.NoError(t, err) + var oldConsumerGenesis map[string]interface{} + err = json.Unmarshal([]byte(consumerGenesisStates[version]), &oldConsumerGenesis) + require.NoError(t, err, "Error parsing old version of ccv genesis content for consumer") + consumerGenesis := consumerTypes.GenesisState{} bz := output.Bytes() @@ -210,4 +215,5 @@ func TestConsumerGenesisTransformationV2(t *testing.T) { require.Empty(t, consumerGenesis.InitialValSet) require.NotEmpty(t, consumerGenesis.Provider.InitialValSet) + require.Equal(t, consumerGenesis.NewChain, oldConsumerGenesis["new_chain"]) }