Skip to content

Instantly share code, notes, and snippets.

@gavofyork
Created January 9, 2016 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gavofyork/77ca2143a669cf889d67 to your computer and use it in GitHub Desktop.
Save gavofyork/77ca2143a669cf889d67 to your computer and use it in GitHub Desktop.
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