From 18a2e6265d7dc07cb5a45b266bae84b2981fbc63 Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Mon, 26 Nov 2018 19:21:55 +0800 Subject: [PATCH] Make CALLCODE to trace value to be the code address (#9881) --- ethcore/src/state/mod.rs | 4 ++-- ethcore/src/trace/types/trace.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ethcore/src/state/mod.rs b/ethcore/src/state/mod.rs index 535a77938..e6a96a0e8 100644 --- a/ethcore/src/state/mod.rs +++ b/ethcore/src/state/mod.rs @@ -1593,7 +1593,7 @@ mod tests { } #[test] - fn should_not_trace_callcode() { + fn should_trace_callcode_properly() { init_log(); let mut state = get_temp_state(); @@ -1635,7 +1635,7 @@ mod tests { subtraces: 0, action: trace::Action::Call(trace::Call { from: 0xa.into(), - to: 0xa.into(), + to: 0xb.into(), value: 0.into(), gas: 4096.into(), input: vec![], diff --git a/ethcore/src/trace/types/trace.rs b/ethcore/src/trace/types/trace.rs index 1dde16e23..446fffb3a 100644 --- a/ethcore/src/trace/types/trace.rs +++ b/ethcore/src/trace/types/trace.rs @@ -71,7 +71,7 @@ pub struct Call { impl From for Call { fn from(p: ActionParams) -> Self { match p.call_type { - CallType::DelegateCall => Call { + CallType::DelegateCall | CallType::CallCode => Call { from: p.address, to: p.code_address, value: p.value.value(),