Skip to content

Commit

Permalink
Mycelo election's validators max, at least env validators (#2166)
Browse files Browse the repository at this point in the history
  • Loading branch information
gastonponti authored Jul 26, 2023
1 parent 84ca735 commit fc20d69
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mycelo/genesis/genesis_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,14 @@ func (ctx *deployContext) deployValidators() error {

func (ctx *deployContext) deployElection() error {
return ctx.deployCoreContract("contracts", "Election", func(contract *contract.EVMBackend) error {
maxValidators := ctx.genesisConfig.Election.MaxElectableValidators
if uint64(ctx.accounts.NumValidators) > maxValidators {
maxValidators = uint64(ctx.accounts.NumValidators)
}
return contract.SimpleCall("initialize",
env.MustProxyAddressFor("Registry"),
newBigInt(ctx.genesisConfig.Election.MinElectableValidators),
newBigInt(ctx.genesisConfig.Election.MaxElectableValidators),
newBigInt(maxValidators),
ctx.genesisConfig.Election.MaxVotesPerAccount,
ctx.genesisConfig.Election.ElectabilityThreshold.BigInt(),
)
Expand Down

0 comments on commit fc20d69

Please sign in to comment.