mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
refactor: remove #[reth_codec] and #[derive_arbitrary] macros (#10263)
This commit is contained in:
@@ -4,14 +4,15 @@ use crate::Compact;
|
||||
use alloy_eips::eip7702::{Authorization as AlloyAuthorization, SignedAuthorization};
|
||||
use alloy_primitives::{Address, ChainId, U256};
|
||||
use bytes::Buf;
|
||||
use reth_codecs_derive::reth_codec;
|
||||
use reth_codecs_derive::add_arbitrary_tests;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Authorization acts as bridge which simplifies Compact implementation for AlloyAuthorization.
|
||||
///
|
||||
/// Notice: Make sure this struct is 1:1 with `alloy_eips::eip7702::Authorization`
|
||||
#[reth_codec]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize, Compact)]
|
||||
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
|
||||
#[add_arbitrary_tests(compact)]
|
||||
struct Authorization {
|
||||
chain_id: ChainId,
|
||||
address: Address,
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
use crate::Compact;
|
||||
use alloy_genesis::GenesisAccount as AlloyGenesisAccount;
|
||||
use alloy_primitives::{Bytes, B256, U256};
|
||||
use reth_codecs_derive::reth_codec;
|
||||
use reth_codecs_derive::add_arbitrary_tests;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// GenesisAccount acts as bridge which simplifies Compact implementation for AlloyGenesisAccount.
|
||||
/// `GenesisAccount` acts as bridge which simplifies Compact implementation for
|
||||
/// `AlloyGenesisAccount`.
|
||||
///
|
||||
/// Notice: Make sure this struct is 1:1 with `alloy_genesis::GenesisAccount`
|
||||
#[reth_codec(no_arbitrary)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Compact)]
|
||||
struct GenesisAccountRef<'a> {
|
||||
/// The nonce of the account at genesis.
|
||||
nonce: Option<u64>,
|
||||
@@ -25,8 +25,9 @@ struct GenesisAccountRef<'a> {
|
||||
private_key: Option<&'a B256>,
|
||||
}
|
||||
|
||||
#[reth_codec]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize, Compact)]
|
||||
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
|
||||
#[add_arbitrary_tests(compact)]
|
||||
struct GenesisAccount {
|
||||
/// The nonce of the account at genesis.
|
||||
nonce: Option<u64>,
|
||||
@@ -40,14 +41,16 @@ struct GenesisAccount {
|
||||
private_key: Option<B256>,
|
||||
}
|
||||
|
||||
#[reth_codec]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize, Compact)]
|
||||
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
|
||||
#[add_arbitrary_tests(compact)]
|
||||
struct StorageEntries {
|
||||
entries: Vec<StorageEntry>,
|
||||
}
|
||||
|
||||
#[reth_codec]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize, Compact)]
|
||||
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
|
||||
#[add_arbitrary_tests(compact)]
|
||||
struct StorageEntry {
|
||||
key: B256,
|
||||
value: B256,
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
use crate::Compact;
|
||||
use alloy_eips::eip4895::Withdrawal as AlloyWithdrawal;
|
||||
use alloy_primitives::Address;
|
||||
use reth_codecs_derive::reth_codec;
|
||||
use reth_codecs_derive::add_arbitrary_tests;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Withdrawal acts as bridge which simplifies Compact implementation for AlloyWithdrawal.
|
||||
///
|
||||
/// Notice: Make sure this struct is 1:1 with `alloy_eips::eip4895::Withdrawal`
|
||||
#[reth_codec]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize, Compact)]
|
||||
#[cfg_attr(test, derive(arbitrary::Arbitrary))]
|
||||
#[add_arbitrary_tests(compact)]
|
||||
struct Withdrawal {
|
||||
/// Monotonically increasing identifier issued by consensus layer.
|
||||
index: u64,
|
||||
|
||||
Reference in New Issue
Block a user