From 5d9ec470af59b49907bb2e4ceb80a4343c08f657 Mon Sep 17 00:00:00 2001 From: Ilya Mikheev <54912776+JkLondon@users.noreply.github.com> Date: Sat, 9 Nov 2024 04:22:16 +0100 Subject: [PATCH] debug_traceCallMany -1 txindex support (fixed) (#12688) closes #12653 --------- Co-authored-by: JkLondon --- turbo/jsonrpc/tracing.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/turbo/jsonrpc/tracing.go b/turbo/jsonrpc/tracing.go index 00bde52a10c..032c42eaa62 100644 --- a/turbo/jsonrpc/tracing.go +++ b/turbo/jsonrpc/tracing.go @@ -503,6 +503,10 @@ func (api *PrivateDebugAPIImpl) TraceCallMany(ctx context.Context, bundles []Bun transactionIndex = *simulateContext.TransactionIndex } + if transactionIndex == -1 { + transactionIndex = len(block.Transactions()) + } + stateReader, err := rpchelper.CreateStateReader(ctx, tx, api._blockReader, rpc.BlockNumberOrHashWithNumber(rpc.BlockNumber(blockNum-1)), transactionIndex, api.filters, api.stateCache, chainConfig.ChainName) if err != nil { stream.WriteNil()