mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-03 11:53:41 +02:00
app/ship_processor.go: Post transaction message using message.Transaction struct.
This commit is contained in:
parent
547d53a6a2
commit
f7c3d30e8e
1 changed files with 17 additions and 1 deletions
|
|
@ -128,7 +128,19 @@ func (processor *ShipProcessor) processBlock(block *ship.GetBlocksResultV0) {
|
||||||
|
|
||||||
logger := log.WithField("tx_id", trace.ID.String())
|
logger := log.WithField("tx_id", trace.ID.String())
|
||||||
|
|
||||||
processor.encodeQueue(api.TransactionChannel, trace)
|
transaction := message.TransactionTrace{
|
||||||
|
ID: trace.ID.String(),
|
||||||
|
BlockNum: block.Block.BlockNumber(),
|
||||||
|
Timestamp: block.Block.Timestamp.Time.UTC(),
|
||||||
|
Status: trace.Status.String(),
|
||||||
|
CPUUsageUS: trace.CPUUsageUS,
|
||||||
|
NetUsage: trace.NetUsage,
|
||||||
|
NetUsageWords: uint32(trace.NetUsageWords),
|
||||||
|
Elapsed: int64(trace.Elapsed),
|
||||||
|
Scheduled: trace.Scheduled,
|
||||||
|
Except: trace.Except,
|
||||||
|
Error: trace.ErrorCode,
|
||||||
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
for _, actionTraceVar := range trace.ActionTraces {
|
for _, actionTraceVar := range trace.ActionTraces {
|
||||||
|
|
@ -215,6 +227,8 @@ func (processor *ShipProcessor) processBlock(block *ship.GetBlocksResultV0) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transaction.ActionTraces = append(transaction.ActionTraces, act)
|
||||||
|
|
||||||
channels := []api.Channel{
|
channels := []api.Channel{
|
||||||
api.ActionChannel{}.Channel(),
|
api.ActionChannel{}.Channel(),
|
||||||
api.ActionChannel{Name: act.Name}.Channel(),
|
api.ActionChannel{Name: act.Name}.Channel(),
|
||||||
|
|
@ -226,6 +240,8 @@ func (processor *ShipProcessor) processBlock(block *ship.GetBlocksResultV0) {
|
||||||
processor.queueMessage(channel, payload)
|
processor.queueMessage(channel, payload)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
processor.encodeQueue(api.TransactionChannel, transaction)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue