2018-11-29 16:11:05 -06:00
|
|
|
# beacon_chain
|
|
|
|
# Copyright (c) 2018 Status Research & Development GmbH
|
|
|
|
# Licensed and distributed under either of
|
|
|
|
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
|
|
|
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
|
|
|
import
|
2018-12-11 11:55:45 -06:00
|
|
|
milagro_crypto,
|
2018-11-29 16:11:05 -06:00
|
|
|
../beacon_chain/extras,
|
|
|
|
../beacon_chain/spec/[crypto, datatypes]
|
|
|
|
|
2018-12-11 11:55:45 -06:00
|
|
|
func makeValidatorPrivKey(n: int): ValidatorPrivKey =
|
|
|
|
result.x[0] = n
|
2018-11-29 16:11:05 -06:00
|
|
|
|
2018-12-03 17:46:22 +00:00
|
|
|
func makeInitialValidators*(n = EPOCH_LENGTH): seq[InitialValidator] =
|
2018-12-11 11:55:45 -06:00
|
|
|
for i in 0..<n.int:
|
|
|
|
let key = makeValidatorPrivKey(i)
|
2018-11-29 16:11:05 -06:00
|
|
|
result.add InitialValidator(
|
2018-12-11 11:55:45 -06:00
|
|
|
pubkey: key.fromSigKey()
|
2018-11-29 16:11:05 -06:00
|
|
|
)
|