Make CALLCODE to trace value to be the code address (#9881)

This commit is contained in:
Wei Tang 2018-11-26 19:21:55 +08:00 committed by Afri Schoedon
parent 0d593199d0
commit 18a2e6265d
2 changed files with 3 additions and 3 deletions

View File

@ -1593,7 +1593,7 @@ mod tests {
} }
#[test] #[test]
fn should_not_trace_callcode() { fn should_trace_callcode_properly() {
init_log(); init_log();
let mut state = get_temp_state(); let mut state = get_temp_state();
@ -1635,7 +1635,7 @@ mod tests {
subtraces: 0, subtraces: 0,
action: trace::Action::Call(trace::Call { action: trace::Action::Call(trace::Call {
from: 0xa.into(), from: 0xa.into(),
to: 0xa.into(), to: 0xb.into(),
value: 0.into(), value: 0.into(),
gas: 4096.into(), gas: 4096.into(),
input: vec![], input: vec![],

View File

@ -71,7 +71,7 @@ pub struct Call {
impl From<ActionParams> for Call { impl From<ActionParams> for Call {
fn from(p: ActionParams) -> Self { fn from(p: ActionParams) -> Self {
match p.call_type { match p.call_type {
CallType::DelegateCall => Call { CallType::DelegateCall | CallType::CallCode => Call {
from: p.address, from: p.address,
to: p.code_address, to: p.code_address,
value: p.value.value(), value: p.value.value(),