From 5e4855c8197cf9270410e224e24826bffe8feb8d Mon Sep 17 00:00:00 2001 From: kent-3 <100624004+kent-3@users.noreply.github.com> Date: Fri, 10 May 2024 14:10:50 -0400 Subject: [PATCH] change Debug notation for EncryptionUtils to print hex strings --- secretrs/src/utils/encryption.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/secretrs/src/utils/encryption.rs b/secretrs/src/utils/encryption.rs index 9cec443..a82e0d9 100644 --- a/secretrs/src/utils/encryption.rs +++ b/secretrs/src/utils/encryption.rs @@ -54,6 +54,7 @@ //! ```` use aes_siv::{siv::Aes128Siv, Key, KeyInit}; +use hex::ToHex; use hex_literal::hex; use nanorand::rand::Rng; use x25519_dalek::{PublicKey, StaticSecret}; @@ -88,10 +89,13 @@ use std::fmt; impl fmt::Debug for EncryptionUtils { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("EncryptionUtils") - .field("seed", &self.seed) + .field("seed", &self.seed.encode_hex::()) .field("privkey", &"[REDACTED]") - .field("pubkey", &self.pubkey) - .field("consensus_io_pubkey", &self.consensus_io_pubkey) + .field("pubkey", &self.pubkey.encode_hex::()) + .field( + "consensus_io_pubkey", + &self.consensus_io_pubkey.encode_hex::(), + ) .finish() } }