Track depth.

This commit is contained in:
Gav Wood
2016-03-19 14:35:09 +01:00
parent 152f132b7b
commit bd7cd68c32
3 changed files with 16 additions and 11 deletions

View File

@@ -50,14 +50,15 @@ impl Substate {
}
/// Merge secondary substate `s` into self, accruing each element correspondingly.
pub fn accrue(&mut self, s: Substate, maybe_action: Option<TraceAction>) {
pub fn accrue(&mut self, s: Substate, maybe_info: Option<(TraceAction, usize)>) {
self.suicides.extend(s.suicides.into_iter());
self.logs.extend(s.logs.into_iter());
self.sstore_clears_count = self.sstore_clears_count + s.sstore_clears_count;
self.contracts_created.extend(s.contracts_created.into_iter());
if let Some(action) = maybe_action {
if let Some(info) = maybe_info {
self.subtraces.as_mut().expect("maybe_action is Some: so we must be tracing: qed").push(Trace {
action: action,
action: info.0,
depth: info.1,
subs: s.subtraces.expect("maybe_action is Some: so we must be tracing: qed"),
});
}