Skip to content

Commit

Permalink
Merge 7325b10 into 0c37d3a
Browse files Browse the repository at this point in the history
  • Loading branch information
hdevalence authored Feb 24, 2023
2 parents 0c37d3a + 7325b10 commit ad91ae2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .changelog/unreleased/bug-fixes/1272-ed25519-debug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- `[tendermint]` Restore hex-formatting in debug output of Ed25519 keys.
([#1272](https://github.com/informalsystems/tendermint-rs/pull/1272))
17 changes: 16 additions & 1 deletion tendermint/src/crypto/ed25519/verification_key.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
use crate::Error;

#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct VerificationKey([u8; 32]);

impl core::fmt::Display for VerificationKey {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
for byte in &self.0 {
write!(f, "{byte:02x}")?;
}
Ok(())
}
}

impl core::fmt::Debug for VerificationKey {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
<Self as core::fmt::Display>::fmt(self, f)
}
}

impl VerificationKey {
#[allow(dead_code)]
pub(super) fn new(bytes: [u8; 32]) -> Self {
Expand Down

0 comments on commit ad91ae2

Please sign in to comment.