cfg: replace std feature gate alloc imports with extern crate alloc (#10861)

This commit is contained in:
Thomas Coratger
2024-09-13 18:01:12 +02:00
committed by GitHub
parent 6fc81f2b70
commit 47d188cb8e
54 changed files with 39 additions and 163 deletions

View File

@ -1,4 +1,5 @@
//! EIP-6110 deposit requests parsing
use alloc::{string::ToString, vec::Vec};
use alloy_eips::eip6110::{DepositRequest, MAINNET_DEPOSIT_CONTRACT_ADDRESS};
use alloy_sol_types::{sol, SolEvent};
use reth_chainspec::ChainSpec;
@ -6,9 +7,6 @@ use reth_evm::execute::BlockValidationError;
use reth_primitives::{Receipt, Request};
use revm_primitives::Log;
#[cfg(not(feature = "std"))]
use alloc::{string::ToString, vec::Vec};
sol! {
#[allow(missing_docs)]
event DepositEvent(

View File

@ -4,6 +4,7 @@ use crate::{
dao_fork::{DAO_HARDFORK_BENEFICIARY, DAO_HARDKFORK_ACCOUNTS},
EthEvmConfig,
};
use alloc::{boxed::Box, sync::Arc, vec, vec::Vec};
use core::fmt::Display;
use reth_chainspec::{ChainSpec, EthereumHardforks, MAINNET};
use reth_ethereum_consensus::validate_block_post_execution;
@ -32,11 +33,6 @@ use revm_primitives::{
BlockEnv, CfgEnvWithHandlerCfg, EVMError, EnvWithHandlerCfg, ResultAndState,
};
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, sync::Arc, vec, vec::Vec};
#[cfg(feature = "std")]
use std::sync::Arc;
/// Provides executors to execute regular ethereum blocks
#[derive(Debug, Clone)]
pub struct EthExecutorProvider<EvmConfig = EthEvmConfig> {

View File

@ -9,18 +9,14 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate alloc;
use std::sync::Arc;
use alloc::vec::Vec;
use reth_chainspec::{ChainSpec, Head};
use reth_evm::{ConfigureEvm, ConfigureEvmEnv};
use reth_primitives::{transaction::FillTxEnv, Address, Header, TransactionSigned, U256};
use revm_primitives::{AnalysisKind, Bytes, CfgEnvWithHandlerCfg, Env, TxEnv, TxKind};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use std::sync::Arc;
mod config;
pub use config::{revm_spec, revm_spec_by_timestamp_after_merge};