Skip to content

Commit

Permalink
Merge branch 'feat/aasi-merger-cmd' into feat/asi-address-replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathansumner authored Apr 16, 2024
2 parents 4f31368 + 7f4f616 commit 7ed1892
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cmd/fetchd/cmd/genasiupgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ func ASIGenesisUpgradeCmd(defaultNodeHome string) *cobra.Command {
genFile := config.GenesisFile()

appState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFile)

if err != nil {
return fmt.Errorf("failed to unmarshal genesis state: %w", err)
}

appStateJSON, err := json.Marshal(appState)
appStateJSON, err := json.Marshal(appState)
if err != nil {
return fmt.Errorf("failed to marshal application genesis state: %w", err)
}
Expand All @@ -72,7 +73,10 @@ func ASIGenesisUpgradeCmd(defaultNodeHome string) *cobra.Command {
// replace addresses across the genesis file
ASIGenesisUpgradeReplaceAddresses(&appStateStr)

return genutil.ExportGenesisFile(genDoc, genFile)
// replace chain-id
ASIGenesisUpgradeReplaceChainID(genDoc)

return genutil.ExportGenesisFile(genDoc, genFile)
},
}

Expand All @@ -86,7 +90,9 @@ func ASIGenesisUpgradeCmd(defaultNodeHome string) *cobra.Command {

func ASIGenesisUpgradeReplaceDenomMetadata() {}

func ASIGenesisUpgradeReplaceChainID() {}
func ASIGenesisUpgradeReplaceChainID(genesisData *types.GenesisDoc) {
genesisData.ChainID = NewChainId
}

func ASIGenesisUpgradeReplaceDenom() {}

Expand Down

0 comments on commit 7ed1892

Please sign in to comment.