Skip to content

Commit

Permalink
fix LastValidatorPower
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Aug 20, 2023
1 parent 8434f63 commit 8d56138
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion x/cronos/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,32 @@ type ExportFeemarketParams struct {
EnableHeight int64 `json:"enable_height,string"`
}

// LastValidatorPower required for validator set update logic.
type LastValidatorPower struct {
// address is the address of the validator.
Address string `json:"address"`
// power defines the power of the validator.
Power int64 `json:"power,string"`
}

type ExportStakingGenesisState struct {
stakingtypes.GenesisState
Params ExportStakingParams `json:"params"`
LastValidatorPowers []LastValidatorPower `json:"last_validator_powers"`
Validators []ExportStakingValidator `json:"validators"`
}

type ExportStakingParams struct {
stakingtypes.Params
UnbondingTime string `json:"unbonding_time"`
}

type ExportStakingValidator struct {
stakingtypes.Validator
Status string `json:"status"`
UnbondingHeight int64 `json:"unbonding_height,string"`
}

func Migrate(appState genutiltypes.AppMap, clientCtx client.Context) genutiltypes.AppMap {
// Add feeibc with default genesis.
if appState[ibcfeetypes.ModuleName] == nil {
Expand Down Expand Up @@ -305,7 +331,7 @@ func Migrate(appState genutiltypes.AppMap, clientCtx client.Context) genutiltype
}
appState[feemarkettypes.ModuleName] = data

var stakingState stakingtypes.GenesisState
var stakingState ExportStakingGenesisState
err = json.Unmarshal(appState[stakingtypes.ModuleName], &stakingState)
if err != nil {
panic(err)
Expand Down

0 comments on commit 8d56138

Please sign in to comment.