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:
@ -1,12 +1,10 @@
|
||||
#[cfg(not(feature = "std"))]
|
||||
use crate::{hardforks::Hardforks, ForkCondition};
|
||||
use alloc::{
|
||||
format,
|
||||
string::{String, ToString},
|
||||
vec::Vec,
|
||||
};
|
||||
|
||||
use crate::{hardforks::Hardforks, ForkCondition};
|
||||
|
||||
/// A container to pretty-print a hardfork.
|
||||
///
|
||||
/// The fork is formatted depending on its fork condition:
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
//! Previously version of Apache licenced [`ethereum-forkid`](https://crates.io/crates/ethereum-forkid).
|
||||
|
||||
use crate::Head;
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::{
|
||||
collections::{BTreeMap, BTreeSet},
|
||||
vec::Vec,
|
||||
@ -22,8 +21,6 @@ use crc::*;
|
||||
use proptest_derive::Arbitrary as PropTestArbitrary;
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
#[cfg(feature = "std")]
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
|
||||
const CRC_32_IEEE: Crc<u32> = Crc::<u32>::new(&CRC_32_ISO_HDLC);
|
||||
const TIMESTAMP_BEFORE_ETHEREUM_MAINNET: u64 = 1_300_000_000;
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
use crate::{ChainHardforks, EthereumHardfork, ForkCondition};
|
||||
use alloc::vec;
|
||||
use alloy_primitives::U256;
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::vec;
|
||||
|
||||
/// Dev hardforks
|
||||
pub static DEV_HARDFORKS: Lazy<ChainHardforks> = Lazy::new(|| {
|
||||
ChainHardforks::new(vec![
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
use crate::{hardfork, ChainHardforks, ForkCondition, Hardfork};
|
||||
use alloc::{boxed::Box, format, string::String};
|
||||
use alloy_chains::Chain;
|
||||
use alloy_primitives::{uint, U256};
|
||||
use core::{
|
||||
@ -9,9 +10,6 @@ use core::{
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::{boxed::Box, format, string::String};
|
||||
|
||||
hardfork!(
|
||||
/// The name of an Ethereum hardfork.
|
||||
EthereumHardfork {
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::{boxed::Box, format, string::String, vec};
|
||||
use core::{
|
||||
any::Any,
|
||||
|
||||
@ -15,7 +15,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 display;
|
||||
|
||||
Reference in New Issue
Block a user