Skip to content

Commit

Permalink
chore: enable no-std for execution types crate
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Jan 25, 2025
1 parent 60f9277 commit b55c6fb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions crates/evm/execution-types/src/chain.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Contains [Chain], a chain of blocks and their final state.
use crate::ExecutionOutcome;
use alloc::{borrow::Cow, collections::BTreeMap};
use alloc::{borrow::Cow, boxed::Box, collections::BTreeMap, vec::Vec};
use alloy_consensus::BlockHeader;
use alloy_eips::{eip1898::ForkBlock, eip2718::Encodable2718, BlockNumHash};
use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash};
Expand Down Expand Up @@ -345,7 +345,7 @@ impl<N: NodePrimitives> Chain<N> {
let split_at = block_number + 1;
let higher_number_blocks = self.blocks.split_off(&split_at);

let execution_outcome = std::mem::take(&mut self.execution_outcome);
let execution_outcome = core::mem::take(&mut self.execution_outcome);
let (canonical_block_exec_outcome, pending_block_exec_outcome) =
execution_outcome.split_at(split_at);

Expand Down Expand Up @@ -463,7 +463,7 @@ impl<B: Block<Body: BlockBody<Transaction: SignedTransaction>>> ChainBlocks<'_,

impl<B: Block> IntoIterator for ChainBlocks<'_, B> {
type Item = (BlockNumber, RecoveredBlock<B>);
type IntoIter = std::collections::btree_map::IntoIter<BlockNumber, RecoveredBlock<B>>;
type IntoIter = alloc::collections::btree_map::IntoIter<BlockNumber, RecoveredBlock<B>>;

fn into_iter(self) -> Self::IntoIter {
#[allow(clippy::unnecessary_to_owned)]
Expand Down
1 change: 1 addition & 0 deletions crates/evm/execution-types/src/execute.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use alloc::vec::Vec;
use alloy_eips::eip7685::Requests;
use revm::db::BundleState;

Expand Down
5 changes: 3 additions & 2 deletions crates/evm/execution-types/src/execution_outcome.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::BlockExecutionOutput;
use alloc::{vec, vec::Vec};
use alloy_eips::eip7685::Requests;
use alloy_primitives::{logs_bloom, map::HashMap, Address, BlockNumber, Bloom, Log, B256, U256};
use reth_primitives::Receipts;
Expand Down Expand Up @@ -314,13 +315,13 @@ impl<T> ExecutionOutcome<T> {
pub fn prepend_state(&mut self, mut other: BundleState) {
let other_len = other.reverts.len();
// take this bundle
let this_bundle = std::mem::take(&mut self.bundle);
let this_bundle = core::mem::take(&mut self.bundle);
// extend other bundle with this
other.extend(this_bundle);
// discard other reverts
other.take_n_reverts(other_len);
// swap bundles
std::mem::swap(&mut self.bundle, &mut other)
core::mem::swap(&mut self.bundle, &mut other)
}

/// Create a new instance with updated receipts.
Expand Down
1 change: 1 addition & 0 deletions crates/evm/execution-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]

extern crate alloc;

Expand Down

0 comments on commit b55c6fb

Please sign in to comment.