diff --git a/crates/consensus/src/header.rs b/crates/consensus/src/header.rs index aec7820a163..dffc42bbe8c 100644 --- a/crates/consensus/src/header.rs +++ b/crates/consensus/src/header.rs @@ -21,7 +21,7 @@ pub const EMPTY_ROOT_HASH: B256 = b256!("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"); /// Ethereum Block header -#[derive(Debug, Clone, PartialEq, Eq, Hash)] +#[derive(Clone, Debug, PartialEq, Eq, Hash)] pub struct Header { /// The Keccak 256-bit hash of the parent /// block’s header, in its entirety; formally Hp. diff --git a/crates/consensus/src/receipt/any.rs b/crates/consensus/src/receipt/any.rs index 35482caab59..80b0e5d9e69 100644 --- a/crates/consensus/src/receipt/any.rs +++ b/crates/consensus/src/receipt/any.rs @@ -13,7 +13,7 @@ use alloy_rlp::{Decodable, Encodable}; /// Transaction receipt payloads are specified in their respective EIPs. /// /// [EIP-2718]: https://eips.ethereum.org/EIPS/eip-2718 -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct AnyReceiptEnvelope { /// The receipt envelope. diff --git a/crates/consensus/src/receipt/envelope.rs b/crates/consensus/src/receipt/envelope.rs index 6890f5a9433..f88f9649aff 100644 --- a/crates/consensus/src/receipt/envelope.rs +++ b/crates/consensus/src/receipt/envelope.rs @@ -13,7 +13,7 @@ use alloy_rlp::{length_of_length, BufMut, Decodable, Encodable}; /// Transaction receipt payloads are specified in their respective EIPs. /// /// [EIP-2718]: https://eips.ethereum.org/EIPS/eip-2718 -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(tag = "type"))] #[non_exhaustive] diff --git a/crates/consensus/src/receipt/receipts.rs b/crates/consensus/src/receipt/receipts.rs index 3acd06e5a5c..2d2cb926ae8 100644 --- a/crates/consensus/src/receipt/receipts.rs +++ b/crates/consensus/src/receipt/receipts.rs @@ -6,7 +6,7 @@ use alloy_rlp::{length_of_length, BufMut, Decodable, Encodable}; use alloc::vec::Vec; /// Receipt containing result of transaction execution. -#[derive(Clone, Debug, PartialEq, Eq, Default)] +#[derive(Clone, Debug, Default, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] @@ -61,7 +61,7 @@ impl TxReceipt for Receipt { /// receipt, similar to [`Sealed`]. /// /// [`Sealed`]: crate::sealed::Sealed -#[derive(Clone, Debug, PartialEq, Eq, Default)] +#[derive(Clone, Debug, Default, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub struct ReceiptWithBloom { diff --git a/crates/consensus/src/sealed.rs b/crates/consensus/src/sealed.rs index 86d5c85a3b9..9b7d0efdf61 100644 --- a/crates/consensus/src/sealed.rs +++ b/crates/consensus/src/sealed.rs @@ -1,6 +1,6 @@ use alloy_primitives::B256; -#[derive(Debug, Copy, Clone, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] /// A consensus hashable item, with its memoized hash. /// /// We do not implement diff --git a/crates/consensus/src/transaction/eip1559.rs b/crates/consensus/src/transaction/eip1559.rs index e96be9d1d64..8ac0321b3a7 100644 --- a/crates/consensus/src/transaction/eip1559.rs +++ b/crates/consensus/src/transaction/eip1559.rs @@ -8,7 +8,7 @@ use core::mem; use alloc::vec::Vec; /// A transaction with a priority fee ([EIP-1559](https://eips.ethereum.org/EIPS/eip-1559)). -#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub struct TxEip1559 { diff --git a/crates/consensus/src/transaction/eip2930.rs b/crates/consensus/src/transaction/eip2930.rs index 6030366265b..7dec4cc33c2 100644 --- a/crates/consensus/src/transaction/eip2930.rs +++ b/crates/consensus/src/transaction/eip2930.rs @@ -8,7 +8,7 @@ use core::mem; use alloc::vec::Vec; /// Transaction with an [`AccessList`] ([EIP-2930](https://eips.ethereum.org/EIPS/eip-2930)). -#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub struct TxEip2930 { diff --git a/crates/consensus/src/transaction/eip4844.rs b/crates/consensus/src/transaction/eip4844.rs index 4f259e6c3a5..9a0744780c7 100644 --- a/crates/consensus/src/transaction/eip4844.rs +++ b/crates/consensus/src/transaction/eip4844.rs @@ -63,7 +63,7 @@ pub enum BlobTransactionValidationError { /// It can either be a standalone transaction, mainly seen when retrieving historical transactions, /// or a transaction with a sidecar, which is used when submitting a transaction to the network and /// when receiving and sending transactions during the gossip stage. -#[derive(Debug, Clone, PartialEq, Eq, Hash)] +#[derive(Clone, Debug, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize))] #[cfg_attr(feature = "serde", serde(untagged))] pub enum TxEip4844Variant { @@ -321,7 +321,7 @@ impl SignableTransaction for TxEip4844Variant { /// [EIP-4844 Blob Transaction](https://eips.ethereum.org/EIPS/eip-4844#blob-transaction) /// /// A transaction with blob hashes and max blob fee. It does not have the Blob sidecar. -#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub struct TxEip4844 { @@ -762,7 +762,7 @@ impl Decodable for TxEip4844 { /// This is defined in [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844#networking) as an element /// of a `PooledTransactions` response, and is also used as the format for sending raw transactions /// through the network (eth_sendRawTransaction/eth_sendTransaction). -#[derive(Debug, Default, Clone, PartialEq, Eq, Hash)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub struct TxEip4844WithSidecar { @@ -960,7 +960,7 @@ impl Transaction for TxEip4844WithSidecar { } /// This represents a set of blobs, and its corresponding commitments and proofs. -#[derive(Debug, Default, Clone, PartialEq, Eq, Hash)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] #[repr(C)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct BlobTransactionSidecar { diff --git a/crates/consensus/src/transaction/eip4844/builder.rs b/crates/consensus/src/transaction/eip4844/builder.rs index 5b21aedf63c..51df9a79c04 100644 --- a/crates/consensus/src/transaction/eip4844/builder.rs +++ b/crates/consensus/src/transaction/eip4844/builder.rs @@ -13,7 +13,7 @@ use core::cmp; /// A builder for creating a [`BlobTransactionSidecar`]. /// /// [`BlobTransactionSidecar`]: crate::BlobTransactionSidecar -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct PartialSidecar { /// The blobs in the sidecar. blobs: Vec, @@ -178,7 +178,7 @@ pub trait SidecarCoder { /// - The first byte of every 32-byte word. /// - The right padding on the header word containing the data length. /// - Any right padding on the last word for each piece of data. -#[derive(Debug, Copy, Clone, Default)] +#[derive(Clone, Copy, Debug, Default)] #[non_exhaustive] pub struct SimpleCoder; @@ -255,7 +255,7 @@ impl SidecarCoder for SimpleCoder { /// until all data is ready. /// /// [`BlobTransactionSidecar`]: crate::BlobTransactionSidecar -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct SidecarBuilder { /// The blob array we will code data into inner: PartialSidecar, diff --git a/crates/consensus/src/transaction/eip4844/utils.rs b/crates/consensus/src/transaction/eip4844/utils.rs index 602a581ed5d..3660915a6c4 100644 --- a/crates/consensus/src/transaction/eip4844/utils.rs +++ b/crates/consensus/src/transaction/eip4844/utils.rs @@ -25,7 +25,7 @@ pub const fn minimum_fe(data: &[u8]) -> usize { } /// A wrapper for a slice of bytes that is a whole, valid field element. -#[derive(Debug, Copy, Clone)] +#[derive(Clone, Copy, Debug)] pub struct WholeFe<'a>(&'a [u8]); impl<'a> WholeFe<'a> { diff --git a/crates/consensus/src/transaction/envelope.rs b/crates/consensus/src/transaction/envelope.rs index 2b00c970499..2e6dc1e7a54 100644 --- a/crates/consensus/src/transaction/envelope.rs +++ b/crates/consensus/src/transaction/envelope.rs @@ -13,7 +13,7 @@ use core::mem; /// [2930]: https://eips.ethereum.org/EIPS/eip-2930 /// [4844]: https://eips.ethereum.org/EIPS/eip-4844 #[repr(u8)] -#[derive(Debug, Copy, Clone, Eq, PartialEq, PartialOrd, Ord, Hash)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum TxType { /// Legacy transaction type. Legacy = 0, @@ -61,7 +61,7 @@ impl TryFrom for TxType { /// flag. /// /// [EIP-2718]: https://eips.ethereum.org/EIPS/eip-2718 -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(tag = "type"))] #[non_exhaustive] diff --git a/crates/consensus/src/transaction/legacy.rs b/crates/consensus/src/transaction/legacy.rs index 52eb666c0f3..602b87b0d3c 100644 --- a/crates/consensus/src/transaction/legacy.rs +++ b/crates/consensus/src/transaction/legacy.rs @@ -7,7 +7,7 @@ use core::mem; use alloc::vec::Vec; /// Legacy transaction. -#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub struct TxLegacy { diff --git a/crates/consensus/src/transaction/typed.rs b/crates/consensus/src/transaction/typed.rs index 441b024065a..491eb32afc1 100644 --- a/crates/consensus/src/transaction/typed.rs +++ b/crates/consensus/src/transaction/typed.rs @@ -8,7 +8,7 @@ use alloy_primitives::TxKind; /// 2. EIP2930 (state access lists) [`TxEip2930`] /// 3. EIP1559 [`TxEip1559`] /// 4. EIP4844 [`TxEip4844Variant`] -#[derive(Debug, Clone, PartialEq, Eq, Hash)] +#[derive(Clone, Debug, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(tag = "type"))] pub enum TypedTransaction { diff --git a/crates/contract/src/interface.rs b/crates/contract/src/interface.rs index 591080ef170..58859958233 100644 --- a/crates/contract/src/interface.rs +++ b/crates/contract/src/interface.rs @@ -5,7 +5,7 @@ use alloy_primitives::{Address, Selector}; use std::collections::{BTreeMap, HashMap}; /// A smart contract interface. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct Interface { abi: JsonAbi, functions: HashMap, diff --git a/crates/eip7547/src/summary.rs b/crates/eip7547/src/summary.rs index 3fb2448f23d..f444d4c693f 100644 --- a/crates/eip7547/src/summary.rs +++ b/crates/eip7547/src/summary.rs @@ -77,7 +77,7 @@ impl Serialize for InclusionListStatusV1 { /// /// - `address` : `DATA`, 20 Bytes /// - `nonce` : `QUANTITY`, 64 Bits -#[derive(Copy, Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct InclusionListSummaryEntryV1 { /// The address of the inclusion list entry. @@ -104,7 +104,7 @@ impl fmt::Display for InclusionListSummaryEntryV1 { /// - `proposer_index`: `QUANTITY`, 64 Bits /// - `parent_hash`: `DATA`, 32 Bytes /// - `summary`: `Array of InclusionListSummaryEntryV1`, Array of entries that must be satisfied. -#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct InclusionListSummaryV1 { /// The slot of the inclusion list summary. diff --git a/crates/eips/src/eip1559/basefee.rs b/crates/eips/src/eip1559/basefee.rs index 548db786eb7..35864578479 100644 --- a/crates/eips/src/eip1559/basefee.rs +++ b/crates/eips/src/eip1559/basefee.rs @@ -4,7 +4,7 @@ use crate::{ }; /// BaseFeeParams contains the config parameters that control block base fee computation -#[derive(Debug, Copy, Clone, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct BaseFeeParams { /// The base_fee_max_change_denominator from EIP-1559 diff --git a/crates/eips/src/eip2718.rs b/crates/eips/src/eip2718.rs index 122ffa778e5..2efd9822a8e 100644 --- a/crates/eips/src/eip2718.rs +++ b/crates/eips/src/eip2718.rs @@ -18,7 +18,7 @@ const TX_TYPE_BYTE_MAX: u8 = 0x7f; /// [EIP-2718] decoding errors. /// /// [EIP-2718]: https://eips.ethereum.org/EIPS/eip-2718 -#[derive(Debug, Copy, Clone)] +#[derive(Clone, Copy, Debug)] pub enum Eip2718Error { /// Rlp error from [`alloy_rlp`]. RlpError(alloy_rlp::Error), diff --git a/crates/eips/src/eip2930.rs b/crates/eips/src/eip2930.rs index ec655092b49..2570df132bb 100644 --- a/crates/eips/src/eip2930.rs +++ b/crates/eips/src/eip2930.rs @@ -13,7 +13,7 @@ use core::mem; /// A list of addresses and storage keys that the transaction plans to access. /// Accesses outside the list are possible, but become more expensive. -#[derive(Clone, Debug, PartialEq, Eq, Hash, Default, RlpDecodable, RlpEncodable)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, RlpDecodable, RlpEncodable)] #[cfg_attr( any(test, feature = "arbitrary"), derive(proptest_derive::Arbitrary, arbitrary::Arbitrary) @@ -42,7 +42,7 @@ impl AccessListItem { } /// AccessList as defined in EIP-2930 -#[derive(Clone, Debug, PartialEq, Eq, Hash, Default, RlpDecodableWrapper, RlpEncodableWrapper)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, RlpDecodableWrapper, RlpEncodableWrapper)] #[cfg_attr( any(test, feature = "arbitrary"), derive(proptest_derive::Arbitrary, arbitrary::Arbitrary) @@ -111,7 +111,7 @@ impl AccessList { } /// Access list with gas used appended. -#[derive(Clone, Debug, PartialEq, Eq, Default)] +#[derive(Clone, Debug, Default, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub struct AccessListWithGasUsed { diff --git a/crates/eips/src/eip4844/env_settings.rs b/crates/eips/src/eip4844/env_settings.rs index 27ace29dbae..2c16a2cc41e 100644 --- a/crates/eips/src/eip4844/env_settings.rs +++ b/crates/eips/src/eip4844/env_settings.rs @@ -4,7 +4,7 @@ use c_kzg::KzgSettings; use core::hash::{Hash, Hasher}; /// KZG settings. -#[derive(Debug, Clone, Default, Eq)] +#[derive(Clone, Debug, Default, Eq)] pub enum EnvKzgSettings { /// Default mainnet trusted setup. #[default] diff --git a/crates/eips/src/eip4844/trusted_setup_points.rs b/crates/eips/src/eip4844/trusted_setup_points.rs index 2f8db67a84e..b2acb55e2c1 100644 --- a/crates/eips/src/eip4844/trusted_setup_points.rs +++ b/crates/eips/src/eip4844/trusted_setup_points.rs @@ -14,7 +14,7 @@ pub const NUM_G1_POINTS: usize = 4096; pub const NUM_G2_POINTS: usize = 65; /// A newtype over list of G1 point from kzg trusted setup. -#[derive(Debug, Clone, PartialEq, AsRef, AsMut, Deref, DerefMut)] +#[derive(Clone, Debug, PartialEq, AsRef, AsMut, Deref, DerefMut)] #[repr(transparent)] pub struct G1Points(pub [[u8; BYTES_PER_G1_POINT]; NUM_G1_POINTS]); @@ -25,7 +25,7 @@ impl Default for G1Points { } /// A newtype over list of G2 point from kzg trusted setup. -#[derive(Debug, Clone, Eq, PartialEq, AsRef, AsMut, Deref, DerefMut)] +#[derive(Clone, Debug, PartialEq, Eq, AsRef, AsMut, Deref, DerefMut)] #[repr(transparent)] pub struct G2Points(pub [[u8; BYTES_PER_G2_POINT]; NUM_G2_POINTS]); @@ -100,7 +100,7 @@ pub fn parse_kzg_trusted_setup( } /// KZG custom Error types -#[derive(Debug, Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub enum KzgErrors { /// Failed to get current directory. FailedCurrentDirectory, diff --git a/crates/eips/src/eip4895.rs b/crates/eips/src/eip4895.rs index d369c687d89..8c82887ab19 100644 --- a/crates/eips/src/eip4895.rs +++ b/crates/eips/src/eip4895.rs @@ -9,7 +9,7 @@ use alloy_rlp::{RlpDecodable, RlpEncodable}; pub const GWEI_TO_WEI: u64 = 1_000_000_000; /// Withdrawal represents a validator withdrawal from the consensus layer. -#[derive(Debug, Copy, Clone, PartialEq, Eq, Default, Hash, RlpEncodable, RlpDecodable)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, RlpEncodable, RlpDecodable)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "ssz", derive(ssz_derive::Encode, ssz_derive::Decode))] pub struct Withdrawal { diff --git a/crates/genesis/src/lib.rs b/crates/genesis/src/lib.rs index 745f6b8f873..ccad1c670b7 100644 --- a/crates/genesis/src/lib.rs +++ b/crates/genesis/src/lib.rs @@ -31,7 +31,7 @@ use alloy_serde::{ use serde::{Deserialize, Serialize}; /// The genesis block specification. -#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase", default)] pub struct Genesis { /// The fork configuration for this network. @@ -211,7 +211,7 @@ impl Genesis { } /// An account in the state of the genesis block. -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Eq)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub struct GenesisAccount { /// The nonce of the account at genesis. @@ -271,7 +271,7 @@ impl GenesisAccount { /// See [geth's `ChainConfig` /// struct](https://github.com/ethereum/go-ethereum/blob/64dccf7aa411c5c7cd36090c3d9b9892945ae813/params/config.go#L349) /// for the source of each field. -#[derive(Clone, Debug, Deserialize, Serialize, Default, PartialEq, Eq)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(default, rename_all = "camelCase")] pub struct ChainConfig { /// The network's chain ID. @@ -522,11 +522,11 @@ const fn mainnet_id() -> u64 { } /// Empty consensus configuration for proof-of-work networks. -#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, Copy)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct EthashConfig {} /// Consensus configuration for Clique. -#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, Copy)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct CliqueConfig { /// Number of seconds between blocks to enforce. #[serde(default, skip_serializing_if = "Option::is_none")] diff --git a/crates/json-rpc/src/common.rs b/crates/json-rpc/src/common.rs index e8857a152d5..724c47b5b62 100644 --- a/crates/json-rpc/src/common.rs +++ b/crates/json-rpc/src/common.rs @@ -22,7 +22,7 @@ use std::fmt::Display; /// [`BTreeSet`]: std::collections::BTreeSet /// [`HashMap`]: std::collections::HashMap /// [`HashSet`]: std::collections::HashSet -#[derive(Debug, Clone, PartialEq, Eq, Hash)] +#[derive(Clone, Debug, PartialEq, Eq, Hash)] pub enum Id { /// A number. Number(u64), @@ -161,7 +161,7 @@ impl Id { mod test { use super::*; - #[derive(Deserialize, Serialize, Debug, PartialEq)] + #[derive(Debug, PartialEq, Serialize, Deserialize)] struct TestCase { id: Id, } diff --git a/crates/json-rpc/src/notification.rs b/crates/json-rpc/src/notification.rs index 4a510929890..4b2b61e110f 100644 --- a/crates/json-rpc/src/notification.rs +++ b/crates/json-rpc/src/notification.rs @@ -7,7 +7,7 @@ use serde::{ /// An ethereum-style notification, not to be confused with a JSON-RPC /// notification. -#[derive(Debug, Clone, Deserialize, Serialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct EthNotification> { /// The subscription ID. pub subscription: U256, @@ -18,7 +18,7 @@ pub struct EthNotification> { /// An item received over an Ethereum pubsub transport. Ethereum pubsub uses a /// non-standard JSON-RPC notification format. An item received over a pubsub /// transport may be a JSON-RPC response or an Ethereum-style notification. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub enum PubSubItem { /// A [`Response`] to a JSON-RPC request. Response(Response), diff --git a/crates/json-rpc/src/packet.rs b/crates/json-rpc/src/packet.rs index 2c1721166d2..c9b241794fa 100644 --- a/crates/json-rpc/src/packet.rs +++ b/crates/json-rpc/src/packet.rs @@ -8,7 +8,7 @@ use std::{collections::HashSet, fmt, marker::PhantomData}; /// A [`RequestPacket`] is a [`SerializedRequest`] or a batch of serialized /// request. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub enum RequestPacket { /// A single request. Single(SerializedRequest), @@ -105,7 +105,7 @@ impl RequestPacket { } /// A [`ResponsePacket`] is a [`Response`] or a batch of responses. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub enum ResponsePacket, ErrData = Box> { /// A single response. Single(Response), @@ -278,7 +278,7 @@ impl ResponsePacket { } /// An Iterator over the [ErrorPayload]s in a [ResponsePacket]. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] enum ResponsePacketErrorsIter<'a, Payload, ErrData> { Single(Option<&'a Response>), Batch(std::slice::Iter<'a, Response>), diff --git a/crates/json-rpc/src/request.rs b/crates/json-rpc/src/request.rs index d7e960da217..8f5ffea2e72 100644 --- a/crates/json-rpc/src/request.rs +++ b/crates/json-rpc/src/request.rs @@ -5,7 +5,7 @@ use serde_json::value::RawValue; use std::borrow::Cow; /// `RequestMeta` contains the [`Id`] and method name of a request. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct RequestMeta { /// The method name. pub method: Cow<'static, str>, @@ -42,7 +42,7 @@ impl RequestMeta { /// ### Note /// /// The value of `method` should be known at compile time. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct Request { /// The request metadata (ID and method). pub meta: RequestMeta, @@ -166,7 +166,7 @@ where /// This struct is used to represent a request that has been serialized, but /// not yet sent. It is used by RPC clients to build batch requests and manage /// in-flight requests. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct SerializedRequest { meta: RequestMeta, request: Box, diff --git a/crates/json-rpc/src/response/error.rs b/crates/json-rpc/src/response/error.rs index c03e3595a04..371fe4e97c9 100644 --- a/crates/json-rpc/src/response/error.rs +++ b/crates/json-rpc/src/response/error.rs @@ -10,7 +10,7 @@ use std::{borrow::Borrow, fmt, marker::PhantomData}; /// This response indicates that the server received and handled the request, /// but that there was an error in the processing of it. The error should be /// included in the `message` field of the response payload. -#[derive(Debug, Clone, Serialize)] +#[derive(Clone, Debug, Serialize)] pub struct ErrorPayload> { /// The error code. pub code: i64, @@ -196,7 +196,7 @@ mod test { #[test] fn smooth_deser() { - #[derive(Debug, serde::Deserialize, PartialEq)] + #[derive(Debug, PartialEq, serde::Deserialize)] struct TestData { a: u32, b: Option, diff --git a/crates/json-rpc/src/response/mod.rs b/crates/json-rpc/src/response/mod.rs index c417ce976e8..4eac4f9b561 100644 --- a/crates/json-rpc/src/response/mod.rs +++ b/crates/json-rpc/src/response/mod.rs @@ -19,7 +19,7 @@ pub use payload::{BorrowedResponsePayload, ResponsePayload}; /// either a successful result or an error. The `id` field is used to match /// the response to the request that it is responding to, and should be /// mirrored from the response. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct Response, ErrData = Box> { /// The ID of the request that this response is responding to. pub id: Id, diff --git a/crates/json-rpc/src/response/payload.rs b/crates/json-rpc/src/response/payload.rs index d4269fb4d94..48636be1b58 100644 --- a/crates/json-rpc/src/response/payload.rs +++ b/crates/json-rpc/src/response/payload.rs @@ -15,7 +15,7 @@ use std::borrow::Borrow; /// deserialized as part of the [`Response`] type. /// /// [`Response`]: crate::Response -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub enum ResponsePayload, ErrData = Box> { /// A successful response payload. Success(Payload), diff --git a/crates/network/src/any/mod.rs b/crates/network/src/any/mod.rs index 488988cd48a..981ef6fec44 100644 --- a/crates/network/src/any/mod.rs +++ b/crates/network/src/any/mod.rs @@ -10,7 +10,7 @@ mod builder; /// Essentially just returns the regular Ethereum types + a catch all field. /// This [`Network`] should be used only when the network is not known at /// compile time. -#[derive(Debug, Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub struct AnyNetwork { _private: (), } diff --git a/crates/network/src/ethereum/mod.rs b/crates/network/src/ethereum/mod.rs index c6dd57d6e43..25824769322 100644 --- a/crates/network/src/ethereum/mod.rs +++ b/crates/network/src/ethereum/mod.rs @@ -7,7 +7,7 @@ mod signer; pub use signer::EthereumSigner; /// Types for a mainnet-like Ethereum network. -#[derive(Debug, Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub struct Ethereum { _private: (), } diff --git a/crates/node-bindings/src/anvil.rs b/crates/node-bindings/src/anvil.rs index ed8b66d9c18..4753e3e42d7 100644 --- a/crates/node-bindings/src/anvil.rs +++ b/crates/node-bindings/src/anvil.rs @@ -140,7 +140,7 @@ pub enum AnvilError { /// /// drop(anvil); // this will kill the instance /// ``` -#[derive(Debug, Clone, Default)] +#[derive(Clone, Debug, Default)] #[must_use = "This Builder struct does nothing unless it is `spawn`ed"] pub struct Anvil { program: Option, diff --git a/crates/provider/src/builder.rs b/crates/provider/src/builder.rs index a5890bae247..b84a18117d7 100644 --- a/crates/provider/src/builder.rs +++ b/crates/provider/src/builder.rs @@ -26,7 +26,7 @@ pub trait ProviderLayer, T: Transport + Clone, N: Network = Et } /// An identity layer that does nothing. -#[derive(Debug, Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub struct Identity; impl TxFiller for Identity diff --git a/crates/provider/src/fillers/chain_id.rs b/crates/provider/src/fillers/chain_id.rs index cb66ccc3cf0..5c468ac023f 100644 --- a/crates/provider/src/fillers/chain_id.rs +++ b/crates/provider/src/fillers/chain_id.rs @@ -34,7 +34,7 @@ use crate::{ /// # Ok(()) /// # } /// ``` -#[derive(Debug, Clone, Default, PartialEq, Eq)] +#[derive(Clone, Debug, Default, PartialEq, Eq)] pub struct ChainIdFiller(Arc>); impl ChainIdFiller { diff --git a/crates/provider/src/fillers/gas.rs b/crates/provider/src/fillers/gas.rs index 62f717f3e5a..d860c10e50f 100644 --- a/crates/provider/src/fillers/gas.rs +++ b/crates/provider/src/fillers/gas.rs @@ -13,7 +13,7 @@ use futures::FutureExt; /// An enum over the different types of gas fillable. #[allow(unreachable_pub)] #[doc(hidden)] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum GasFillable { Legacy { gas_limit: u128, gas_price: u128 }, Eip1559 { gas_limit: u128, estimate: Eip1559Estimation }, @@ -61,7 +61,7 @@ pub enum GasFillable { /// # Ok(()) /// # } /// ``` -#[derive(Debug, Clone, Copy, Default)] +#[derive(Clone, Copy, Debug, Default)] pub struct GasFiller; impl GasFiller { diff --git a/crates/provider/src/fillers/join_fill.rs b/crates/provider/src/fillers/join_fill.rs index 9c4805d7d6e..857ac2ab077 100644 --- a/crates/provider/src/fillers/join_fill.rs +++ b/crates/provider/src/fillers/join_fill.rs @@ -12,7 +12,7 @@ use futures::try_join; /// [`TxFiller`], and can be nested to compose any number of fill layers. /// /// [`TransactionRequest`]: alloy_rpc_types::TransactionRequest -#[derive(Debug, Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub struct JoinFill { left: L, right: R, diff --git a/crates/provider/src/fillers/mod.rs b/crates/provider/src/fillers/mod.rs index bf4eaa7e333..b5dac499532 100644 --- a/crates/provider/src/fillers/mod.rs +++ b/crates/provider/src/fillers/mod.rs @@ -32,7 +32,7 @@ use futures_utils_wasm::impl_future; use std::marker::PhantomData; /// The control flow for a filler. -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum FillerControlFlow { /// The filler is missing a required property. /// @@ -205,7 +205,7 @@ pub trait TxFiller: Clone + Send + Sync + std::fmt::Debug /// [`ProviderBuilder::filler`] to construct and apply it to a stack. /// /// [`ProviderBuilder::filler`]: crate::ProviderBuilder::filler -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct FillProvider where F: TxFiller, diff --git a/crates/provider/src/fillers/nonce.rs b/crates/provider/src/fillers/nonce.rs index ebe174f58c5..4218ea1a8af 100644 --- a/crates/provider/src/fillers/nonce.rs +++ b/crates/provider/src/fillers/nonce.rs @@ -40,7 +40,7 @@ use tokio::sync::Mutex; /// # Ok(()) /// # } /// ``` -#[derive(Debug, Clone, Default)] +#[derive(Clone, Debug, Default)] pub struct NonceFiller { nonces: DashMap>>>, } diff --git a/crates/provider/src/fillers/signer.rs b/crates/provider/src/fillers/signer.rs index e1fb14079f6..bac49d2030f 100644 --- a/crates/provider/src/fillers/signer.rs +++ b/crates/provider/src/fillers/signer.rs @@ -26,7 +26,7 @@ use super::{FillerControlFlow, TxFiller}; /// # Ok(()) /// # } /// ``` -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct SignerFiller { signer: S, } diff --git a/crates/provider/src/provider.rs b/crates/provider/src/provider.rs index 33f72a104e6..4d46ae8c38a 100644 --- a/crates/provider/src/provider.rs +++ b/crates/provider/src/provider.rs @@ -55,7 +55,7 @@ pub type FilterPollerBuilder = PollerBuilder>; /// Users should NOT use this type directly. It should only be used as an /// implementation detail of [`Provider::send_transaction_internal`]. #[doc(hidden)] -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum SendableTx { /// A transaction that is not yet signed. Builder(N::TransactionRequest), diff --git a/crates/provider/src/utils.rs b/crates/provider/src/utils.rs index cec10f06595..558cc9de696 100644 --- a/crates/provider/src/utils.rs +++ b/crates/provider/src/utils.rs @@ -11,7 +11,7 @@ pub const EIP1559_FEE_ESTIMATION_REWARD_PERCENTILE: f64 = 20.0; pub type EstimatorFunction = fn(u128, &[Vec]) -> Eip1559Estimation; /// Return type of EIP1155 gas fee estimator. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct Eip1559Estimation { /// The base fee per gas. pub max_fee_per_gas: u128, diff --git a/crates/pubsub/src/frontend.rs b/crates/pubsub/src/frontend.rs index 870cd1c7a1a..63e051be149 100644 --- a/crates/pubsub/src/frontend.rs +++ b/crates/pubsub/src/frontend.rs @@ -13,7 +13,7 @@ use tokio::sync::{mpsc, oneshot}; /// PubSub service. /// /// [`Transport`]: alloy_transport::Transport -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct PubSubFrontend { tx: mpsc::UnboundedSender, /// The number of items to buffer in new subscription channels. Defaults to diff --git a/crates/pubsub/src/managers/sub.rs b/crates/pubsub/src/managers/sub.rs index cbe3b6a27d0..a3c872d109b 100644 --- a/crates/pubsub/src/managers/sub.rs +++ b/crates/pubsub/src/managers/sub.rs @@ -3,7 +3,7 @@ use alloy_json_rpc::{EthNotification, SerializedRequest}; use alloy_primitives::{B256, U256}; use bimap::BiBTreeMap; -#[derive(Default, Debug)] +#[derive(Debug, Default)] pub(crate) struct SubscriptionManager { /// The subscriptions. local_to_sub: BiBTreeMap, diff --git a/crates/rpc-client/src/builtin.rs b/crates/rpc-client/src/builtin.rs index 2a1a2e96954..655b664dde3 100644 --- a/crates/rpc-client/src/builtin.rs +++ b/crates/rpc-client/src/builtin.rs @@ -7,7 +7,7 @@ use alloy_transport::{BoxTransport, BoxTransportConnect, TransportError, Transpo use alloy_pubsub::PubSubConnect; /// Connection string for built-in transports. -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq)] #[non_exhaustive] pub enum BuiltInConnectionString { #[cfg(any(feature = "reqwest", feature = "hyper"))] diff --git a/crates/rpc-types-engine/src/cancun.rs b/crates/rpc-types-engine/src/cancun.rs index 5cb8d351162..4155d227b40 100644 --- a/crates/rpc-types-engine/src/cancun.rs +++ b/crates/rpc-types-engine/src/cancun.rs @@ -8,7 +8,7 @@ use alloy_primitives::B256; /// /// See also: /// -#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, serde::Serialize, serde::Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)] pub struct CancunPayloadFields { /// The parent beacon block root. pub parent_beacon_block_root: B256, @@ -18,7 +18,7 @@ pub struct CancunPayloadFields { } /// A container type for [CancunPayloadFields] that may or may not be present. -#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] pub struct MaybeCancunPayloadFields { fields: Option, } diff --git a/crates/rpc-types-engine/src/forkchoice.rs b/crates/rpc-types-engine/src/forkchoice.rs index 5c62eaa605c..781ae7b651b 100644 --- a/crates/rpc-types-engine/src/forkchoice.rs +++ b/crates/rpc-types-engine/src/forkchoice.rs @@ -19,7 +19,7 @@ pub const INVALID_PAYLOAD_ATTRIBUTES_ERROR_MSG: &str = "Invalid payload attribut pub type ForkChoiceUpdateResult = Result; /// This structure encapsulates the fork choice state -#[derive(Default, Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ForkchoiceState { /// Hash of the head block. diff --git a/crates/rpc-types-engine/src/payload.rs b/crates/rpc-types-engine/src/payload.rs index 0174f98644c..6ce057cfbea 100644 --- a/crates/rpc-types-engine/src/payload.rs +++ b/crates/rpc-types-engine/src/payload.rs @@ -9,7 +9,7 @@ use std::fmt; pub type ExecutionPayloadBodiesV1 = Vec>; /// And 8-byte identifier for an execution payload. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Hash)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct PayloadId(B64); // === impl PayloadId === @@ -674,7 +674,7 @@ impl<'de> Deserialize<'de> for ExecutionPayload { } /// Error that can occur when handling payloads. -#[derive(thiserror::Error, Debug)] +#[derive(Debug, thiserror::Error)] pub enum PayloadError { /// Invalid payload extra data. #[error("invalid payload extra data: {0}")] @@ -915,7 +915,7 @@ impl fmt::Display for PayloadStatusEnum { /// Various errors that can occur when validating a payload or forkchoice update. /// /// This is intended for the [PayloadStatusEnum::Invalid] variant. -#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, thiserror::Error)] pub enum PayloadValidationError { /// Thrown when a forkchoice update's head links to a previously rejected payload. #[error("links to previously rejected block")] diff --git a/crates/rpc-types-engine/src/transition.rs b/crates/rpc-types-engine/src/transition.rs index 8b0f8fc3d12..34acc57a36d 100644 --- a/crates/rpc-types-engine/src/transition.rs +++ b/crates/rpc-types-engine/src/transition.rs @@ -2,7 +2,7 @@ use alloy_primitives::{B256, U256, U64}; use serde::{Deserialize, Serialize}; /// This structure contains configurable settings of the transition process. -#[derive(Default, Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct TransitionConfiguration { /// Maps on the TERMINAL_TOTAL_DIFFICULTY parameter of EIP-3675 diff --git a/crates/rpc-types-trace/src/common.rs b/crates/rpc-types-trace/src/common.rs index 0ca11aedc53..9a03ef71d36 100644 --- a/crates/rpc-types-trace/src/common.rs +++ b/crates/rpc-types-trace/src/common.rs @@ -4,7 +4,7 @@ use alloy_primitives::TxHash; use serde::{Deserialize, Serialize}; /// The result of a single transaction trace. -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(untagged)] pub enum TraceResult { /// Untagged success variant diff --git a/crates/rpc-types-trace/src/filter.rs b/crates/rpc-types-trace/src/filter.rs index e2bf2b5c79b..b02feb05f38 100644 --- a/crates/rpc-types-trace/src/filter.rs +++ b/crates/rpc-types-trace/src/filter.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; use std::collections::HashSet; /// Trace filter. -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Default)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct TraceFilter { @@ -42,7 +42,7 @@ impl TraceFilter { } /// How to apply `from_address` and `to_address` filters. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub enum TraceFilterMode { /// Return traces for transactions with matching `from` OR `to` addresses. @@ -53,7 +53,7 @@ pub enum TraceFilterMode { } /// Helper type for matching `from` and `to` addresses. Empty sets match all addresses. -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct TraceFilterMatcher { mode: TraceFilterMode, from_addresses: HashSet
, diff --git a/crates/rpc-types-trace/src/geth/call.rs b/crates/rpc-types-trace/src/geth/call.rs index f9bf921d710..26b4ae75ff9 100644 --- a/crates/rpc-types-trace/src/geth/call.rs +++ b/crates/rpc-types-trace/src/geth/call.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; /// The response object for `debug_traceTransaction` with `"tracer": "callTracer"`. /// /// -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct CallFrame { /// The address of that initiated the call. pub from: Address, @@ -46,7 +46,7 @@ pub struct CallFrame { } /// Represents a recorded call. -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct CallLogFrame { /// The address of the contract that was called. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -60,7 +60,7 @@ pub struct CallLogFrame { } /// The configuration for the call tracer. -#[derive(Debug, Copy, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CallConfig { /// When set to true, this will only trace the primary (top-level) call and not any sub-calls. diff --git a/crates/rpc-types-trace/src/geth/four_byte.rs b/crates/rpc-types-trace/src/geth/four_byte.rs index 66ce6a9df45..e5de66fa0b4 100644 --- a/crates/rpc-types-trace/src/geth/four_byte.rs +++ b/crates/rpc-types-trace/src/geth/four_byte.rs @@ -6,7 +6,7 @@ use std::collections::BTreeMap; /// The 4byte tracer response object. /// /// -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct FourByteFrame(pub BTreeMap); #[cfg(test)] diff --git a/crates/rpc-types-trace/src/geth/mod.rs b/crates/rpc-types-trace/src/geth/mod.rs index a1ef42f9fb0..9ded7fecb15 100644 --- a/crates/rpc-types-trace/src/geth/mod.rs +++ b/crates/rpc-types-trace/src/geth/mod.rs @@ -28,7 +28,7 @@ pub type TraceResult = crate::common::TraceResult; /// blockTraceResult represents the results of tracing a single block when an entire chain is being /// traced. ref -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct BlockTraceResult { /// Block number corresponding to the trace task pub block: U256, @@ -41,7 +41,7 @@ pub struct BlockTraceResult { /// Geth Default struct log trace frame /// /// -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct DefaultFrame { /// Whether the transaction failed @@ -58,7 +58,7 @@ pub struct DefaultFrame { /// Represents a struct log entry in a trace /// /// -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct StructLog { /// program counter pub pc: u64, @@ -104,7 +104,7 @@ pub struct StructLog { /// Note: This deserializes untagged, so it's possible that a custom javascript tracer response /// matches another variant, for example a js tracer that returns `{}` would be deserialized as /// [GethTrace::NoopTracer] -#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(untagged)] pub enum GethTrace { /// The response for the default struct log tracer @@ -162,7 +162,7 @@ impl From for GethTrace { /// Available built-in tracers /// /// See -#[derive(Debug, Copy, PartialEq, Eq, Clone, Hash, Deserialize, Serialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum GethDebugBuiltInTracerType { /// The 4byteTracer collects the function selectors of every function executed in the lifetime /// of a transaction, along with the size of the supplied call data. The result is a @@ -196,7 +196,7 @@ pub enum GethDebugBuiltInTracerType { /// Available tracers /// /// See and -#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(untagged)] pub enum GethDebugTracerType { /// built-in tracer @@ -215,7 +215,7 @@ impl From for GethDebugTracerType { /// /// This is a simple wrapper around serde_json::Value. /// with helpers for deserializing tracer configs. -#[derive(Debug, PartialEq, Eq, Clone, Default, Deserialize, Serialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(transparent)] pub struct GethDebugTracerConfig(pub serde_json::Value); @@ -271,7 +271,7 @@ impl From for GethDebugTracerConfig { /// Bindings for additional `debug_traceTransaction` options /// /// See -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Default)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct GethDebugTracingOptions { /// The common tracing options @@ -331,7 +331,7 @@ impl GethDebugTracingOptions { /// These are all known general purpose tracer options that may or not be supported by a given /// tracer. For example, the `enableReturnData` option is a noop on regular /// `debug_trace{Transaction,Block}` calls. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Default)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct GethDefaultTracingOptions { /// enable memory capture @@ -483,7 +483,7 @@ impl GethDefaultTracingOptions { /// Bindings for additional `debug_traceCall` options /// /// See -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Default)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct GethDebugTracingCallOptions { /// All the options diff --git a/crates/rpc-types-trace/src/geth/mux.rs b/crates/rpc-types-trace/src/geth/mux.rs index cef645b8f8f..2c7f3a0009e 100644 --- a/crates/rpc-types-trace/src/geth/mux.rs +++ b/crates/rpc-types-trace/src/geth/mux.rs @@ -5,12 +5,12 @@ use serde::{Deserialize, Serialize}; use std::collections::HashMap; /// A `muxTracer` config that contains the configuration for running multiple tracers in one go. -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct MuxConfig(pub HashMap>); /// A `muxTracer` frame response that contains the results of multiple tracers -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct MuxFrame(pub HashMap); #[cfg(test)] diff --git a/crates/rpc-types-trace/src/geth/noop.rs b/crates/rpc-types-trace/src/geth/noop.rs index c4db0692ea3..40e546f825e 100644 --- a/crates/rpc-types-trace/src/geth/noop.rs +++ b/crates/rpc-types-trace/src/geth/noop.rs @@ -6,7 +6,7 @@ use std::collections::BTreeMap; /// An empty frame response that's only an empty json object `{}`. /// /// -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct NoopFrame(BTreeMap<(), ()>); #[cfg(test)] diff --git a/crates/rpc-types-trace/src/geth/pre_state.rs b/crates/rpc-types-trace/src/geth/pre_state.rs index 20ab7e0f199..b60afc20ba1 100644 --- a/crates/rpc-types-trace/src/geth/pre_state.rs +++ b/crates/rpc-types-trace/src/geth/pre_state.rs @@ -9,7 +9,7 @@ use std::collections::{btree_map, BTreeMap}; /// The prestate tracer has two modes: prestate and diff /// /// -#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(untagged)] pub enum PreStateFrame { /// The default mode returns the accounts necessary to execute a given transaction. @@ -56,7 +56,7 @@ impl PreStateFrame { /// This corresponds to the default mode of the [PreStateConfig]. /// /// The [AccountState]'s storage will include all touched slots of an account. -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct PreStateMode(pub BTreeMap); /// Represents the account states before and after the transaction is executed. @@ -65,7 +65,7 @@ pub struct PreStateMode(pub BTreeMap); /// /// This will only contain changed [AccountState]s, created accounts will not be included in the pre /// state and selfdestructed accounts will not be included in the post state. -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub struct DiffMode { /// The account states after the transaction is executed. @@ -106,7 +106,7 @@ impl DiffMode { } /// Helper type for [DiffMode] to represent a specific set -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum DiffStateKind { /// Corresponds to the pre state of the [DiffMode] Pre, @@ -127,7 +127,7 @@ impl DiffStateKind { } /// Represents the state of an account -#[derive(Debug, Clone, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct AccountState { /// The optional balance of the account. #[serde( @@ -179,7 +179,7 @@ impl AccountState { } /// Helper type to track the kind of change of an [AccountState]. -#[derive(Debug, Copy, Clone, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum AccountChangeKind { /// The account was modified. #[default] @@ -208,7 +208,7 @@ impl AccountChangeKind { } /// The config for the prestate tracer. -#[derive(Debug, Copy, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct PreStateConfig { /// If `diffMode` is set to true, the response frame includes all the account and storage diffs diff --git a/crates/rpc-types-trace/src/opcode.rs b/crates/rpc-types-trace/src/opcode.rs index 45907615b67..a67354a0bc2 100644 --- a/crates/rpc-types-trace/src/opcode.rs +++ b/crates/rpc-types-trace/src/opcode.rs @@ -4,7 +4,7 @@ use alloy_primitives::B256; use serde::{Deserialize, Serialize}; /// Opcode gas usage for a transaction. -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct BlockOpcodeGas { /// The block hash @@ -17,7 +17,7 @@ pub struct BlockOpcodeGas { } /// Opcode gas usage for a transaction. -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct TransactionOpcodeGas { /// The transaction hash @@ -27,7 +27,7 @@ pub struct TransactionOpcodeGas { } /// Gas information for a single opcode. -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct OpcodeGas { /// The name of the opcode diff --git a/crates/rpc-types-trace/src/otterscan.rs b/crates/rpc-types-trace/src/otterscan.rs index 6f3e01d684b..de5066d54a7 100644 --- a/crates/rpc-types-trace/src/otterscan.rs +++ b/crates/rpc-types-trace/src/otterscan.rs @@ -10,7 +10,7 @@ use alloy_rpc_types::{Block, Rich, Transaction, TransactionReceipt}; use serde::{Deserialize, Serialize}; /// Operation type enum for `InternalOperation` struct -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[allow(missing_copy_implementations)] pub enum OperationType { /// Operation Transfer @@ -24,7 +24,7 @@ pub enum OperationType { } /// Custom struct for otterscan `getInternalOperations` RPC response -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct InternalOperation { pub r#type: OperationType, pub from: Address, @@ -33,7 +33,7 @@ pub struct InternalOperation { } /// Custom struct for otterscan `traceTransaction` RPC response -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct TraceEntry { pub r#type: String, pub depth: u32, @@ -44,7 +44,7 @@ pub struct TraceEntry { } /// Internal issuance struct for `BlockDetails` struct -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Default)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[allow(missing_copy_implementations)] #[serde(rename_all = "camelCase")] pub struct InternalIssuance { @@ -54,7 +54,7 @@ pub struct InternalIssuance { } /// Custom `Block` struct that includes transaction count for Otterscan responses -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct OtsBlock { #[serde(flatten)] @@ -69,7 +69,7 @@ impl From for OtsBlock { } /// Custom struct for otterscan `getBlockDetails` RPC response -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct BlockDetails { pub block: OtsBlock, @@ -88,7 +88,7 @@ impl From> for BlockDetails { } /// Custom transaction receipt struct for otterscan `OtsBlockTransactions` struct -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct OtsTransactionReceipt { /// The transaction receipt. @@ -101,7 +101,7 @@ pub struct OtsTransactionReceipt { } /// The receipt of a transaction. -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct OtsReceipt { /// If transaction is executed successfully. @@ -126,7 +126,7 @@ pub struct OtsReceipt { } /// Custom struct for otterscan `getBlockTransactions` RPC response -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct OtsBlockTransactions { pub fullblock: OtsBlock, pub receipts: Vec, @@ -134,7 +134,7 @@ pub struct OtsBlockTransactions { /// Custom struct for otterscan `searchTransactionsAfter`and `searchTransactionsBefore` RPC /// responses -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct TransactionsWithReceipts { pub txs: Vec, @@ -144,7 +144,7 @@ pub struct TransactionsWithReceipts { } /// Custom struct for otterscan `getContractCreator` RPC responses -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct ContractCreator { pub tx: Transaction, pub creator: Address, diff --git a/crates/rpc-types-trace/src/parity.rs b/crates/rpc-types-trace/src/parity.rs index 4009f5dcaa8..72a40b5c68b 100644 --- a/crates/rpc-types-trace/src/parity.rs +++ b/crates/rpc-types-trace/src/parity.rs @@ -10,7 +10,7 @@ use std::{ }; /// Different Trace diagnostic targets. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub enum TraceType { /// Default trace @@ -24,7 +24,7 @@ pub enum TraceType { } /// The Outcome of a traced transaction with optional settings -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct TraceResults { /// Output of the trace @@ -54,7 +54,7 @@ impl TraceResults { } /// A `FullTrace` with an additional transaction hash -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct TraceResultsWithTransactionHash { /// The recorded trace. @@ -65,7 +65,7 @@ pub struct TraceResultsWithTransactionHash { } /// A changed value -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct ChangedType { /// Original value pub from: T, @@ -76,7 +76,7 @@ pub struct ChangedType { /// Represents how a value changed. /// /// This is used for statediff. -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub enum Delta { /// Existing value didn't change. #[default] @@ -123,7 +123,7 @@ impl Delta { } /// The diff of an account after a transaction -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct AccountDiff { /// How the balance changed, if at all @@ -137,7 +137,7 @@ pub struct AccountDiff { } /// New-type for list of account diffs -#[derive(Clone, Debug, Eq, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(transparent)] pub struct StateDiff(pub BTreeMap); @@ -156,7 +156,7 @@ impl DerefMut for StateDiff { } /// Represents the various types of actions recorded during tracing -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase", tag = "type", content = "action")] pub enum Action { /// Regular call @@ -206,7 +206,7 @@ impl Action { /// An external action type. /// /// Used as enum identifier for [Action] -#[derive(Debug, Copy, PartialEq, Eq, Clone, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum ActionType { /// Contract call. @@ -221,7 +221,7 @@ pub enum ActionType { } /// Call type. -#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] pub enum CallType { /// None @@ -238,7 +238,7 @@ pub enum CallType { } /// Represents a certain [CallType] of a _call_ or message transaction. -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CallAction { /// Address of the sending account. @@ -256,7 +256,7 @@ pub struct CallAction { } /// Represents a _create_ action, either a `CREATE` operation or a CREATE transaction. -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CreateAction { /// The address of the creator. @@ -270,7 +270,7 @@ pub struct CreateAction { } /// What kind of reward. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub enum RewardType { /// Block rewards @@ -280,7 +280,7 @@ pub enum RewardType { } /// Recorded reward of a block. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RewardAction { /// Author's address. @@ -292,7 +292,7 @@ pub struct RewardAction { } /// Represents a _selfdestruct_ action fka `suicide`. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SelfdestructAction { /// destroyed/suicided address. @@ -304,7 +304,7 @@ pub struct SelfdestructAction { } /// Outcome of a CALL. -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CallOutput { /// Gas used by the call. @@ -314,7 +314,7 @@ pub struct CallOutput { } /// Outcome of a CREATE. -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CreateOutput { /// Address of the created contract. @@ -326,7 +326,7 @@ pub struct CreateOutput { } /// Represents the output of a trace. -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(untagged)] pub enum TraceOutput { /// Output of a regular call transaction. @@ -356,7 +356,7 @@ impl TraceOutput { } /// A parity style trace of a transaction. -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct TransactionTrace { /// Represents what kind of trace this is @@ -377,7 +377,7 @@ pub struct TransactionTrace { } /// A wrapper for [TransactionTrace] that includes additional information about the transaction. -#[derive(Clone, Debug, Eq, PartialEq, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Deserialize)] #[serde(rename_all = "camelCase")] pub struct LocalizedTransactionTrace { /// Trace of the transaction and its result. @@ -460,7 +460,7 @@ impl Serialize for LocalizedTransactionTrace { } /// A record of a full VM trace for a CALL/CREATE. -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct VmTrace { /// The code to be executed. @@ -470,7 +470,7 @@ pub struct VmTrace { } /// A record of a single VM instruction, opcode level. -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct VmInstruction { /// The gas cost for this instruction. @@ -490,7 +490,7 @@ pub struct VmInstruction { } /// A record of an executed VM operation. -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct VmExecutedOperation { /// The total gas used. @@ -504,7 +504,7 @@ pub struct VmExecutedOperation { } /// A diff of some chunk of memory. -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct MemoryDelta { /// Offset into memory the change begins. @@ -514,7 +514,7 @@ pub struct MemoryDelta { } /// A diff of some storage value. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct StorageDelta { /// Storage key. diff --git a/crates/rpc-types-trace/src/tracerequest.rs b/crates/rpc-types-trace/src/tracerequest.rs index f6c6c23c5a3..87cdfa91f17 100644 --- a/crates/rpc-types-trace/src/tracerequest.rs +++ b/crates/rpc-types-trace/src/tracerequest.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; use std::collections::HashSet; /// Container type for `trace_call` arguments -#[derive(Debug, Serialize, Deserialize, Default)] +#[derive(Debug, Default, Serialize, Deserialize)] pub struct TraceCallRequest { /// call request object pub call: TransactionRequest, diff --git a/crates/rpc-types/src/eth/account.rs b/crates/rpc-types/src/eth/account.rs index b2db1c1552d..26f6c9497ea 100644 --- a/crates/rpc-types/src/eth/account.rs +++ b/crates/rpc-types/src/eth/account.rs @@ -3,14 +3,14 @@ use alloy_serde::storage::JsonStorageKey; use serde::{Deserialize, Serialize}; /// Account information. -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct AccountInfo { /// Account name pub name: String, } /// Data structure with proof for one single storage-entry -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct EIP1186StorageProof { /// Storage key. @@ -22,7 +22,7 @@ pub struct EIP1186StorageProof { } /// Response for EIP-1186 account proof `eth_getProof` -#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct EIP1186AccountProofResponse { /// The account address. @@ -42,7 +42,7 @@ pub struct EIP1186AccountProofResponse { } /// Extended account information (used by `parity_allAccountInfo`). -#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct ExtAccountInfo { /// Account name pub name: String, @@ -56,7 +56,7 @@ pub struct ExtAccountInfo { /// account derived from a signature /// as well as information that tells if it is valid for /// the current chain -#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RecoveredAccount { /// address of the recovered account diff --git a/crates/rpc-types/src/eth/admin.rs b/crates/rpc-types/src/eth/admin.rs index 773c1383808..e22af66880c 100644 --- a/crates/rpc-types/src/eth/admin.rs +++ b/crates/rpc-types/src/eth/admin.rs @@ -9,7 +9,7 @@ use std::{ /// This includes general information about a running node, spanning networking and protocol /// details. -#[derive(Clone, Debug, Deserialize, Serialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct NodeInfo { /// Unique node identifier. pub id: B256, @@ -31,7 +31,7 @@ pub struct NodeInfo { } /// Represents a node's discovery and listener ports. -#[derive(Clone, Copy, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct Ports { /// The node's discovery port. pub discovery: u16, @@ -42,7 +42,7 @@ pub struct Ports { /// Represents protocols that the connected RPC node supports. /// /// This contains protocol information reported by the connected RPC node. -#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct ProtocolInfo { /// Details about the node's supported eth protocol. `None` if unsupported #[serde(default, skip_serializing_if = "Option::is_none")] @@ -57,7 +57,7 @@ pub struct ProtocolInfo { /// See [geth's `NodeInfo` /// struct](https://github.com/ethereum/go-ethereum/blob/c2e0abce2eedc1ba2a1b32c46fd07ef18a25354a/eth/protocols/eth/handler.go#L129) /// for how these fields are determined. -#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct EthProtocolInfo { /// The eth network version. pub network: u64, @@ -75,7 +75,7 @@ pub struct EthProtocolInfo { /// /// This is just an empty struct, because [geth's internal representation is /// empty](https://github.com/ethereum/go-ethereum/blob/c2e0abce2eedc1ba2a1b32c46fd07ef18a25354a/eth/protocols/snap/handler.go#L571-L576). -#[derive(Clone, Copy, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct SnapProtocolInfo {} /// Represents the protocols that a peer supports. @@ -83,7 +83,7 @@ pub struct SnapProtocolInfo {} /// This differs from [`ProtocolInfo`] in that [`PeerProtocolInfo`] contains protocol information /// gathered from the protocol handshake, and [`ProtocolInfo`] contains information reported by the /// connected RPC node. -#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct PeerProtocolInfo { /// Details about the peer's supported eth protocol. `None` if unsupported #[serde(default, skip_serializing_if = "Option::is_none")] @@ -98,7 +98,7 @@ pub struct PeerProtocolInfo { /// Can contain either eth protocol info or a string "handshake", which geth uses if the peer is /// still completing the handshake for the protocol. -#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(untagged)] pub enum EthPeerInfo { /// The `eth` sub-protocol metadata known about the host peer. @@ -113,7 +113,7 @@ pub enum EthPeerInfo { /// See [geth's `ethPeerInfo` /// struct](https://github.com/ethereum/go-ethereum/blob/53d1ae096ac0515173e17f0f81a553e5f39027f7/eth/peer.go#L28) /// for how these fields are determined. -#[derive(Clone, Copy, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct EthInfo { /// The negotiated eth version. #[serde(default)] @@ -127,7 +127,7 @@ pub struct EthInfo { /// Can contain either snap protocol info or a string "handshake", which geth uses if the peer is /// still completing the handshake for the protocol. -#[derive(Clone, Copy, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(untagged)] pub enum SnapPeerInfo { /// The `snap` sub-protocol metadata known about the host peer. @@ -142,7 +142,7 @@ pub enum SnapPeerInfo { /// See [geth's `snapPeerInfo` /// struct](https://github.com/ethereum/go-ethereum/blob/53d1ae096ac0515173e17f0f81a553e5f39027f7/eth/peer.go#L53) /// for how these fields are determined. -#[derive(Clone, Copy, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct SnapInfo { /// The negotiated snap version. pub version: u64, @@ -151,7 +151,7 @@ pub struct SnapInfo { /// Represents a short summary of information known about a connected peer. /// /// See [geth's `PeerInfo` struct](https://github.com/ethereum/go-ethereum/blob/64dccf7aa411c5c7cd36090c3d9b9892945ae813/p2p/peer.go#L484) for the source of each field. -#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct PeerInfo { /// The peer's ENR. #[serde(default, skip_serializing_if = "Option::is_none")] @@ -172,7 +172,7 @@ pub struct PeerInfo { /// Represents networking related information about the peer, including details about whether or /// not it is inbound, trusted, or static. -#[derive(Clone, Copy, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct PeerNetworkInfo { /// The local endpoint of the TCP connection. diff --git a/crates/rpc-types/src/eth/block.rs b/crates/rpc-types/src/eth/block.rs index c664ab47d93..25453371065 100644 --- a/crates/rpc-types/src/eth/block.rs +++ b/crates/rpc-types/src/eth/block.rs @@ -16,7 +16,7 @@ use serde::{ use std::{collections::BTreeMap, fmt, num::ParseIntError, ops::Deref, str::FromStr}; /// Block representation -#[derive(Default, Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Block { /// Header of the block. @@ -52,7 +52,7 @@ impl Block { /// Block header representation. #[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))] -#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Header { /// Hash of the block @@ -164,7 +164,7 @@ impl Header { /// Block Transactions depending on the boolean attribute of `eth_getBlockBy*`, /// or if used by `eth_getUncle*` -#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(untagged)] pub enum BlockTransactions { /// Only hashes @@ -399,7 +399,7 @@ impl<'a> std::iter::FusedIterator for BlockTransactionHashesMut<'a> {} /// /// This essentially represents the `full:bool` argument in RPC calls that determine whether the /// response should include full transaction objects or just the hashes. -#[derive(Debug, Copy, Clone, Eq, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum BlockTransactionsKind { /// Only include hashes: [BlockTransactions::Hashes] Hashes, @@ -418,7 +418,7 @@ impl From for BlockTransactionsKind { } /// Error that can occur when converting other types to blocks -#[derive(Debug, Clone, Copy, thiserror::Error)] +#[derive(Clone, Copy, Debug, thiserror::Error)] pub enum BlockError { /// A transaction failed sender recovery #[error("transaction failed sender recovery")] @@ -435,7 +435,7 @@ pub enum BlockError { /// If true, an RPC call should additionally raise if /// the block is not in the canonical chain. /// -#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize)] pub struct RpcBlockHash { /// A block hash pub block_hash: B256, @@ -469,7 +469,7 @@ impl AsRef for RpcBlockHash { } /// A block Number (or tag - "latest", "earliest", "pending") -#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] pub enum BlockNumberOrTag { /// Latest block #[default] @@ -615,14 +615,14 @@ pub enum ParseBlockNumberError { } /// Thrown when a 0x-prefixed hex string was expected -#[derive(Copy, Clone, Debug, Default, thiserror::Error)] +#[derive(Clone, Copy, Debug, Default, thiserror::Error)] #[non_exhaustive] #[error("hex string without 0x prefix")] pub struct HexStringMissingPrefixError; /// A Block Identifier /// -#[derive(Copy, Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum BlockId { /// A block hash and an optional bool that defines if it's canonical Hash(RpcBlockHash), @@ -891,7 +891,7 @@ impl FromStr for BlockId { } /// Block number and hash. -#[derive(Clone, Copy, Hash, Default, PartialEq, Eq)] +#[derive(Clone, Copy, Default, PartialEq, Eq, Hash)] pub struct BlockNumHash { /// Block number pub number: BlockNumber, @@ -941,7 +941,7 @@ impl From<(BlockHash, BlockNumber)> for BlockNumHash { } /// Either a block hash _or_ a block number -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[cfg_attr( any(test, feature = "arbitrary"), derive(proptest_derive::Arbitrary, arbitrary::Arbitrary) @@ -1068,7 +1068,7 @@ impl From
for RichHeader { } /// Value representation with additional info -#[derive(Debug, Clone, PartialEq, Eq, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Deserialize)] pub struct Rich { /// Standard value. #[serde(flatten)] @@ -1109,7 +1109,7 @@ impl Serialize for Rich { } /// BlockOverrides is a set of header fields to override. -#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(default, rename_all = "camelCase", deny_unknown_fields)] pub struct BlockOverrides { /// Overrides the block number. diff --git a/crates/rpc-types/src/eth/call.rs b/crates/rpc-types/src/eth/call.rs index b7fe39833ab..fa902995ec4 100644 --- a/crates/rpc-types/src/eth/call.rs +++ b/crates/rpc-types/src/eth/call.rs @@ -3,7 +3,7 @@ use alloy_primitives::Bytes; use serde::{Deserialize, Deserializer, Serialize, Serializer}; /// Bundle of transactions -#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(default, rename_all = "camelCase")] pub struct Bundle { /// All transactions to execute @@ -13,7 +13,7 @@ pub struct Bundle { } /// State context for callMany -#[derive(Debug, Copy, Clone, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(default, rename_all = "camelCase")] pub struct StateContext { /// Block Number @@ -25,7 +25,7 @@ pub struct StateContext { } /// CallResponse for eth_callMany -#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(default, rename_all = "camelCase")] pub struct EthCallResponse { /// eth_call output (if no error) @@ -47,7 +47,7 @@ impl EthCallResponse { } /// Represents a transaction index where -1 means all transactions -#[derive(Debug, Copy, Clone, Eq, PartialEq, Default)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub enum TransactionIndex { /// -1 means all transactions #[default] diff --git a/crates/rpc-types/src/eth/error.rs b/crates/rpc-types/src/eth/error.rs index f580a4dbe8d..90b4ac9c2c8 100644 --- a/crates/rpc-types/src/eth/error.rs +++ b/crates/rpc-types/src/eth/error.rs @@ -1,7 +1,7 @@ //! Commonly used errors for the `eth_` namespace. /// List of JSON-RPC error codes -#[derive(Debug, Copy, PartialEq, Eq, Clone)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum EthRpcErrorCode { /// Failed to send transaction, See also TransactionRejected, diff --git a/crates/rpc-types/src/eth/fee.rs b/crates/rpc-types/src/eth/fee.rs index 61c3b1ab8ba..4d3e2ea1134 100644 --- a/crates/rpc-types/src/eth/fee.rs +++ b/crates/rpc-types/src/eth/fee.rs @@ -25,7 +25,7 @@ impl Ord for TxGasAndReward { } /// Response type for `eth_feeHistory` -#[derive(Debug, Clone, Default, PartialEq, Deserialize, Serialize)] +#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct FeeHistory { /// An array of block base fees per gas. diff --git a/crates/rpc-types/src/eth/filter.rs b/crates/rpc-types/src/eth/filter.rs index 30e7c66fa18..1344d6e5553 100644 --- a/crates/rpc-types/src/eth/filter.rs +++ b/crates/rpc-types/src/eth/filter.rs @@ -13,7 +13,7 @@ use std::{ }; /// Helper type to represent a bloom filter used for matching logs. -#[derive(Default, Debug)] +#[derive(Debug, Default)] pub struct BloomFilter(Vec); impl From> for BloomFilter { @@ -31,7 +31,7 @@ impl BloomFilter { } } -#[derive(Default, Debug, PartialEq, Eq, Clone, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize)] /// FilterSet is a set of values that will be used to filter logs pub struct FilterSet(HashSet); @@ -130,7 +130,7 @@ impl From for Topic { } /// Represents the target range of blocks for the filter -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub enum FilterBlockOption { /// Represents a range of blocks with optional from and to blocks /// @@ -253,7 +253,7 @@ impl FilterBlockOption { } /// Filter for logs. -#[derive(Default, Debug, PartialEq, Eq, Clone, Hash)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] pub struct Filter { /// Filter block options, specifying on which blocks the filter should match. // https://eips.ethereum.org/EIPS/eip-234 @@ -642,7 +642,7 @@ impl<'de> Deserialize<'de> for Filter { } /// Union type for representing a single value or a vector of values inside a filter -#[derive(Debug, PartialEq, Eq, Clone, Hash)] +#[derive(Clone, Debug, PartialEq, Eq, Hash)] pub enum ValueOrArray { /// A single value Value(T), @@ -847,7 +847,7 @@ impl FilteredParams { } /// Response of the `eth_getFilterChanges` RPC. -#[derive(Clone, Debug, Eq, PartialEq, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize)] #[serde(untagged)] pub enum FilterChanges { /// Empty result. @@ -914,7 +914,7 @@ impl<'de> Deserialize<'de> for FilterChanges { } /// Owned equivalent of a `SubscriptionId` -#[derive(Debug, PartialEq, Clone, Hash, Eq, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(deny_unknown_fields)] #[serde(untagged)] pub enum FilterId { @@ -949,7 +949,7 @@ impl From> for FilterId { /// When this type is used in a request, it determines whether the client wishes to receive: /// - Only the transaction hashes (`Hashes` variant), or /// - Full transaction details (`Full` variant). -#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub enum PendingTransactionFilterKind { /// Receive only the hashes of the transactions. #[default] @@ -1054,7 +1054,7 @@ mod tests { #[test] fn can_serde_value_or_array() { - #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] + #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] struct Item { value: ValueOrArray, } diff --git a/crates/rpc-types/src/eth/index.rs b/crates/rpc-types/src/eth/index.rs index 151352171ca..5fa13053f18 100644 --- a/crates/rpc-types/src/eth/index.rs +++ b/crates/rpc-types/src/eth/index.rs @@ -7,7 +7,7 @@ use std::fmt; /// A hex encoded or decimal index that's intended to be used as a rust index, hence it's /// deserialized into a `usize`. -#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Default)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)] pub struct Index(usize); impl From for usize { diff --git a/crates/rpc-types/src/eth/log.rs b/crates/rpc-types/src/eth/log.rs index 49fca005161..1feeef4aac4 100644 --- a/crates/rpc-types/src/eth/log.rs +++ b/crates/rpc-types/src/eth/log.rs @@ -4,7 +4,7 @@ use alloy_primitives::{LogData, B256}; use serde::{Deserialize, Serialize}; /// Ethereum Log emitted by a transaction -#[derive(Debug, Clone, Eq, PartialEq, Hash, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] #[cfg_attr( any(test, feature = "arbitrary"), derive(proptest_derive::Arbitrary, arbitrary::Arbitrary) diff --git a/crates/rpc-types/src/eth/other.rs b/crates/rpc-types/src/eth/other.rs index 739e745440e..fda025cbdfd 100644 --- a/crates/rpc-types/src/eth/other.rs +++ b/crates/rpc-types/src/eth/other.rs @@ -9,7 +9,7 @@ use std::{ /// A type that is supposed to capture additional fields that are not native to ethereum but included in ethereum adjacent networks, for example fields the [optimism `eth_getTransactionByHash` request](https://docs.alchemy.com/alchemy/apis/optimism/eth-gettransactionbyhash) returns additional fields that this type will capture /// /// This type is supposed to be used with [`#[serde(flatten)`](https://serde.rs/field-attrs.html#flatten) -#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize, Default)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(transparent)] pub struct OtherFields { /// Contains all unknown fields diff --git a/crates/rpc-types/src/eth/pubsub.rs b/crates/rpc-types/src/eth/pubsub.rs index 7152f43cd78..3462cd21ab6 100644 --- a/crates/rpc-types/src/eth/pubsub.rs +++ b/crates/rpc-types/src/eth/pubsub.rs @@ -8,7 +8,7 @@ use alloy_primitives::B256; use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer}; /// Subscription result. -#[derive(Debug, Clone, PartialEq, Eq, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Deserialize)] #[serde(untagged)] pub enum SubscriptionResult { /// New block header. @@ -24,7 +24,7 @@ pub enum SubscriptionResult { } /// Response type for a SyncStatus subscription. -#[derive(Debug, Copy, Clone, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(untagged)] pub enum PubSubSyncStatus { /// If not currently syncing, this should always be `false`. @@ -34,7 +34,7 @@ pub enum PubSubSyncStatus { } /// Sync status metadata. -#[derive(Debug, Copy, Clone, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SyncStatusMetadata { /// Whether the node is currently syncing. @@ -64,7 +64,7 @@ impl Serialize for SubscriptionResult { } /// Subscription kind. -#[derive(Debug, Copy, Serialize, Deserialize, PartialEq, Eq, Hash, Clone)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub enum SubscriptionKind { @@ -99,7 +99,7 @@ pub enum SubscriptionKind { } /// Any additional parameters for a subscription. -#[derive(Debug, Clone, PartialEq, Eq, Default)] +#[derive(Clone, Debug, Default, PartialEq, Eq)] pub enum Params { /// No parameters passed. #[default] diff --git a/crates/rpc-types/src/eth/raw_log.rs b/crates/rpc-types/src/eth/raw_log.rs index 2a12903ec09..c1b3df43c47 100644 --- a/crates/rpc-types/src/eth/raw_log.rs +++ b/crates/rpc-types/src/eth/raw_log.rs @@ -4,7 +4,7 @@ use alloy_primitives::{Address, Bloom, Bytes, B256}; use alloy_rlp::{RlpDecodable, RlpEncodable}; /// Ethereum Log -#[derive(Clone, Debug, PartialEq, Eq, RlpDecodable, RlpEncodable, Default)] +#[derive(Clone, Debug, Default, PartialEq, Eq, RlpDecodable, RlpEncodable)] pub struct Log { /// Contract that emitted this log. pub address: Address, diff --git a/crates/rpc-types/src/eth/state.rs b/crates/rpc-types/src/eth/state.rs index 30b677bafd2..992fa6d26c4 100644 --- a/crates/rpc-types/src/eth/state.rs +++ b/crates/rpc-types/src/eth/state.rs @@ -8,7 +8,7 @@ use std::collections::HashMap; pub type StateOverride = HashMap; /// Custom account override used in call -#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(default, rename_all = "camelCase", deny_unknown_fields)] pub struct AccountOverride { /// Fake balance to set for the account before executing the call. diff --git a/crates/rpc-types/src/eth/syncing.rs b/crates/rpc-types/src/eth/syncing.rs index 0c0e7ce33b4..ffc6593b9bc 100644 --- a/crates/rpc-types/src/eth/syncing.rs +++ b/crates/rpc-types/src/eth/syncing.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; use std::collections::BTreeMap; /// Syncing info -#[derive(Debug, Copy, Clone, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SyncInfo { /// Starting block @@ -19,7 +19,7 @@ pub struct SyncInfo { } /// Peers info -#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize)] pub struct Peers { /// Number of active peers pub active: usize, @@ -32,7 +32,7 @@ pub struct Peers { } /// Number of peers connected to. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(untagged)] pub enum PeerCount { /// Peer count as integer @@ -42,7 +42,7 @@ pub enum PeerCount { } /// Peer connection information -#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct PeerInfo { /// Public node id pub id: Option, @@ -57,7 +57,7 @@ pub struct PeerInfo { } /// Peer network information -#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct PeerNetworkInfo { /// Remote endpoint address @@ -67,7 +67,7 @@ pub struct PeerNetworkInfo { } /// Peer protocols information -#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct PeerProtocolsInfo { /// Ethereum protocol information pub eth: Option, @@ -77,7 +77,7 @@ pub struct PeerProtocolsInfo { } /// Peer Ethereum protocol information -#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct PeerEthProtocolInfo { /// Negotiated ethereum protocol version pub version: u32, @@ -88,7 +88,7 @@ pub struct PeerEthProtocolInfo { } /// Peer PIP protocol information -#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct PipProtocolInfo { /// Negotiated PIP protocol version pub version: u32, @@ -99,7 +99,7 @@ pub struct PipProtocolInfo { } /// Sync status -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum SyncStatus { /// Info when syncing Info(SyncInfo), @@ -143,7 +143,7 @@ impl Serialize for SyncStatus { } /// Propagation statistics for pending transaction. -#[derive(Debug, Clone, Default, Serialize)] +#[derive(Clone, Debug, Default, Serialize)] #[serde(rename_all = "camelCase")] pub struct TransactionStats { /// Block no this transaction was first seen. @@ -153,7 +153,7 @@ pub struct TransactionStats { } /// Chain status. -#[derive(Debug, Copy, Clone, Default, Serialize)] +#[derive(Clone, Copy, Debug, Default, Serialize)] #[serde(rename_all = "camelCase")] pub struct ChainStatus { /// Describes the gap in the blockchain, if there is one: (first, last) diff --git a/crates/rpc-types/src/eth/transaction/common.rs b/crates/rpc-types/src/eth/transaction/common.rs index dd00fee8d74..003550be4ce 100644 --- a/crates/rpc-types/src/eth/transaction/common.rs +++ b/crates/rpc-types/src/eth/transaction/common.rs @@ -4,7 +4,7 @@ use alloy_primitives::{TxHash, B256}; /// Additional fields in the context of a block that contains this transaction. -#[derive(Debug, Clone, Copy, Default, Eq, PartialEq)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub struct TransactionInfo { /// Hash of the transaction. pub hash: Option, diff --git a/crates/rpc-types/src/eth/transaction/mod.rs b/crates/rpc-types/src/eth/transaction/mod.rs index 660d96aac36..6b5afb093df 100644 --- a/crates/rpc-types/src/eth/transaction/mod.rs +++ b/crates/rpc-types/src/eth/transaction/mod.rs @@ -31,7 +31,7 @@ mod signature; pub use signature::{Parity, Signature}; /// Transaction object used in RPC -#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))] #[serde(rename_all = "camelCase")] pub struct Transaction { diff --git a/crates/rpc-types/src/eth/transaction/optimism.rs b/crates/rpc-types/src/eth/transaction/optimism.rs index 2d44ae4e3e7..0fb20cf9a87 100644 --- a/crates/rpc-types/src/eth/transaction/optimism.rs +++ b/crates/rpc-types/src/eth/transaction/optimism.rs @@ -5,7 +5,7 @@ use alloy_primitives::{B256, U128, U64}; use serde::{Deserialize, Serialize}; /// Optimism specific transaction fields -#[derive(Debug, Copy, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct OptimismTransactionFields { /// Hash that uniquely identifies the source of the deposit. #[serde(rename = "sourceHash", skip_serializing_if = "Option::is_none")] @@ -20,7 +20,7 @@ pub struct OptimismTransactionFields { } /// Additional fields for Optimism transaction receipts -#[derive(Clone, Copy, Default, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct OptimismTransactionReceiptFields { /// Deposit nonce for deposit transactions post-regolith diff --git a/crates/rpc-types/src/eth/transaction/receipt.rs b/crates/rpc-types/src/eth/transaction/receipt.rs index 9cf0beab466..f108d1c3776 100644 --- a/crates/rpc-types/src/eth/transaction/receipt.rs +++ b/crates/rpc-types/src/eth/transaction/receipt.rs @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; /// /// This type is generic over an inner [`ReceiptEnvelope`] which contains /// consensus data and metadata. -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[cfg_attr( any(test, feature = "arbitrary"), derive(proptest_derive::Arbitrary, arbitrary::Arbitrary) diff --git a/crates/rpc-types/src/eth/transaction/request.rs b/crates/rpc-types/src/eth/transaction/request.rs index 513675fce30..5590126bbaf 100644 --- a/crates/rpc-types/src/eth/transaction/request.rs +++ b/crates/rpc-types/src/eth/transaction/request.rs @@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize}; use std::hash::Hash; /// Represents _all_ transaction requests to/from RPC. -#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct TransactionRequest { /// The address of the transaction author. @@ -180,7 +180,7 @@ impl TransactionRequest { /// /// If both fields are set, it is expected that they contain the same value, otherwise an error is /// returned. -#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize, Deserialize, Hash)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct TransactionInput { /// Transaction data #[serde(skip_serializing_if = "Option::is_none")] diff --git a/crates/rpc-types/src/eth/transaction/signature.rs b/crates/rpc-types/src/eth/transaction/signature.rs index 0eb13cfa22b..759b7966c67 100644 --- a/crates/rpc-types/src/eth/transaction/signature.rs +++ b/crates/rpc-types/src/eth/transaction/signature.rs @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; /// Container type for all signature fields in RPC #[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct Signature { /// The R field of the signature; the point on the curve. pub r: U256, @@ -28,7 +28,7 @@ pub struct Signature { /// /// This will be serialized as "0x0" if false, and "0x1" if true. #[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct Parity( #[serde(serialize_with = "serialize_parity", deserialize_with = "deserialize_parity")] pub bool, ); diff --git a/crates/rpc-types/src/eth/transaction/tx_type.rs b/crates/rpc-types/src/eth/transaction/tx_type.rs index eef6c61fc5f..62270854adf 100644 --- a/crates/rpc-types/src/eth/transaction/tx_type.rs +++ b/crates/rpc-types/src/eth/transaction/tx_type.rs @@ -15,7 +15,7 @@ pub const EIP1559_TX_TYPE_ID: u8 = 2; pub const EIP4844_TX_TYPE_ID: u8 = 3; /// Transaction Types supported by ethereum. -#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Default, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)] pub enum TxType { /// Legacy transaction pre EIP-2929 #[default] diff --git a/crates/rpc-types/src/eth/txpool.rs b/crates/rpc-types/src/eth/txpool.rs index e1c390891ba..b895fc85f8b 100644 --- a/crates/rpc-types/src/eth/txpool.rs +++ b/crates/rpc-types/src/eth/txpool.rs @@ -9,7 +9,7 @@ use serde::{ use std::{collections::BTreeMap, fmt, str::FromStr}; /// Transaction summary as found in the Txpool Inspection property. -#[derive(Debug, Copy, Clone, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct TxpoolInspectSummary { /// Recipient (None when contract creation) pub to: Option
, @@ -113,7 +113,7 @@ impl Serialize for TxpoolInspectSummary { /// as the ones that are being scheduled for future execution only. /// /// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_content) for more details -#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct TxpoolContent { /// pending tx pub pending: BTreeMap>, @@ -136,7 +136,7 @@ impl TxpoolContent { /// Same as [TxpoolContent] but for a specific address. /// /// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_contentFrom) for more details -#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct TxpoolContentFrom { /// pending tx pub pending: BTreeMap, @@ -153,7 +153,7 @@ pub struct TxpoolContentFrom { /// transactions in the pool and find any potential issues. /// /// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_inspect) for more details -#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct TxpoolInspect { /// pending tx pub pending: BTreeMap>, @@ -168,7 +168,7 @@ pub struct TxpoolInspect { /// are being scheduled for future execution only. /// /// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_status) for more details -#[derive(Debug, Copy, Default, Clone, PartialEq, Eq, Deserialize, Serialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct TxpoolStatus { /// number of pending tx pub pending: U64, diff --git a/crates/rpc-types/src/eth/work.rs b/crates/rpc-types/src/eth/work.rs index 000ad8ac8a2..df8fcfaf803 100644 --- a/crates/rpc-types/src/eth/work.rs +++ b/crates/rpc-types/src/eth/work.rs @@ -6,7 +6,7 @@ use serde::{ use std::fmt; /// The result of an `eth_getWork` request -#[derive(Clone, Copy, Debug, PartialEq, Eq, Default)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub struct Work { /// The proof-of-work hash. pub pow_hash: B256, diff --git a/crates/rpc-types/src/with_other.rs b/crates/rpc-types/src/with_other.rs index e070bfb4363..622510a9319 100644 --- a/crates/rpc-types/src/with_other.rs +++ b/crates/rpc-types/src/with_other.rs @@ -6,7 +6,7 @@ use std::ops::{Deref, DerefMut}; /// Wrapper allowing to catch all fields missing on the inner struct while /// deserialize. -#[derive(Debug, Clone, Serialize)] +#[derive(Clone, Debug, Serialize)] pub struct WithOtherFields { /// The inner struct. #[serde(flatten)] diff --git a/crates/serde/src/num.rs b/crates/serde/src/num.rs index 4650bb76fc5..6d9f6d2d705 100644 --- a/crates/serde/src/num.rs +++ b/crates/serde/src/num.rs @@ -20,7 +20,7 @@ use serde::{de, Deserialize, Deserializer, Serialize}; /// assert_eq!(number, hex); /// assert_eq!(hex.to(), 100); /// ``` -#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize)] pub struct U64HexOrNumber(U64); impl U64HexOrNumber { @@ -369,7 +369,7 @@ mod tests { #[test] fn test_hex_u64() { - #[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] + #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] struct Value { #[serde(with = "u64_hex")] inner: u64, @@ -385,7 +385,7 @@ mod tests { #[test] fn test_u128_hex_or_decimal() { - #[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] + #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] struct Value { #[serde(with = "u128_hex_or_decimal")] inner: u128, @@ -406,7 +406,7 @@ mod tests { #[test] fn test_u128_hex_or_decimal_opt() { - #[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] + #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] struct Value { #[serde(with = "u128_hex_or_decimal_opt")] inner: Option, @@ -434,7 +434,7 @@ mod tests { #[test] fn test_u128_hex_or_decimal_vec() { - #[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] + #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] struct Value { #[serde(with = "u128_hex_or_decimal_vec")] inner: Vec, @@ -450,7 +450,7 @@ mod tests { #[test] fn test_u128_hex_or_decimal_vec_vec_opt() { - #[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] + #[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] struct Value { #[serde(with = "u128_hex_or_decimal_vec_vec_opt")] inner: Option>>, diff --git a/crates/serde/src/storage.rs b/crates/serde/src/storage.rs index 978ff38fbad..be9b61c16ed 100644 --- a/crates/serde/src/storage.rs +++ b/crates/serde/src/storage.rs @@ -24,7 +24,7 @@ use serde::{Deserialize, Deserializer, Serialize}; /// /// The contained [B256] and From implementation for String are used to preserve the input and /// implement this behavior from geth. -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(from = "U256", into = "String")] pub struct JsonStorageKey(pub B256); diff --git a/crates/signer-aws/src/signer.rs b/crates/signer-aws/src/signer.rs index 0441806cb89..5cb111283ba 100644 --- a/crates/signer-aws/src/signer.rs +++ b/crates/signer-aws/src/signer.rs @@ -68,7 +68,7 @@ impl fmt::Debug for AwsSigner { } /// Errors thrown by [`AwsSigner`]. -#[derive(thiserror::Error, Debug)] +#[derive(Debug, thiserror::Error)] pub enum AwsSignerError { /// Thrown when the AWS KMS API returns a signing error. #[error(transparent)] diff --git a/crates/signer-gcp/src/signer.rs b/crates/signer-gcp/src/signer.rs index 849c4b6db45..640751c3315 100644 --- a/crates/signer-gcp/src/signer.rs +++ b/crates/signer-gcp/src/signer.rs @@ -126,7 +126,7 @@ impl fmt::Debug for GcpSigner { } /// Errors thrown by [`GcpSigner`]. -#[derive(Error, Debug)] +#[derive(Debug, Error)] pub enum GcpSignerError { /// Thrown when the GCP KMS API returns a signing error. #[error(transparent)] diff --git a/crates/signer-ledger/src/types.rs b/crates/signer-ledger/src/types.rs index 91d34e69a0e..ff0869dfcf8 100644 --- a/crates/signer-ledger/src/types.rs +++ b/crates/signer-ledger/src/types.rs @@ -30,7 +30,7 @@ impl fmt::Display for DerivationType { } /// Error when using the Ledger transport. -#[derive(Error, Debug)] +#[derive(Debug, Error)] pub enum LedgerError { /// Underlying Ledger transport error. #[error(transparent)] @@ -63,7 +63,7 @@ pub enum LedgerError { pub(crate) const P1_FIRST: u8 = 0x00; #[repr(u8)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] #[allow(non_camel_case_types, dead_code)] pub(crate) enum INS { GET_PUBLIC_KEY = 0x02, @@ -86,7 +86,7 @@ impl fmt::Display for INS { } #[repr(u8)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] #[allow(non_camel_case_types)] pub(crate) enum P1 { NON_CONFIRM = 0x00, @@ -94,7 +94,7 @@ pub(crate) enum P1 { } #[repr(u8)] -#[derive(Debug, Copy, Clone, Eq, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] #[allow(non_camel_case_types)] pub(crate) enum P2 { NO_CHAINCODE = 0x00, diff --git a/crates/signer-trezor/src/types.rs b/crates/signer-trezor/src/types.rs index 9b3eead0fe8..4d211da21ab 100644 --- a/crates/signer-trezor/src/types.rs +++ b/crates/signer-trezor/src/types.rs @@ -27,7 +27,7 @@ impl fmt::Display for DerivationType { } } -#[derive(Error, Debug)] +#[derive(Debug, Error)] /// Error when using the Trezor transport pub enum TrezorError { /// Underlying Trezor transport error. diff --git a/crates/transport-http/src/lib.rs b/crates/transport-http/src/lib.rs index d5053deaa00..648709a4bea 100644 --- a/crates/transport-http/src/lib.rs +++ b/crates/transport-http/src/lib.rs @@ -42,7 +42,7 @@ mod reqwest; /// Currently supported clients are: #[cfg_attr(feature = "reqwest", doc = " - [`reqwest`](::reqwest::Client)")] #[cfg_attr(feature = "hyper", doc = " - [`hyper`](hyper_util::client::legacy::Client)")] -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct Http { client: T, url: Url, diff --git a/crates/transport-ipc/src/connect.rs b/crates/transport-ipc/src/connect.rs index 6857820e34b..ad3c55cf6a4 100644 --- a/crates/transport-ipc/src/connect.rs +++ b/crates/transport-ipc/src/connect.rs @@ -4,7 +4,7 @@ use std::{ }; /// An IPC Connection object. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct IpcConnect { inner: T, } diff --git a/crates/transport-ws/src/native.rs b/crates/transport-ws/src/native.rs index 2adc9c9b589..9a08edce286 100644 --- a/crates/transport-ws/src/native.rs +++ b/crates/transport-ws/src/native.rs @@ -15,7 +15,7 @@ type TungsteniteStream = WebSocketStream>; const KEEPALIVE: u64 = 10; /// Simple connection details for a websocket connection. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct WsConnect { /// The URL to connect to. pub url: String, diff --git a/crates/transport-ws/src/wasm.rs b/crates/transport-ws/src/wasm.rs index e5f1f70ce99..db7594be299 100644 --- a/crates/transport-ws/src/wasm.rs +++ b/crates/transport-ws/src/wasm.rs @@ -9,7 +9,7 @@ use serde_json::value::RawValue; use ws_stream_wasm::{WsErr, WsMessage, WsMeta, WsStream}; /// Simple connection info for the websocket. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct WsConnect { /// The URL to connect to. pub url: String, diff --git a/crates/transport/src/error.rs b/crates/transport/src/error.rs index 42f0b03dfc0..9ed5f982edc 100644 --- a/crates/transport/src/error.rs +++ b/crates/transport/src/error.rs @@ -12,7 +12,7 @@ pub type TransportResult> = RpcResult