From 5b43a0baf6a323d7e1188b06d16aae4be620befd Mon Sep 17 00:00:00 2001 From: Matthieu Vachon Date: Fri, 9 Aug 2024 02:12:12 -0400 Subject: [PATCH] Fixed when transaction is processed on synchronous algorithm and has post deliver tx hook --- x/evm/tracers/firehose.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/x/evm/tracers/firehose.go b/x/evm/tracers/firehose.go index 9855429f7..163579583 100644 --- a/x/evm/tracers/firehose.go +++ b/x/evm/tracers/firehose.go @@ -780,9 +780,15 @@ func (f *Firehose) OnSeiPostTxCosmosEvents(event seitracing.SeiPostTxCosmosEvent firehoseInfo("post tx cosmos events on EVM transaction (tracer=%s, added_logs=%d, isolated=%t)", f.tracerID, len(event.AddedLogs), f.transactionIsolated) - transaction := f.transaction + var transaction *pbeth.TransactionTrace if f.transactionIsolated { transaction = f.transientTransaction + } else { + if len(f.block.TransactionTraces) == 0 { + f.panicInvalidState("block must have at least one transaction at this point", 1) + } + + transaction = f.block.TransactionTraces[len(f.block.TransactionTraces)-1] } if transaction == nil {