Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MissingNO57 committed Oct 17, 2024
1 parent a4691c9 commit d38d239
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions app/upgrade_cudos.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@ func CudosMergeUpgradeHandler(app *App, ctx sdk.Context, cudosCfg *CudosMergeCon
func updateMaxValidators(app *App, ctx sdk.Context, cudosCfg *CudosMergeConfig, manifest *UpgradeManifest, allowReductionOfMaxValidators bool) error {
params := app.StakingKeeper.GetParams(ctx)

if !allowReductionOfMaxValidators && cudosCfg.Config.NewMaxValidators < params.MaxValidators {
return fmt.Errorf("the NewMaxValidators config parameter (= %v) is smaller than the current value of MaxValidators in staking params (= %v)", cudosCfg.Config.NewMaxValidators, params.MaxValidators)
}

if cudosCfg.Config.NewMaxValidators != 0 && cudosCfg.Config.NewMaxValidators != params.MaxValidators {
if !allowReductionOfMaxValidators && cudosCfg.Config.NewMaxValidators < params.MaxValidators {
return fmt.Errorf("the NewMaxValidators config parameter (= %v) is smaller than the current value of MaxValidators in staking params (= %v)", cudosCfg.Config.NewMaxValidators, params.MaxValidators)
}

manifest.MaxValidatorsChange = &ParamsChange[uint32]{}

manifest.MaxValidatorsChange.OriginalVal = params.MaxValidators
Expand Down
4 changes: 2 additions & 2 deletions app/upgrade_v_11_4_manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ func NewUpgradeManifest() *UpgradeManifest {
}

type ParamsChange[T any] struct {
OriginalVal T `json:"original_val,omitempty"`
NewVal T `json:"new_val,omitempty"`
OriginalVal T `json:"original_val"`
NewVal T `json:"new_val"`
}

type Contracts struct {
Expand Down
3 changes: 2 additions & 1 deletion app/upgrade_v_11_4_network_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ var NetworkInfos = map[string]NetworkConfig{
VestingCollisionDestAddr: "cudos1nj49l56x7sss5hqyvfmctxr3mq64whg273g3x5",
CommunityPoolBalanceDestAddr: "cudos1dslwarknhfsw3pfjzxxf5mn28q3ewfectw0gta",

VestingPeriod: 3 * 30 * 24 * 60 * 60, // 3 months period
VestingPeriod: 3 * 30 * 24 * 60 * 60, // 3 months period
NewMaxValidators: 91,

BalanceConversionConstants: []Pair[string, sdk.Dec]{
{"acudos", newDec("266.629")}},
Expand Down

0 comments on commit d38d239

Please sign in to comment.