Merge pull request #77 from gavofyork/evm_factory
renamed VmFactory -> Factory
This commit is contained in:
commit
27f6d6a99c
@ -3,9 +3,9 @@
|
|||||||
use evm::Evm;
|
use evm::Evm;
|
||||||
|
|
||||||
/// Evm factory. Creates appropriate Evm.
|
/// Evm factory. Creates appropriate Evm.
|
||||||
pub struct VmFactory;
|
pub struct Factory;
|
||||||
|
|
||||||
impl VmFactory {
|
impl Factory {
|
||||||
/// Returns jit vm
|
/// Returns jit vm
|
||||||
#[cfg(feature = "jit")]
|
#[cfg(feature = "jit")]
|
||||||
pub fn create() -> Box<Evm> {
|
pub fn create() -> Box<Evm> {
|
||||||
@ -21,5 +21,5 @@ impl VmFactory {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_create_vm() {
|
fn test_create_vm() {
|
||||||
let _vm = VmFactory::create();
|
let _vm = Factory::create();
|
||||||
}
|
}
|
@ -2,16 +2,12 @@
|
|||||||
|
|
||||||
pub mod ext;
|
pub mod ext;
|
||||||
pub mod evm;
|
pub mod evm;
|
||||||
pub mod vmfactory;
|
pub mod factory;
|
||||||
//pub mod logentry;
|
|
||||||
pub mod schedule;
|
pub mod schedule;
|
||||||
#[cfg(feature = "jit" )]
|
#[cfg(feature = "jit" )]
|
||||||
mod jit;
|
mod jit;
|
||||||
|
|
||||||
// TODO: Error -> evm::Error, Result -> evm::Result
|
|
||||||
pub use self::evm::{Evm, Error, Result};
|
pub use self::evm::{Evm, Error, Result};
|
||||||
pub use self::ext::Ext;
|
pub use self::ext::Ext;
|
||||||
// TODO: VmFactory -> evm::Factory
|
pub use self::factory::Factory;
|
||||||
// TODO: module rename vmfactory -> factory
|
|
||||||
pub use self::vmfactory::VmFactory;
|
|
||||||
pub use self::schedule::Schedule;
|
pub use self::schedule::Schedule;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
use common::*;
|
use common::*;
|
||||||
use state::*;
|
use state::*;
|
||||||
use engine::*;
|
use engine::*;
|
||||||
use evm::{self, Schedule, VmFactory, Ext};
|
use evm::{self, Schedule, Factory, Ext};
|
||||||
|
|
||||||
/// Returns new address created from address and given nonce.
|
/// Returns new address created from address and given nonce.
|
||||||
pub fn contract_address(address: &Address, nonce: &U256) -> Address {
|
pub fn contract_address(address: &Address, nonce: &U256) -> Address {
|
||||||
@ -184,7 +184,7 @@ impl<'a> Executive<'a> {
|
|||||||
} else if params.code.len() > 0 {
|
} else if params.code.len() > 0 {
|
||||||
// if destination is a contract, do normal message call
|
// if destination is a contract, do normal message call
|
||||||
let mut ext = Externalities::from_executive(self, params, substate, OutputPolicy::Return(output));
|
let mut ext = Externalities::from_executive(self, params, substate, OutputPolicy::Return(output));
|
||||||
let evm = VmFactory::create();
|
let evm = Factory::create();
|
||||||
evm.exec(¶ms, &mut ext)
|
evm.exec(¶ms, &mut ext)
|
||||||
} else {
|
} else {
|
||||||
// otherwise, nothing
|
// otherwise, nothing
|
||||||
@ -202,7 +202,7 @@ impl<'a> Executive<'a> {
|
|||||||
self.state.transfer_balance(¶ms.sender, ¶ms.address, ¶ms.value);
|
self.state.transfer_balance(¶ms.sender, ¶ms.address, ¶ms.value);
|
||||||
|
|
||||||
let mut ext = Externalities::from_executive(self, params, substate, OutputPolicy::InitContract);
|
let mut ext = Externalities::from_executive(self, params, substate, OutputPolicy::InitContract);
|
||||||
let evm = VmFactory::create();
|
let evm = Factory::create();
|
||||||
evm.exec(¶ms, &mut ext)
|
evm.exec(¶ms, &mut ext)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user