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

Fix: no-std dependencies #244

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 3 additions & 0 deletions interpreter/src/call_create.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! Call and create trap handler.

#[cfg(not(feature = "std"))]
use crate::Vec;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use alloc::vec::Vec for consistency.


use crate::utils::{h256_to_u256, u256_to_usize};
use crate::{
Context, ExitError, ExitException, ExitResult, Machine, Memory, Opcode, RuntimeBackend,
Expand Down
3 changes: 3 additions & 0 deletions interpreter/src/runtime.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#[cfg(not(feature = "std"))]
use crate::Vec;

use crate::{ExitError, Opcode};
use alloc::rc::Rc;
use primitive_types::{H160, H256, U256};
Expand Down
3 changes: 3 additions & 0 deletions src/call_stack.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

use crate::{Capture, ExitError, ExitFatal, ExitResult, Invoker, InvokerControl, InvokerMachine};
use core::convert::Infallible;

Expand Down
3 changes: 3 additions & 0 deletions src/color.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

use crate::{
Capture, Control, Etable, ExitResult, Gasometer, InvokerMachine, Machine, Opcode, RuntimeState,
};
Expand Down
3 changes: 3 additions & 0 deletions src/standard/gasometer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ mod consts;
mod costs;
mod utils;

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

use crate::standard::Config;
use crate::{
ExitError, ExitException, ExitFatal, Gasometer as GasometerT, Machine, MergeStrategy, Opcode,
Expand Down
3 changes: 3 additions & 0 deletions src/standard/invoker/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
mod resolver;
mod routines;

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

pub use resolver::{EtableResolver, PrecompileSet, Resolver};

use super::{Config, MergeableRuntimeState, TransactGasometer};
Expand Down
3 changes: 3 additions & 0 deletions src/standard/invoker/resolver.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

use super::routines;
use crate::standard::{Config, TransactGasometer};
use crate::{
Expand Down
3 changes: 3 additions & 0 deletions src/standard/invoker/routines.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

use super::{CallTrapData, CreateTrapData, Resolver, SubstackInvoke, TransactGasometer};
use crate::standard::Config;
use crate::{
Expand Down
Loading