executive in progress
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user