Grab bag of cleanup (#11504)

Formatting, docs, pass TransactOptions instead of tracers.
This commit is contained in:
David
2020-02-19 16:12:27 +01:00
committed by GitHub
parent 06df521eff
commit fa0c1efb8d
5 changed files with 34 additions and 33 deletions

View File

@@ -154,13 +154,12 @@ pub trait ExecutiveState {
/// Execute a given transaction with given tracer and VM tracer producing a receipt and an optional trace.
/// This will change the state accordingly.
fn apply_with_tracing<V, T>(
fn apply_with_tracing<T, V>(
&mut self,
env_info: &EnvInfo,
machine: &Machine,
t: &SignedTransaction,
tracer: T,
vm_tracer: V,
options: TransactOptions<T, V>,
) -> ApplyResult<T::Output, V::Output>
where
T: trace::Tracer,
@@ -179,28 +178,26 @@ impl<B: Backend> ExecutiveState for State<B> {
) -> ApplyResult<FlatTrace, VMTrace> {
if tracing {
let options = TransactOptions::with_tracing();
self.apply_with_tracing(env_info, machine, t, options.tracer, options.vm_tracer)
self.apply_with_tracing(env_info, machine, t, options)
} else {
let options = TransactOptions::with_no_tracing();
self.apply_with_tracing(env_info, machine, t, options.tracer, options.vm_tracer)
self.apply_with_tracing(env_info, machine, t, options)
}
}
/// Execute a given transaction with given tracer and VM tracer producing a receipt and an optional trace.
/// This will change the state accordingly.
fn apply_with_tracing<V, T>(
fn apply_with_tracing<T, V>(
&mut self,
env_info: &EnvInfo,
machine: &Machine,
t: &SignedTransaction,
tracer: T,
vm_tracer: V,
options: TransactOptions<T, V>
) -> ApplyResult<T::Output, V::Output>
where
T: trace::Tracer,
V: trace::VMTracer,
{
let options = TransactOptions::new(tracer, vm_tracer);
let e = execute(self, env_info, machine, t, options, false)?;
let params = machine.params();