Skip to content

Commit

Permalink
added block number support for basic id
Browse files Browse the repository at this point in the history
  • Loading branch information
antiyro committed Mar 1, 2024
1 parent a8e205d commit abfc3b3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ impl Id for BasicId {
}
}

impl From<u64> for BasicId {
fn from(id: u64) -> Self {
BasicId(id)
}
}

/// A builder for basic IDs.
pub struct BasicIdBuilder {
last_id: u64,
Expand All @@ -46,4 +40,8 @@ impl BasicIdBuilder {
self.last_id = self.last_id.checked_add(1).expect("Id overflow");
id
}

pub fn block_number(id: u64) -> BasicId {
BasicId(id)
}
}

0 comments on commit abfc3b3

Please sign in to comment.