Fix TxIndex wrongly when trace first Tx of a block (backport #1187) by mergify[bot] · Pull Request #1195 · evmos/ethermint

@VictorTrustyDev @mergify

…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>
(cherry picked from commit cd41c48)

# Conflicts:
#	CHANGELOG.md

@fedekunze

@fedekunze fedekunze deleted the mergify/bp/release/v0.17.x/pr-1187 branch

July 20, 2022 15:53

hoanguyenkh pushed a commit to AstraProtocol/ethermint that referenced this pull request

Jul 27, 2022
…ackport evmos#1187) (evmos#1195)

* fix(evm): `TxIndex` is wrong when trace is the first tx of a block (evmos#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>
(cherry picked from commit cd41c48)

# Conflicts:
#	CHANGELOG.md

* fix RPC

Co-authored-by: Victor Pham <me@victortrusty.dev>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>