chore(primitives, ethereum-forks): replace std feature gate alloc imports (#10945)

This commit is contained in:
nk_ysg
2024-09-17 17:52:57 +08:00
committed by GitHub
parent 847ac1dfcc
commit f04fc7c5b9
2 changed files with 3 additions and 5 deletions

View File

@ -13,7 +13,8 @@ use rustc_hash::FxHashMap;
use std::collections::hash_map::Entry;
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, collections::btree_map::Entry, vec::Vec};
use alloc::collections::btree_map::Entry;
use alloc::{boxed::Box, vec::Vec};
/// Generic trait over a set of ordered hardforks
pub trait Hardforks: Default + Clone {

View File

@ -1,9 +1,6 @@
use crate::{Address, Transaction, TransactionSigned, TxKind, U256};
use revm_primitives::{AuthorizationList, TxEnv};
#[cfg(all(not(feature = "std"), feature = "optimism"))]
use alloc::vec::Vec;
/// Implements behaviour to fill a [`TxEnv`] from another transaction.
pub trait FillTxEnv {
/// Fills [`TxEnv`] with an [`Address`] and transaction.
@ -14,7 +11,7 @@ impl FillTxEnv for TransactionSigned {
fn fill_tx_env(&self, tx_env: &mut TxEnv, sender: Address) {
#[cfg(feature = "optimism")]
let envelope = {
let mut envelope = Vec::with_capacity(self.length_without_header());
let mut envelope = alloc::vec::Vec::with_capacity(self.length_without_header());
self.encode_enveloped(&mut envelope);
envelope
};