Address issue #1714.

This commit is contained in:
cheatfate 2020-10-05 10:39:58 +03:00 committed by zah
parent 99afafecd7
commit 67a93f558b
1 changed files with 6 additions and 5 deletions

View File

@ -25,7 +25,7 @@
import import
# Standard library # Standard library
options, tables, std/[options, tables],
# Internal # Internal
./digest, ./digest,
# Status # Status
@ -33,6 +33,7 @@ import
blscurve, blscurve,
chronicles, chronicles,
json_serialization, json_serialization,
nimcrypto/utils as ncrutils,
# Standard library # Standard library
hashes hashes
@ -349,16 +350,16 @@ func shortLog*(x: BlsValue): string =
# The prefix must be short # The prefix must be short
# due to the mechanics of the `shortLog` function. # due to the mechanics of the `shortLog` function.
if x.kind == Real: if x.kind == Real:
x.blsValue.exportRaw().toOpenArray(0, 3).toHex() byteutils.toHex(x.blsValue.exportRaw().toOpenArray(0, 3))
else: else:
"r:" & x.blob.toOpenArray(0, 3).toHex() "r:" & byteutils.toHex(x.blob.toOpenArray(0, 3))
func shortLog*(x: ValidatorPrivKey): string = func shortLog*(x: ValidatorPrivKey): string =
## Logging for raw unwrapped BLS types ## Logging for raw unwrapped BLS types
"<private key>" "<private key>"
func shortLog*(x: TrustedSig): string = func shortLog*(x: TrustedSig): string =
x.data.toOpenArray(0, 3).toHex() byteutils.toHex(x.data.toOpenArray(0, 3))
# Initialization # Initialization
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
@ -387,4 +388,4 @@ func init*(T: typedesc[ValidatorSig], data: array[RawSigSize, byte]): T {.noInit
v[] v[]
proc burnMem*(key: var ValidatorPrivKey) = proc burnMem*(key: var ValidatorPrivKey) =
key = default(ValidatorPrivKey) ncrutils.burnMem(addr key, sizeof(ValidatorPrivKey))