Skip to content

Commit

Permalink
fix: remove the feature flag for alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Sep 10, 2024
1 parent 75d4d0c commit 72a9438
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 27 deletions.
4 changes: 1 addition & 3 deletions crates/consensus/src/header.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use alloc::vec::Vec;
use alloy_eips::{
eip1559::{calc_next_block_base_fee, BaseFeeParams},
eip4844::{calc_blob_gasprice, calc_excess_blob_gas},
Expand All @@ -12,9 +13,6 @@ use alloy_rlp::{
};
use core::mem;

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

/// Ommer root of empty list.
pub const EMPTY_OMMER_ROOT_HASH: B256 =
b256!("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347");
Expand Down
1 change: 0 additions & 1 deletion crates/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(not(feature = "std"))]
extern crate alloc;

mod account;
Expand Down
4 changes: 1 addition & 3 deletions crates/consensus/src/receipt/receipts.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use crate::receipt::{Eip658Value, TxReceipt};
use alloc::vec::Vec;
use alloy_primitives::{Bloom, Log};
use alloy_rlp::{length_of_length, BufMut, Decodable, Encodable};
use core::borrow::Borrow;

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

/// Receipt containing result of transaction execution.
#[derive(Clone, Debug, Default, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
Expand Down
4 changes: 1 addition & 3 deletions crates/consensus/src/transaction/eip1559.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use crate::{EncodableSignature, SignableTransaction, Signed, Transaction, TxType};
use alloc::vec::Vec;
use alloy_eips::{eip2930::AccessList, eip7702::SignedAuthorization};
use alloy_primitives::{keccak256, Bytes, ChainId, Signature, TxKind, B256, U256};
use alloy_rlp::{BufMut, Decodable, Encodable, Header};
use core::mem;

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

/// A transaction with a priority fee ([EIP-1559](https://eips.ethereum.org/EIPS/eip-1559)).
#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))]
Expand Down
4 changes: 1 addition & 3 deletions crates/consensus/src/transaction/eip2930.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use crate::{EncodableSignature, SignableTransaction, Signed, Transaction, TxType};
use alloc::vec::Vec;
use alloy_eips::{eip2930::AccessList, eip7702::SignedAuthorization};
use alloy_primitives::{keccak256, Bytes, ChainId, Signature, TxKind, B256, U256};
use alloy_rlp::{length_of_length, BufMut, Decodable, Encodable, Header};
use core::mem;

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

/// Transaction with an [`AccessList`] ([EIP-2930](https://eips.ethereum.org/EIPS/eip-2930)).
#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))]
Expand Down
4 changes: 1 addition & 3 deletions crates/consensus/src/transaction/eip4844.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::{EncodableSignature, SignableTransaction, Signed, Transaction, TxType};

use alloc::vec::Vec;
use alloy_eips::{eip2930::AccessList, eip4844::DATA_GAS_PER_BLOB, eip7702::SignedAuthorization};
use alloy_primitives::{keccak256, Address, Bytes, ChainId, Signature, TxKind, B256, U256};
use alloy_rlp::{length_of_length, BufMut, Decodable, Encodable, Header};
Expand All @@ -12,9 +13,6 @@ pub use alloy_eips::eip4844::BlobTransactionSidecar;
#[doc(inline)]
pub use alloy_eips::eip4844::BlobTransactionValidationError;

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

/// [EIP-4844 Blob Transaction](https://eips.ethereum.org/EIPS/eip-4844#blob-transaction)
///
/// A transaction with blob hashes and max blob fee.
Expand Down
10 changes: 5 additions & 5 deletions crates/consensus/src/transaction/eip7702.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use crate::{EncodableSignature, SignableTransaction, Signed, Transaction, TxType};
use alloy_eips::eip2930::AccessList;
use alloc::vec::Vec;
use alloy_eips::{
eip2930::AccessList,
eip7702::{constants::EIP7702_TX_TYPE_ID, SignedAuthorization},
};
use alloy_primitives::{keccak256, Address, Bytes, ChainId, Signature, TxKind, B256, U256};
use alloy_rlp::{BufMut, Decodable, Encodable, Header};
use core::mem;

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use alloy_eips::eip7702::{constants::EIP7702_TX_TYPE_ID, SignedAuthorization};

/// A transaction with a priority fee ([EIP-7702](https://eips.ethereum.org/EIPS/eip-7702)).
#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))]
Expand Down
4 changes: 1 addition & 3 deletions crates/consensus/src/transaction/legacy.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
use core::mem;

use alloc::vec::Vec;
use alloy_eips::{eip2930::AccessList, eip7702::SignedAuthorization};
use alloy_primitives::{keccak256, Bytes, ChainId, Signature, TxKind, B256, U256};
use alloy_rlp::{length_of_length, BufMut, Decodable, Encodable, Header, Result};

use crate::{EncodableSignature, SignableTransaction, Signed, Transaction, TxType};

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

/// Legacy transaction.
#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))]
Expand Down
4 changes: 1 addition & 3 deletions crates/consensus/src/transaction/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
//! Transaction types.
use crate::Signed;
use alloc::vec::Vec;
use alloy_eips::{eip2930::AccessList, eip7702::SignedAuthorization};
use alloy_primitives::{keccak256, ChainId, TxKind, B256, U256};
use core::any;

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

mod eip1559;
pub use eip1559::TxEip1559;

Expand Down

0 comments on commit 72a9438

Please sign in to comment.