Call with no subcalls is nil instead of empty array for backwards compatibility
This commit is contained in:
parent
8212b2c5d9
commit
0c789b06dc
@ -63,14 +63,16 @@ func (t *FvmExecutionTrace) ToExecutionTrace() types.ExecutionTrace {
|
||||
Msg: t.Msg,
|
||||
MsgRct: t.MsgRct,
|
||||
Error: t.Error,
|
||||
Duration: 0,
|
||||
GasCharges: nil,
|
||||
Subcalls: make([]types.ExecutionTrace, len(t.Subcalls)),
|
||||
Subcalls: nil, // Should be nil when there are no subcalls for backwards compatibility
|
||||
}
|
||||
|
||||
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