Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Support direct stripping of input in Call
Browse files Browse the repository at this point in the history
  • Loading branch information
sorpaas committed Apr 27, 2018
1 parent 8eb1161 commit 6af682a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ethcore/src/trace/executive_tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl Tracer for ExecutiveTracer {
type Output = FlatTrace;

fn prepare_trace_call(&self, params: &ActionParams) -> Option<Call> {
Some(Call::from(params.clone()))
Some(Call::from_action_params(params, true))
}

fn prepare_trace_create(&self, params: &ActionParams) -> Option<Create> {
Expand Down
16 changes: 8 additions & 8 deletions ethcore/src/trace/types/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,24 @@ pub struct Call {
pub call_type: CallType,
}

impl From<ActionParams> for Call {
fn from(p: ActionParams) -> Self {
match p.call_type {
CallType::DelegateCall => Call {
impl Call {
pub fn from_action_params(p: &ActionParams, record_input: bool) -> Self {
match &p.call_type {
&CallType::DelegateCall => Call {
from: p.address,
to: p.code_address,
value: p.value.value(),
gas: p.gas,
input: Some(p.data.unwrap_or_else(Vec::new)),
call_type: p.call_type,
input: if record_input { Some(p.data.clone().unwrap_or_else(Vec::new)) } else { None },
call_type: p.call_type.clone(),
},
_ => Call {
from: p.sender,
to: p.address,
value: p.value.value(),
gas: p.gas,
input: Some(p.data.unwrap_or_else(Vec::new)),
call_type: p.call_type,
input: if record_input { Some(p.data.clone().unwrap_or_else(Vec::new)) } else { None },
call_type: p.call_type.clone(),
},
}
}
Expand Down

0 comments on commit 6af682a

Please sign in to comment.