mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
cfg: replace std feature gate alloc imports with extern crate alloc (#10861)
This commit is contained in:
@ -9,11 +9,9 @@
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
extern crate alloc;
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::{boxed::Box, string::String};
|
||||
|
||||
use alloc::{boxed::Box, string::String};
|
||||
use alloy_eips::BlockNumHash;
|
||||
use alloy_primitives::B256;
|
||||
use derive_more::Display;
|
||||
|
||||
@ -1,13 +1,11 @@
|
||||
//! Errors when computing the state root.
|
||||
|
||||
use alloc::string::ToString;
|
||||
use alloy_primitives::B256;
|
||||
use derive_more::Display;
|
||||
use nybbles::Nibbles;
|
||||
use reth_storage_errors::{db::DatabaseError, provider::ProviderError};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::string::ToString;
|
||||
|
||||
/// State root errors.
|
||||
#[derive(Display, Debug, PartialEq, Eq, Clone)]
|
||||
pub enum StateRootError {
|
||||
|
||||
@ -1,12 +1,8 @@
|
||||
//! Contains [Chain], a chain of blocks and their final state.
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use crate::ExecutionOutcome;
|
||||
use alloc::{borrow::Cow, collections::BTreeMap};
|
||||
use core::{fmt, ops::RangeInclusive};
|
||||
#[cfg(feature = "std")]
|
||||
use std::{borrow::Cow, collections::BTreeMap};
|
||||
|
||||
use crate::ExecutionOutcome;
|
||||
use reth_execution_errors::{BlockExecutionError, InternalBlockExecutionError};
|
||||
use reth_primitives::{
|
||||
Address, BlockHash, BlockNumHash, BlockNumber, ForkBlock, Receipt, SealedBlock,
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
extern crate alloc;
|
||||
|
||||
mod chain;
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
//! Builder for creating an EVM with a database and environment.
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::boxed::Box;
|
||||
|
||||
use revm::{inspector_handle_register, Database, Evm, EvmBuilder, GetInspector};
|
||||
use revm_primitives::EnvWithHandlerCfg;
|
||||
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
extern crate alloc;
|
||||
|
||||
use core::ops::Deref;
|
||||
|
||||
@ -1,12 +1,7 @@
|
||||
//! System contract call functions.
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use std::fmt::Display;
|
||||
#[cfg(not(feature = "std"))]
|
||||
use {
|
||||
alloc::{boxed::Box, format, string::ToString, vec::Vec},
|
||||
core::fmt::Display,
|
||||
};
|
||||
use alloc::{boxed::Box, format, string::ToString, vec::Vec};
|
||||
use core::fmt::Display;
|
||||
|
||||
use crate::ConfigureEvm;
|
||||
use alloy_eips::{
|
||||
|
||||
Reference in New Issue
Block a user