parent
337aa83f1a
commit
224f22d377
|
@ -102,3 +102,4 @@ proc writeValue*(writer: var JsonWriter, value: ValidatorPrivKey) {.inline.} =
|
|||
proc readValue*(reader: var JsonReader, value: var ValidatorPrivKey) {.inline.} =
|
||||
value = SigKey.init(reader.readValue(string))
|
||||
|
||||
proc newPrivKey*(): ValidatorPrivKey = SigKey.random()
|
||||
|
|
|
@ -12,12 +12,13 @@ proc genSingleValidator(path: string): (ValidatorPubKey,
|
|||
ValidatorPrivKey,
|
||||
Eth2Digest) =
|
||||
var v: PrivateValidatorData
|
||||
# v.privKey = newSigKey()
|
||||
v.privKey = newPrivKey()
|
||||
if randomBytes(v.randao.seed.data) != sizeof(v.randao.seed.data):
|
||||
raise newException(Exception, "Could not generate randao seed")
|
||||
|
||||
writeFile(path, v)
|
||||
|
||||
assert v.privKey != ValidatorPrivKey(), "Private key shouldn't be zero"
|
||||
return (v.privKey.pubKey(), v.privKey, v.randao.initialCommitment)
|
||||
|
||||
# TODO: Make these more comprehensive and find them a new home
|
||||
|
|
Loading…
Reference in New Issue