1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-07-04 12:03:41 +02:00

ship_processor.go: include TransactionID in action traces.

This commit is contained in:
Henrik Hautakoski 2022-11-29 05:37:11 +01:00
parent 4aa929ff16
commit f00b755e00

View file

@ -30,23 +30,24 @@ func processTraces(traces []*ship.TransactionTraceV0) {
// Actions // Actions
for _, actionTraceVar := range trace.ActionTraces { for _, actionTraceVar := range trace.ActionTraces {
trace := actionTraceVar.Impl.(*ship.ActionTraceV0) act_trace := actionTraceVar.Impl.(*ship.ActionTraceV0)
act := ActionTrace{ act := ActionTrace{
Receiver: trace.Receiver, TxID: trace.ID,
Contract: trace.Act.Account, Receiver: act_trace.Receiver,
Action: trace.Act.Name, Contract: act_trace.Act.Account,
Action: act_trace.Act.Name,
} }
abi, err := GetAbi(trace.Act.Account) abi, err := GetAbi(act_trace.Act.Account)
if err == nil { if err == nil {
v, err := DecodeAction(abi, trace.Act.Data, trace.Act.Name) v, err := DecodeAction(abi, act_trace.Act.Data, act_trace.Act.Name)
if err != nil { if err != nil {
log.WithError(err).Warn("Failed to decode action") log.WithError(err).Warn("Failed to decode action")
} }
act.Data = v act.Data = v
} else { } else {
log.WithError(err).Errorf("Failed to get abi for contract %s", trace.Act.Account) log.WithError(err).Errorf("Failed to get abi for contract %s", act_trace.Act.Account)
} }
payload, err := json.Marshal(act) payload, err := json.Marshal(act)