Skip to content

Commit

Permalink
validate genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
GNaD13 committed Jan 29, 2024
1 parent afc8a64 commit 1fddfea
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/upgrades/multi-staking/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,18 @@ func CreateUpgradeHandler(

// migrate multistaking
appState, err = migrateMultiStaking(appState)
if err != nil {
panic(err)
}

fmt.Println()
fmt.Println("=============UpgradeHandler=============")
fmt.Printf("%s", appState[multistakingtypes.ModuleName])
fmt.Println("=============UpgradeHandler=============")

// validate genesis
var genesisState multistakingtypes.GenesisState
cdc.MustUnmarshalJSON(appState[multistakingtypes.ModuleName], &genesisState)
err = genesisState.Validate()
if err != nil {
panic(err)
}

vm[multistakingtypes.ModuleName] = multistaking.AppModule{}.ConsensusVersion()
mm.Modules[multistakingtypes.ModuleName].InitGenesis(ctx, cdc, appState[multistakingtypes.ModuleName])

Expand Down

0 comments on commit 1fddfea

Please sign in to comment.