Skip to content
This repository has been archived by the owner on Jun 11, 2022. It is now read-only.

Commit

Permalink
add a way to create Hash with from()
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenthz committed May 11, 2019
1 parent 5f057af commit 3a948cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions chain-impl-mockchain/src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ impl Hash {
}
}

impl From<[u8; 32]> for Hash {
fn from(a: [u8; 32]) -> Self {
Hash::from_bytes(a)
}
}

impl property::Serialize for Hash {
type Error = std::io::Error;
fn serialize<W: std::io::Write>(&self, mut writer: W) -> Result<(), Self::Error> {
Expand Down

0 comments on commit 3a948cd

Please sign in to comment.