Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: some no_std cleanup #1834

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/bytecode/src/eof/printer.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#[cfg(feature = "std")]
#![cfg(feature = "std")]

pub fn print(code: &[u8]) {
use crate::{opcode::*, utils::read_i16};
use primitives::hex;
Expand Down Expand Up @@ -60,7 +61,6 @@ pub fn print(code: &[u8]) {
mod test {
use primitives::hex;

#[cfg(feature = "std")]
#[test]
fn sanity_test() {
super::print(&hex!("6001e200ffff00"));
Expand Down
5 changes: 4 additions & 1 deletion crates/revm/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,16 @@ where

#[cfg(test)]
mod test {
extern crate alloc;

use crate::{Context, Evm};
use alloc::{boxed::Box, rc::Rc};
use bytecode::Bytecode;
use core::cell::RefCell;
use database::InMemoryDB;
use interpreter::Interpreter;
use primitives::{address, TxKind, U256};
use state::AccountInfo;
use std::{cell::RefCell, rc::Rc};
use wiring::EthereumWiring;

/// Custom evm context
Expand Down
3 changes: 3 additions & 0 deletions crates/revm/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ impl<'a, EvmWiringT: EvmWiring> EvmHandler<'a, EvmWiringT> {

#[cfg(test)]
mod test {
extern crate alloc;

use alloc::boxed::Box;
use core::cell::RefCell;
use database_interface::EmptyDB;
use std::{rc::Rc, sync::Arc};
Expand Down
9 changes: 4 additions & 5 deletions crates/wiring/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,13 @@ impl<DBError, TransactionValidationErrorT> EVMError<DBError, TransactionValidati
}
}

#[cfg(feature = "std")]
impl<DBError, TransactionValidationErrorT> std::error::Error
impl<DBError, TransactionValidationErrorT> core::error::Error
for EVMError<DBError, TransactionValidationErrorT>
where
DBError: std::error::Error + 'static,
TransactionValidationErrorT: std::error::Error + 'static,
DBError: core::error::Error + 'static,
TransactionValidationErrorT: core::error::Error + 'static,
{
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
match self {
Self::Transaction(e) => Some(e),
Self::Header(e) => Some(e),
Expand Down
Loading