[ethkey] Unify debug/display for Address/Public/Secret (#8076)
* unify debug in ethkey * fix tests
This commit is contained in:
committed by
Marek Kotewicz
parent
e8106016c8
commit
29d7a0e3c9
@@ -34,6 +34,12 @@ impl ToHex for Secret {
|
||||
}
|
||||
|
||||
impl fmt::Debug for Secret {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(fmt, "{:?}", self.inner)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Secret {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(fmt, "Secret: 0x{:x}{:x}..{:x}{:x}", self.inner[0], self.inner[1], self.inner[30], self.inner[31])
|
||||
}
|
||||
@@ -168,7 +174,7 @@ impl Secret {
|
||||
if self.is_zero() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
||||
match pow {
|
||||
0 => *self = key::ONE_KEY.into(),
|
||||
1 => (),
|
||||
|
||||
Reference in New Issue
Block a user