Skip to content

Commit

Permalink
add impl Hash for Anchor (#221)
Browse files Browse the repository at this point in the history
add impl Hash for Anchor
  • Loading branch information
bazzilic authored Sep 28, 2023
1 parent 68f40fe commit c4f543c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions taiga_halo2/src/merkle_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ impl From<Node> for Anchor {
}
}

impl Hash for Anchor {
fn hash<H: Hasher>(&self, state: &mut H) {
self.0.to_repr().hash(state);
}
}

#[derive(Clone, Debug, PartialEq, Eq, Copy, Hash, Default)]
#[cfg_attr(feature = "borsh", derive(BorshSerialize, BorshDeserialize))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
Expand Down

0 comments on commit c4f543c

Please sign in to comment.