Fix cli signer (#8682)

* Update ethereum-types so `{:#x}` applies 0x prefix
This commit is contained in:
Andrew Jones
2018-05-23 10:27:45 +01:00
committed by GitHub
parent bd1e3fc606
commit db9397890e
3 changed files with 56 additions and 56 deletions

View File

@@ -55,7 +55,7 @@ macro_rules! impl_uint {
impl fmt::LowerHex for $name {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:#x}", self.0)
fmt::LowerHex::fmt(&self.0, f)
}
}
@@ -102,19 +102,19 @@ impl_uint!(U64, u64, 1);
impl serde::Serialize for U128 {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
serializer.serialize_str(&format!("0x{:x}", self.0))
serializer.serialize_str(&format!("{:#x}", self))
}
}
impl serde::Serialize for U256 {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
serializer.serialize_str(&format!("0x{:x}", self.0))
serializer.serialize_str(&format!("{:#x}", self))
}
}
impl serde::Serialize for U64 {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
serializer.serialize_str(&format!("0x{:x}", self.0))
serializer.serialize_str(&format!("{:#x}", self))
}
}