Skip to content

Commit

Permalink
[Feature] update Display implementation on BlockNumberOrTag (#1857)
Browse files Browse the repository at this point in the history
* remove number

* fix test
  • Loading branch information
programskillforverification authored Dec 28, 2024
1 parent cfcde06 commit 262089c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/eips/src/eip1898.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl FromStr for BlockNumberOrTag {
impl fmt::Display for BlockNumberOrTag {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
Self::Number(x) => write!(f, "number 0x{x:x}"),
Self::Number(x) => write!(f, "0x{x:x}"),
Self::Latest => f.pad("latest"),
Self::Finalized => f.pad("finalized"),
Self::Safe => f.pad("safe"),
Expand Down Expand Up @@ -996,7 +996,7 @@ mod tests {

let id = BlockId::number(100000);

assert_eq!(id.to_string(), "number 0x186a0");
assert_eq!(id.to_string(), "0x186a0");

let id = BlockId::latest();

Expand Down

0 comments on commit 262089c

Please sign in to comment.