diff --git a/ethcore/src/substate.rs b/ethcore/src/substate.rs index 9e6d0cea2..0610bffb8 100644 --- a/ethcore/src/substate.rs +++ b/ethcore/src/substate.rs @@ -65,31 +65,6 @@ impl Substate { } } -impl TraceAction { - /// Compose a `TraceAction` from an `ActionParams`, knowing that the action is a call. - pub fn from_call(p: &ActionParams) -> TraceAction { - TraceAction::Call(TraceCall { - from: p.sender.clone(), - to: p.address.clone(), - value: match p.value { ActionValue::Transfer(ref x) | ActionValue::Apparent(ref x) => x.clone() }, - gas: p.gas.clone(), - input: p.data.clone().unwrap_or(vec![]), - result: None, - }) - } - - /// Compose a `TraceAction` from an `ActionParams`, knowing that the action is a create. - pub fn from_create(p: &ActionParams) -> TraceAction { - TraceAction::Create(TraceCreate { - from: p.sender.clone(), - value: match p.value { ActionValue::Transfer(ref x) | ActionValue::Apparent(ref x) => x.clone() }, - gas: p.gas.clone(), - init: p.code.clone().unwrap_or(vec![]), - result: None, - }) - } -} - #[cfg(test)] mod tests { use super::*; diff --git a/ethcore/src/trace.rs b/ethcore/src/trace.rs index 1f45e846f..858230bcd 100644 --- a/ethcore/src/trace.rs +++ b/ethcore/src/trace.rs @@ -83,3 +83,29 @@ impl Default for Trace { } } } + +impl TraceAction { + /// Compose a `TraceAction` from an `ActionParams`, knowing that the action is a call. + pub fn from_call(p: &ActionParams) -> TraceAction { + TraceAction::Call(TraceCall { + from: p.sender.clone(), + to: p.address.clone(), + value: match p.value { ActionValue::Transfer(ref x) | ActionValue::Apparent(ref x) => x.clone() }, + gas: p.gas.clone(), + input: p.data.clone().unwrap_or(vec![]), + result: None, + }) + } + + /// Compose a `TraceAction` from an `ActionParams`, knowing that the action is a create. + pub fn from_create(p: &ActionParams) -> TraceAction { + TraceAction::Create(TraceCreate { + from: p.sender.clone(), + value: match p.value { ActionValue::Transfer(ref x) | ActionValue::Apparent(ref x) => x.clone() }, + gas: p.gas.clone(), + init: p.code.clone().unwrap_or(vec![]), + result: None, + }) + } +} +