Skip to content

Commit

Permalink
refactor: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathansumner committed Apr 17, 2024
1 parent 11cc45b commit 52e653f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cmd/fetchd/cmd/genasiupgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ 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)
}

// replace chain-id
ASIGenesisUpgradeReplaceChainID(genDoc)

// set denom metadata in bank module
err = ASIGenesisUpgradeReplaceDenomMetadata(cdc, &appState)
if err != nil {
Expand All @@ -82,11 +84,8 @@ func ASIGenesisUpgradeCmd(defaultNodeHome string) *cobra.Command {
// replace denom across the genesis file
ASIGenesisUpgradeReplaceDenom(&appStateStr)

// save the updated genesis file
genDoc.AppState = []byte(appStateStr)

// replace chain-id
ASIGenesisUpgradeReplaceChainID(genDoc)

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

0 comments on commit 52e653f

Please sign in to comment.