diff --git a/Cargo.toml b/Cargo.toml index 2df5b5a..321144b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "committable" -version = "0.2.3" +version = "0.2.4" edition = "2021" rust-version = "1.65.0" authors = ["Espresso Systems "] diff --git a/src/lib.rs b/src/lib.rs index 2d1401c..075b5f1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -124,7 +124,7 @@ pub trait CommitmentBounds: } #[cfg(not(feature = "serde"))] -trait CommitmentBounds: CommitmentBoundsSerdeless {} +pub trait CommitmentBounds: CommitmentBoundsSerdeless {} impl CommitmentBounds for Commitment where T: Committable + 'static {} @@ -132,6 +132,10 @@ impl Commitment { pub fn into_bits(self) -> BitVec { BitVec::try_from(self.0.to_vec()).unwrap() } + + pub fn from_raw(bytes: [u8; 32]) -> Self { + Self(bytes, PhantomData) + } } // clippy pacification: `non_canonical_clone_impl` aka `incorrect_clone_impl_on_copy_type`