Call with no subcalls is nil instead of empty array for backwards compatibility
This commit is contained in:
parent
8212b2c5d9
commit
0c789b06dc
@ -60,16 +60,18 @@ func (t *FvmExecutionTrace) ToExecutionTrace() types.ExecutionTrace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret := types.ExecutionTrace{
|
ret := types.ExecutionTrace{
|
||||||
Msg: t.Msg,
|
Msg: t.Msg,
|
||||||
MsgRct: t.MsgRct,
|
MsgRct: t.MsgRct,
|
||||||
Error: t.Error,
|
Error: t.Error,
|
||||||
Duration: 0,
|
Subcalls: nil, // Should be nil when there are no subcalls for backwards compatibility
|
||||||
GasCharges: nil,
|
|
||||||
Subcalls: make([]types.ExecutionTrace, len(t.Subcalls)),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for i, v := range t.Subcalls {
|
if len(t.Subcalls) > 0 {
|
||||||
ret.Subcalls[i] = v.ToExecutionTrace()
|
ret.Subcalls = make([]types.ExecutionTrace, len(t.Subcalls))
|
||||||
|
|
||||||
|
for i, v := range t.Subcalls {
|
||||||
|
ret.Subcalls[i] = v.ToExecutionTrace()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
Loading…
Reference in New Issue
Block a user