Merge pull request #8804 from filecoin-project/gstuart/exec-trace-consistency
Fix: state: Set exec trace subcalls to nil when appropriate
This commit is contained in:
commit
0e5e5f49df
@ -60,16 +60,18 @@ func (t *FvmExecutionTrace) ToExecutionTrace() types.ExecutionTrace {
|
||||
}
|
||||
|
||||
ret := types.ExecutionTrace{
|
||||
Msg: t.Msg,
|
||||
MsgRct: t.MsgRct,
|
||||
Error: t.Error,
|
||||
Duration: 0,
|
||||
GasCharges: nil,
|
||||
Subcalls: make([]types.ExecutionTrace, len(t.Subcalls)),
|
||||
Msg: t.Msg,
|
||||
MsgRct: t.MsgRct,
|
||||
Error: t.Error,
|
||||
Subcalls: nil, // Should be nil when there are no subcalls for backwards compatibility
|
||||
}
|
||||
|
||||
for i, v := range t.Subcalls {
|
||||
ret.Subcalls[i] = v.ToExecutionTrace()
|
||||
if len(t.Subcalls) > 0 {
|
||||
ret.Subcalls = make([]types.ExecutionTrace, len(t.Subcalls))
|
||||
|
||||
for i, v := range t.Subcalls {
|
||||
ret.Subcalls[i] = v.ToExecutionTrace()
|
||||
}
|
||||
}
|
||||
|
||||
return ret
|
||||
|
Loading…
Reference in New Issue
Block a user