From e5a76b004751cc2040a9fd8add0f606293d31067 Mon Sep 17 00:00:00 2001 From: Mamy Ratsimbazafy Date: Sun, 26 Jul 2020 10:27:11 +0200 Subject: [PATCH] Stopgap don't print private key in shortlog (#1372) --- beacon_chain/spec/crypto.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/beacon_chain/spec/crypto.nim b/beacon_chain/spec/crypto.nim index 021e4246f..be6f627d0 100644 --- a/beacon_chain/spec/crypto.nim +++ b/beacon_chain/spec/crypto.nim @@ -49,7 +49,7 @@ type Real OpaqueBlob - BlsValue*[N: static int, T] = object + BlsValue*[N: static int, T: blscurve.PublicKey or blscurve.Signature] = object # TODO This is a temporary type needed until we sort out the # issues with invalid BLS values appearing in the SSZ test suites. case kind*: BlsValueType @@ -195,6 +195,7 @@ func `$`*(x: BlsValue): string = "raw: " & x.blob.toHex() func toRaw*(x: ValidatorPrivKey): array[RawPrivKeySize, byte] = + # TODO: distinct type - see https://github.com/status-im/nim-blscurve/pull/67 SecretKey(x).exportRaw() func toRaw*(x: BlsValue): auto = @@ -311,7 +312,7 @@ func shortLog*(x: BlsValue): string = func shortLog*(x: ValidatorPrivKey): string = ## Logging for raw unwrapped BLS types - x.toRaw()[0..3].toHex() + "" func shortLog*(x: TrustedSig): string = x.data[0..3].toHex()