Add AsRef<[u8]> method for Blob (#361)

This commit is contained in:
ethDreamer 2023-09-15 09:51:22 -05:00 committed by GitHub
parent 2f4af2fd8f
commit fbef59a3f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -260,6 +260,12 @@ impl Blob {
}
}
impl AsRef<[u8]> for Blob {
fn as_ref(&self) -> &[u8] {
&self.bytes
}
}
impl Bytes32 {
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error> {
if bytes.len() != 32 {