Skip to content

Commit

Permalink
fix: ⚡ Added latest starknet-types-core release to support Starkhash …
Browse files Browse the repository at this point in the history
…trait + block number as Id new impl (#23)
  • Loading branch information
antiyro authored Apr 1, 2024
1 parent 34e7d77 commit 83b2cab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ serde = { version = "1.0.195", default-features = false, features = [
"derive",
"alloc",
] }
starknet-types-core = { version = "0.0.11", default-features = false, features = [
starknet-types-core = { git = "https://github.com/starknet-io/types-rs", branch = "main", default-features = false, features = [
"hash",
"parity-scale-codec",
] }
Expand Down
6 changes: 6 additions & 0 deletions src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ pub trait Id: hash::Hash + PartialEq + Eq + PartialOrd + Ord + Debug + Copy + De
#[derive(Hash, PartialEq, Eq, PartialOrd, Ord, Debug, Clone, Copy, Default)]
pub struct BasicId(u64);

impl BasicId {
pub fn new(id: u64) -> Self {
BasicId(id)
}
}

impl Id for BasicId {
fn to_bytes(&self) -> Vec<u8> {
self.0.to_be_bytes().to_vec()
Expand Down

0 comments on commit 83b2cab

Please sign in to comment.