feat: Alloy migration (#4737)

Co-authored-by: Alessandro Mazza <121622391+alessandromazza98@users.noreply.github.com>
Co-authored-by: Supernovahs.eth <91280922+supernovahs@users.noreply.github.com>
Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>
This commit is contained in:
DaniPopes
2023-09-28 17:55:39 +02:00
committed by GitHub
parent 3ef0364e42
commit 5f9a917fb1
348 changed files with 3593 additions and 7066 deletions

View File

@ -1,10 +1,10 @@
//! Round-trip encoding fuzzing for the `eth-wire` crate.
use reth_rlp::{Decodable, Encodable};
use alloy_rlp::{Decodable, Encodable};
use serde::Serialize;
use std::fmt::Debug;
/// Creates a fuzz test for a type that should be [`Encodable`](reth_rlp::Encodable) and
/// [`Decodable`](reth_rlp::Decodable).
/// Creates a fuzz test for a type that should be [`Encodable`](alloy_rlp::Encodable) and
/// [`Decodable`](alloy_rlp::Decodable).
///
/// The test will create a random instance of the type, encode it, and then decode it.
fn roundtrip_encoding<T>(thing: T)
@ -48,6 +48,7 @@ macro_rules! fuzz_type_and_name {
#[cfg(any(test, feature = "bench"))]
pub mod fuzz_rlp {
use crate::roundtrip_encoding;
use alloy_rlp::{RlpDecodableWrapper, RlpEncodableWrapper};
use reth_codecs::derive_arbitrary;
use reth_eth_wire::{
BlockBodies, BlockHeaders, DisconnectReason, GetBlockBodies, GetBlockHeaders, GetNodeData,
@ -56,7 +57,6 @@ pub mod fuzz_rlp {
PooledTransactions, Receipts, Status, Transactions,
};
use reth_primitives::{BlockHashOrNumber, TransactionSigned};
use reth_rlp::{RlpDecodableWrapper, RlpEncodableWrapper};
use serde::{Deserialize, Serialize};
use test_fuzz::test_fuzz;