Decouple virtual machines (#6184)

* work in progress for splitting vms

* evm working

* Evm -> Vm

* wasm converted

* ethcore working

* test fixes
This commit is contained in:
Nikolay Volf
2017-08-01 13:37:57 +03:00
committed by GitHub
parent c4025622de
commit b7006034b1
65 changed files with 534 additions and 400 deletions

View File

@@ -17,7 +17,7 @@
//! Simple executive tracer.
use util::{Bytes, Address, U256};
use evm::action_params::ActionParams;
use vm::ActionParams;
use trace::trace::{Call, Create, Action, Res, CreateResult, CallResult, VMTrace, VMOperation, VMExecutedOperation, MemoryDiff, StorageDiff, Suicide};
use trace::{Tracer, VMTracer, FlatTrace, TraceError};

View File

@@ -39,7 +39,7 @@ pub use self::types::filter::{Filter, AddressesFilter};
use util::{Bytes, Address, U256, H256, DBTransaction};
use self::trace::{Call, Create};
use evm::action_params::ActionParams;
use vm::ActionParams;
use header::BlockNumber;
/// This trait is used by executive to build traces.

View File

@@ -17,7 +17,7 @@
//! Nonoperative tracer.
use util::{Bytes, Address, U256};
use evm::action_params::ActionParams;
use vm::ActionParams;
use trace::{Tracer, VMTracer, FlatTrace, TraceError};
use trace::trace::{Call, Create, VMTrace};

View File

@@ -18,7 +18,7 @@
use std::fmt;
use rlp::{Encodable, RlpStream, Decodable, DecoderError, UntrustedRlp};
use evm::Error as EvmError;
use vm::Error as VmError;
/// Trace evm errors.
#[derive(Debug, PartialEq, Clone)]
@@ -45,24 +45,24 @@ pub enum Error {
Wasm,
}
impl<'a> From<&'a EvmError> for Error {
fn from(e: &'a EvmError) -> Self {
impl<'a> From<&'a VmError> for Error {
fn from(e: &'a VmError) -> Self {
match *e {
EvmError::OutOfGas => Error::OutOfGas,
EvmError::BadJumpDestination { .. } => Error::BadJumpDestination,
EvmError::BadInstruction { .. } => Error::BadInstruction,
EvmError::StackUnderflow { .. } => Error::StackUnderflow,
EvmError::OutOfStack { .. } => Error::OutOfStack,
EvmError::BuiltIn { .. } => Error::BuiltIn,
EvmError::Wasm { .. } => Error::Wasm,
EvmError::Internal(_) => Error::Internal,
EvmError::MutableCallInStaticContext => Error::MutableCallInStaticContext,
VmError::OutOfGas => Error::OutOfGas,
VmError::BadJumpDestination { .. } => Error::BadJumpDestination,
VmError::BadInstruction { .. } => Error::BadInstruction,
VmError::StackUnderflow { .. } => Error::StackUnderflow,
VmError::OutOfStack { .. } => Error::OutOfStack,
VmError::BuiltIn { .. } => Error::BuiltIn,
VmError::Wasm { .. } => Error::Wasm,
VmError::Internal(_) => Error::Internal,
VmError::MutableCallInStaticContext => Error::MutableCallInStaticContext,
}
}
}
impl From<EvmError> for Error {
fn from(e: EvmError) -> Self {
impl From<VmError> for Error {
fn from(e: VmError) -> Self {
Error::from(&e)
}
}

View File

@@ -21,7 +21,7 @@ use util::sha3::Hashable;
use util::bloom::Bloomable;
use rlp::*;
use evm::action_params::ActionParams;
use vm::ActionParams;
use basic_types::LogBloom;
use evm::CallType;
use super::error::Error;