Skip to content

Commit

Permalink
fixup! fix(basic_types): bincode deserialization for web3::Bytes
Browse files Browse the repository at this point in the history
Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
  • Loading branch information
haraldh committed May 15, 2024
1 parent d7d0ed4 commit 0074992
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions core/lib/basic_types/src/web3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,20 @@ impl<'a> Visitor<'a> for BytesVisitor {
{
self.visit_str(value.as_ref())
}

fn visit_bytes<E>(self, value: &[u8]) -> Result<Self::Value, E>
where
E: Error,
{
Ok(Bytes(value.to_vec()))
}

fn visit_byte_buf<E>(self, value: Vec<u8>) -> Result<Self::Value, E>
where
E: Error,
{
Ok(Bytes(value))
}
}

// `Log`: from `web3::types::log`
Expand Down

0 comments on commit 0074992

Please sign in to comment.