Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: some no-std touchups #9480

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/primitives/src/transaction/eip1559.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ use alloy_rlp::{length_of_length, Decodable, Encodable, Header};
use core::mem;
use reth_codecs::{main_codec, Compact};

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

/// A transaction with a priority fee ([EIP-1559](https://eips.ethereum.org/EIPS/eip-1559)).
#[main_codec]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)]
Expand Down
3 changes: 3 additions & 0 deletions crates/primitives/src/transaction/eip2930.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ use alloy_rlp::{length_of_length, Decodable, Encodable, Header};
use core::mem;
use reth_codecs::{main_codec, Compact};

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

/// Transaction with an [`AccessList`] ([EIP-2930](https://eips.ethereum.org/EIPS/eip-2930)).
#[main_codec]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)]
Expand Down
7 changes: 5 additions & 2 deletions crates/primitives/src/transaction/eip7702.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ use super::access_list::AccessList;
use crate::{keccak256, Bytes, ChainId, Signature, TxKind, TxType, B256, U256};
use alloy_eips::eip7702::SignedAuthorization;
use alloy_rlp::{length_of_length, Decodable, Encodable, Header};
use core::mem;
use reth_codecs::{main_codec, Compact};
use std::mem;

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

/// [EIP-7702 Set Code Transaction](https://eips.ethereum.org/EIPS/eip-7702)
///
Expand Down Expand Up @@ -306,7 +309,7 @@ impl<'a> arbitrary::Arbitrary<'a> for TxEip7702 {
}

// TODO(onbjerg): This is temporary until we upstream `Hash` for EIP-7702 types in alloy
impl std::hash::Hash for TxEip7702 {
impl core::hash::Hash for TxEip7702 {
fn hash<H: core::hash::Hasher>(&self, state: &mut H) {
self.chain_id.hash(state);
self.nonce.hash(state);
Expand Down
3 changes: 3 additions & 0 deletions crates/primitives/src/transaction/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ use alloy_rlp::{length_of_length, Encodable, Header};
use core::mem;
use reth_codecs::{main_codec, Compact};

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

/// Legacy transaction.
#[main_codec]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)]
Expand Down
Loading