alloy-rs / core

High-performance, well-tested & documented core libraries for Ethereum, in Rust
https://alloy.rs
Apache License 2.0
763 stars 135 forks source link

Fix Log serde for non self describing protocols #639

Closed kpp closed 3 months ago

kpp commented 3 months ago

Log flattens data for serde, which is an issue for a non self describing protocols as bcs and bincode. Without this fix test will fail with:

  1. bcs:
---- log::tests::test_bcs_encode_decode stdout ----
thread 'log::tests::test_bcs_encode_decode' panicked at crates/primitives/src/log.rs:248:51:
called `Result::unwrap()` on an `Err` value: NotSupported("deserialize_any")
  1. bincode:
---- log::tests::test_bincode_encode_decode stdout ----
thread 'log::tests::test_bincode_encode_decode' panicked at crates/primitives/src/log.rs:227:52:
called `Result::unwrap()` on an `Err` value: SequenceMustHaveLength

Code affected: reth_primitives::Receipt.