mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-03 11:53:41 +02:00
Merge branch 'abi-decode-improved-logging'
This commit is contained in:
commit
3c05a4b5be
1 changed files with 9 additions and 3 deletions
|
|
@ -126,6 +126,8 @@ func (processor *ShipProcessor) processBlock(block *ship.GetBlocksResultV0) {
|
||||||
if block.Traces != nil && len(block.Traces.Elem) > 0 {
|
if block.Traces != nil && len(block.Traces.Elem) > 0 {
|
||||||
for _, trace := range block.Traces.AsTransactionTracesV0() {
|
for _, trace := range block.Traces.AsTransactionTracesV0() {
|
||||||
|
|
||||||
|
logger := log.WithField("tx_id", trace.ID.String())
|
||||||
|
|
||||||
processor.encodeQueue(api.TransactionChannel, trace)
|
processor.encodeQueue(api.TransactionChannel, trace)
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
|
|
@ -156,7 +158,7 @@ func (processor *ShipProcessor) processBlock(block *ship.GetBlocksResultV0) {
|
||||||
if act_trace.Act.Account == processor.syscontract && act_trace.Act.Name == eos.ActionName("setabi") {
|
if act_trace.Act.Account == processor.syscontract && act_trace.Act.Name == eos.ActionName("setabi") {
|
||||||
err := processor.updateAbiFromAction(act_trace.Act)
|
err := processor.updateAbiFromAction(act_trace.Act)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithError(err).Warn("Failed to update abi")
|
logger.WithError(err).Warn("Failed to update abi")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -179,10 +181,14 @@ func (processor *ShipProcessor) processBlock(block *ship.GetBlocksResultV0) {
|
||||||
ABI, err := processor.abi.GetAbi(act_trace.Act.Account)
|
ABI, err := processor.abi.GetAbi(act_trace.Act.Account)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if err = decode(ABI, act_trace.Act, &act.Data); err != nil {
|
if err = decode(ABI, act_trace.Act, &act.Data); err != nil {
|
||||||
log.WithError(err).Warn("Failed to decode action")
|
logger.WithFields(log.Fields{
|
||||||
|
"contract": act_trace.Act.Account,
|
||||||
|
"action": act_trace.Act.Name,
|
||||||
|
}).WithError(err).Warn("Failed to decode action")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.WithError(err).Errorf("Failed to get abi for contract %s", act_trace.Act.Account)
|
logger.WithField("contract", act_trace.Act.Account).
|
||||||
|
WithError(err).Errorf("Failed to get abi for contract %s", act_trace.Act.Account)
|
||||||
}
|
}
|
||||||
|
|
||||||
payload, err := processor.encode(act)
|
payload, err := processor.encode(act)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue