-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(inspect): tracing,
Parameterize
trait
- Loading branch information
1 parent
13b012d
commit 8b65118
Showing
16 changed files
with
640 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use ethers::types::{Bloom, Bytes, H160, H256, H64}; | ||
|
||
use super::strings::encode_hex; | ||
|
||
pub trait ToLowerHex { | ||
fn to_lower_hex(&self) -> String; | ||
} | ||
|
||
impl ToLowerHex for H256 { | ||
fn to_lower_hex(&self) -> String { | ||
format!("{:#032x}", self) | ||
} | ||
} | ||
|
||
impl ToLowerHex for H160 { | ||
fn to_lower_hex(&self) -> String { | ||
format!("{:#020x}", self) | ||
} | ||
} | ||
|
||
impl ToLowerHex for H64 { | ||
fn to_lower_hex(&self) -> String { | ||
format!("{:#016x}", self) | ||
} | ||
} | ||
|
||
impl ToLowerHex for Bloom { | ||
fn to_lower_hex(&self) -> String { | ||
format!("{:#064x}", self) | ||
} | ||
} | ||
|
||
impl ToLowerHex for Bytes { | ||
fn to_lower_hex(&self) -> String { | ||
format!("{:#0x}", self) | ||
} | ||
} | ||
|
||
impl ToLowerHex for Vec<u8> { | ||
fn to_lower_hex(&self) -> String { | ||
encode_hex(self.to_vec()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.