mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
cfg: replace std feature gate alloc imports with extern crate alloc (#10861)
This commit is contained in:
@ -4,14 +4,12 @@ use crate::{
|
||||
precompile::{Address, HashSet},
|
||||
primitives::alloy_primitives::BlockNumber,
|
||||
};
|
||||
use alloc::vec::Vec;
|
||||
use reth_execution_errors::{BlockExecutionError, InternalBlockExecutionError};
|
||||
use reth_primitives::{Receipt, Receipts, Request, Requests};
|
||||
use reth_prune_types::{PruneMode, PruneModes, PruneSegmentError, MINIMUM_PRUNING_DISTANCE};
|
||||
use revm::db::states::bundle_state::BundleRetention;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Takes care of:
|
||||
/// - recording receipts during execution of multiple blocks.
|
||||
/// - pruning receipts according to the pruning configuration.
|
||||
@ -183,14 +181,9 @@ impl BlockBatchRecord {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use alloc::collections::BTreeMap;
|
||||
use reth_primitives::{Address, Log, Receipt};
|
||||
use reth_prune_types::{PruneMode, ReceiptsLogPruneConfig};
|
||||
#[cfg(feature = "std")]
|
||||
use std::collections::BTreeMap;
|
||||
#[cfg(not(feature = "std"))]
|
||||
extern crate alloc;
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::collections::BTreeMap;
|
||||
|
||||
#[test]
|
||||
fn test_save_receipts_empty() {
|
||||
|
||||
@ -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;
|
||||
|
||||
/// Contains glue code for integrating reth database into revm's [Database].
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
use crate::precompile::HashMap;
|
||||
use alloc::vec::Vec;
|
||||
use reth_primitives::{
|
||||
keccak256, Account, Address, BlockNumber, Bytecode, Bytes, StorageKey, B256, U256,
|
||||
};
|
||||
@ -12,9 +13,6 @@ use reth_trie::{
|
||||
HashedStorage,
|
||||
};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Mock state for testing
|
||||
#[derive(Debug, Default, Clone, Eq, PartialEq)]
|
||||
pub struct StateProviderTest {
|
||||
|
||||
Reference in New Issue
Block a user