Skip to content

Commit

Permalink
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/consumer/genesis.go
Original file line number Diff line number Diff line change
@@ -64,6 +64,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)
6 changes: 6 additions & 0 deletions app/consumer/genesis_test.go
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ package app_test
import (
"bytes"
"context"
"encoding/json"
"io/fs"
"os"
"path/filepath"
@@ -192,6 +193,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()
@@ -212,4 +217,5 @@ func TestConsumerGenesisTransformationV2(t *testing.T) {
require.Empty(t, consumerGenesis.InitialValSet)
require.NotEmpty(t, consumerGenesis.Provider.InitialValSet)
require.Equal(t, consumerGenesis.Params.RetryDelayPeriod, ccvtypes.DefaultRetryDelayPeriod)
require.Equal(t, consumerGenesis.NewChain, oldConsumerGenesis["new_chain"])
}

0 comments on commit f86c61f

Please sign in to comment.