forked from cerc-io/laconicd-deprecated
fix(evm): TxIndex is wrong when trace is the first tx of a block (#1187)
* Fix TxIndex wrongly when trace first Tx of a block If `Predecessors` is empty, `txConfig.TxIndex` originally = 0 and when it reachs line 401 `txConfig.TxIndex++`, it will becomes 1. It should be 0 * apply suggestion and add change-log * fix comment Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
co-authored by
Federico Kunze Küllmer
parent
ffe78da36e
commit
cd41c48075
@@ -398,7 +398,10 @@ func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*typ
|
||||
|
||||
tx := req.Msg.AsTransaction()
|
||||
txConfig.TxHash = tx.Hash()
|
||||
txConfig.TxIndex++
|
||||
if len(req.Predecessors) > 0 {
|
||||
txConfig.TxIndex++
|
||||
}
|
||||
|
||||
result, _, err := k.traceTx(ctx, cfg, txConfig, signer, tx, req.TraceConfig, false)
|
||||
if err != nil {
|
||||
// error will be returned with detail status from traceTx
|
||||
|
||||
Reference in New Issue
Block a user