executive in progress

This commit is contained in:
debris
2016-01-07 21:29:36 +01:00
parent ec720aefa9
commit d27a16c945
4 changed files with 17 additions and 7 deletions

View File

@@ -1,3 +1,5 @@
use util::hash::*;
use util::uint::*;
use state::*;
use env_info::*;
use engine::*;
@@ -27,9 +29,11 @@ impl<'a> Executive<'a> {
pub fn exec(&mut self, transaction: &Transaction) -> ExecutiveResult {
// TODO: validate that we have enough funds
self.state.inc_nonce(&transaction.sender());
match transaction.kind() {
TransactionKind::MessageCall => self.call(transaction),
TransactionKind::ContractCreation => self.create(transaction)
TransactionKind::ContractCreation => { unimplemented!(); }// self.create(&self.sender(), )
}
}
@@ -37,7 +41,7 @@ impl<'a> Executive<'a> {
ExecutiveResult::Ok
}
fn create(&mut self, transaction: &Transaction) -> ExecutiveResult {
fn create(&mut self, address: &Address, endowment: &U256, gas_price: &U256, gas: &U256, init: &[u8], origin: &Address) -> ExecutiveResult {
ExecutiveResult::Ok
}
}

View File

@@ -27,8 +27,8 @@ impl SubState {
}
}
/// This structure represents contract execution environment.
/// It should be initalized with `State` and contract address.
/// Externality interface for the Virtual Machine providing access to
/// world state.
///
/// ```markdown
/// extern crate ethcore_util as util;
@@ -41,7 +41,7 @@ impl SubState {
/// fn main() {
/// let address = Address::from_str("0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6").unwrap();
/// let mut data = RuntimeData::new();
/// let mut env = Env::new(EnvInfo::new(), State::new_temp(), address);
/// let mut ext = Ext::new(EnvInfo::new(), State::new_temp(), address);
/// }
/// ```
pub struct Ext {