init for mainchain_monitor
This commit is contained in:
parent
985298be1e
commit
31bd13a5d3
|
@ -328,7 +328,15 @@ proc readValue*(reader: var JsonReader, value: var Signature) {.inline.} =
|
|||
template fromSszBytes*(T: type BlsValue, bytes: openarray[byte]): auto =
|
||||
fromBytes(T, bytes)
|
||||
|
||||
# Initialization
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# For confutils
|
||||
func init*(T: typedesc[ValidatorPrivKey], hex: string): T {.inline.} =
|
||||
let success = result.fromHex(hex)
|
||||
doAssert success, "Private key is invalid" # Don't display private keys even if invalid
|
||||
|
||||
# For mainchain monitor
|
||||
func init*(T: typedesc[ValidatorPubKey], data: array[48, byte]): T {.inline.} =
|
||||
let success = result.fromBytes(data)
|
||||
doAssert success, "Public key is invalid" # Don't display private keys even if invalid
|
||||
|
|
Loading…
Reference in New Issue