Created
January 9, 2016 12:34
-
-
Save gavofyork/77ca2143a669cf889d67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let e = Executive::new(&mut state, &blockchain, &engine, &t); | |
let e: Executed = e.transact(&t); | |
let e2: Executed = Executive::call(&e, call_arguments); | |
let e2: Executed = Executive::create(&e, create_arguments); | |
type ExecResult = Result<Executed, EthcoreError>; | |
impl Executive { | |
fn call(call_args) -> ExecResult { | |
let e: Executive::new_private(call_args...); | |
e.call_private() | |
} | |
fn create(create_args: ...) -> ExecResult { | |
let e: Executive::new_private(create_args...); | |
e.create_private() | |
} | |
pub fn transact(&mut self, t: Transaction) -> ExecResult { | |
match t.type() { | |
Transaction::MessageCall => { | |
// prep for call | |
... | |
e.call_private() | |
}, | |
Transaction::ContractCreation => { | |
// prep for create | |
state.inc_nonce(); | |
... | |
e.create_private() | |
}, | |
} | |
} | |
fn new_private() -> Executive { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment