Skip to content

Commit

Permalink
fix(primitives): make types impl hash
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Jun 14, 2024
1 parent ab475aa commit 25f6783
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/primitives/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use alloy_primitives::{Address, B256};

/// Payload attributes.
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(Debug, Default, Clone, PartialEq, Eq)]
#[derive(Debug, Default, Clone, Hash, PartialEq, Eq)]
pub struct L2PayloadAttributes {
/// Value for the timestamp field of the new payload.
#[cfg_attr(feature = "serde", serde(rename = "timestamp"))]
Expand Down
4 changes: 2 additions & 2 deletions crates/primitives/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize};

/// Block Header Info
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(Debug, Clone, Copy, Eq, PartialEq, Default)]
#[derive(Debug, Clone, Copy, Eq, Hash, PartialEq, Default)]
pub struct BlockInfo {
/// The block hash
pub hash: B256,
Expand Down Expand Up @@ -49,7 +49,7 @@ impl core::fmt::Display for BlockInfo {

/// L2 Block Header Info
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(Debug, Clone, Copy, Eq, PartialEq, Default)]
#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq, Default)]
pub struct L2BlockInfo {
/// The base [BlockInfo]
pub block_info: BlockInfo,
Expand Down
4 changes: 2 additions & 2 deletions crates/primitives/src/block_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub enum L1BlockInfoTx {
// | 32 | L1FeeOverhead |
// | 32 | L1FeeScalar |
// +---------+--------------------------+
#[derive(Debug, Clone, Eq, PartialEq)]
#[derive(Debug, Clone, Hash, Eq, PartialEq)]
pub struct L1BlockInfoBedrock {
/// The current L1 origin block number
pub number: u64,
Expand Down Expand Up @@ -89,7 +89,7 @@ pub struct L1BlockInfoBedrock {
/// | 32 | BlockHash |
/// | 32 | BatcherHash |
/// +---------+--------------------------+
#[derive(Debug, Clone, Eq, PartialEq)]
#[derive(Debug, Clone, Hash, Eq, PartialEq)]
pub struct L1BlockInfoEcotone {
/// The current L1 origin block number
pub number: u64,
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/src/raw_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use alloy_rlp::{Decodable, Encodable};

/// A raw transaction
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Default, Clone, PartialEq, Eq)]
#[derive(Debug, Default, Clone, Hash, PartialEq, Eq)]
pub struct RawTransaction(pub Bytes);

impl RawTransaction {
Expand Down

0 comments on commit 25f6783

Please sign in to comment.