pub struct Executive<'a, B: 'a> { /* private fields */ }
Expand description
Transaction executor.
Implementations
sourceimpl<'a, B: 'a + StateBackend> Executive<'a, B>
impl<'a, B: 'a + StateBackend> Executive<'a, B>
sourcepub fn new(
state: &'a mut State<B>,
info: &'a EnvInfo,
machine: &'a Machine,
schedule: &'a Schedule
) -> Self
pub fn new(
state: &'a mut State<B>,
info: &'a EnvInfo,
machine: &'a Machine,
schedule: &'a Schedule
) -> Self
Basic constructor.
sourcepub fn from_parent(
state: &'a mut State<B>,
info: &'a EnvInfo,
machine: &'a Machine,
schedule: &'a Schedule,
parent_depth: usize,
static_flag: bool
) -> Self
pub fn from_parent(
state: &'a mut State<B>,
info: &'a EnvInfo,
machine: &'a Machine,
schedule: &'a Schedule,
parent_depth: usize,
static_flag: bool
) -> Self
Populates executive from parent properties. Increments executive depth.
sourcepub fn transact<T, V>(
&'a mut self,
t: &SignedTransaction,
options: TransactOptions<T, V>
) -> Result<Executed<T::Output, V::Output>, ExecutionError> where
T: Tracer,
V: VMTracer,
pub fn transact<T, V>(
&'a mut self,
t: &SignedTransaction,
options: TransactOptions<T, V>
) -> Result<Executed<T::Output, V::Output>, ExecutionError> where
T: Tracer,
V: VMTracer,
This function should be used to execute transaction.
sourcepub fn transact_virtual<T, V>(
&'a mut self,
t: &SignedTransaction,
options: TransactOptions<T, V>
) -> Result<Executed<T::Output, V::Output>, ExecutionError> where
T: Tracer,
V: VMTracer,
pub fn transact_virtual<T, V>(
&'a mut self,
t: &SignedTransaction,
options: TransactOptions<T, V>
) -> Result<Executed<T::Output, V::Output>, ExecutionError> where
T: Tracer,
V: VMTracer,
Execute a transaction in a “virtual” context. This will ensure the caller has enough balance to execute the desired transaction. Used for extra-block executions for things like consensus contracts and RPCs
sourcepub fn call_with_stack_depth<T, V>(
&mut self,
params: ActionParams,
substate: &mut Substate,
stack_depth: usize,
tracer: &mut T,
vm_tracer: &mut V
) -> Result<FinalizationResult> where
T: Tracer,
V: VMTracer,
pub fn call_with_stack_depth<T, V>(
&mut self,
params: ActionParams,
substate: &mut Substate,
stack_depth: usize,
tracer: &mut T,
vm_tracer: &mut V
) -> Result<FinalizationResult> where
T: Tracer,
V: VMTracer,
Calls contract function with given contract params and stack depth.
NOTE. It does not finalize the transaction (doesn’t do refunds, nor suicides).
Modifies the substate and the output.
Returns either gas_left or vm::Error
.
sourcepub fn call<T, V>(
&mut self,
params: ActionParams,
substate: &mut Substate,
tracer: &mut T,
vm_tracer: &mut V
) -> Result<FinalizationResult> where
T: Tracer,
V: VMTracer,
pub fn call<T, V>(
&mut self,
params: ActionParams,
substate: &mut Substate,
tracer: &mut T,
vm_tracer: &mut V
) -> Result<FinalizationResult> where
T: Tracer,
V: VMTracer,
Calls contract function with given contract params.
sourcepub fn create_with_stack_depth<T, V>(
&mut self,
params: ActionParams,
substate: &mut Substate,
stack_depth: usize,
tracer: &mut T,
vm_tracer: &mut V
) -> Result<FinalizationResult> where
T: Tracer,
V: VMTracer,
pub fn create_with_stack_depth<T, V>(
&mut self,
params: ActionParams,
substate: &mut Substate,
stack_depth: usize,
tracer: &mut T,
vm_tracer: &mut V
) -> Result<FinalizationResult> where
T: Tracer,
V: VMTracer,
Creates contract with given contract params and stack depth. NOTE. It does not finalize the transaction (doesn’t do refunds, nor suicides). Modifies the substate.
sourcepub fn create<T, V>(
&mut self,
params: ActionParams,
substate: &mut Substate,
tracer: &mut T,
vm_tracer: &mut V
) -> Result<FinalizationResult> where
T: Tracer,
V: VMTracer,
pub fn create<T, V>(
&mut self,
params: ActionParams,
substate: &mut Substate,
tracer: &mut T,
vm_tracer: &mut V
) -> Result<FinalizationResult> where
T: Tracer,
V: VMTracer,
Creates contract with given contract params.
Auto Trait Implementations
impl<'a, B> !RefUnwindSafe for Executive<'a, B>
impl<'a, B> Send for Executive<'a, B> where
B: Send,
impl<'a, B> !Sync for Executive<'a, B>
impl<'a, B> Unpin for Executive<'a, B>
impl<'a, B> !UnwindSafe for Executive<'a, B>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more