From cf7e9352500c063c355c761b41c8bf5695948e3d Mon Sep 17 00:00:00 2001 From: Siavash Sameni Date: Thu, 26 Mar 2026 22:34:40 +0400 Subject: [PATCH] Display full 16-byte fingerprint (8 groups instead of 4) Was showing xxxx:xxxx:xxxx:xxxx (8 bytes) but from_hex expected 16 bytes, causing parse failure. Now displays all 16 bytes: xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx Users need to re-init to see the full fingerprint. Co-Authored-By: Claude Opus 4.6 (1M context) --- warzone/crates/warzone-protocol/src/identity.rs | 6 +++--- warzone/crates/warzone-protocol/src/types.rs | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/warzone/crates/warzone-protocol/src/identity.rs b/warzone/crates/warzone-protocol/src/identity.rs index a15c9cf..e7e2f2e 100644 --- a/warzone/crates/warzone-protocol/src/identity.rs +++ b/warzone/crates/warzone-protocol/src/identity.rs @@ -175,8 +175,8 @@ mod tests { let id = seed.derive_identity(); let pub_id = id.public_identity(); let fp_str = pub_id.fingerprint.to_string(); - // Format: xxxx:xxxx:xxxx:xxxx - assert_eq!(fp_str.len(), 19); - assert_eq!(fp_str.chars().filter(|c| *c == ':').count(), 3); + // Format: xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx + assert_eq!(fp_str.len(), 39); + assert_eq!(fp_str.chars().filter(|c| *c == ':').count(), 7); } } diff --git a/warzone/crates/warzone-protocol/src/types.rs b/warzone/crates/warzone-protocol/src/types.rs index de4e375..2891f0c 100644 --- a/warzone/crates/warzone-protocol/src/types.rs +++ b/warzone/crates/warzone-protocol/src/types.rs @@ -10,11 +10,15 @@ impl fmt::Display for Fingerprint { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, - "{:04x}:{:04x}:{:04x}:{:04x}", + "{:04x}:{:04x}:{:04x}:{:04x}:{:04x}:{:04x}:{:04x}:{:04x}", u16::from_be_bytes([self.0[0], self.0[1]]), u16::from_be_bytes([self.0[2], self.0[3]]), u16::from_be_bytes([self.0[4], self.0[5]]), u16::from_be_bytes([self.0[6], self.0[7]]), + u16::from_be_bytes([self.0[8], self.0[9]]), + u16::from_be_bytes([self.0[10], self.0[11]]), + u16::from_be_bytes([self.0[12], self.0[13]]), + u16::from_be_bytes([self.0[14], self.0[15]]), ) } }