From 6d8c9f34a8f7698d928799f83c4ffcbe1bd1a265 Mon Sep 17 00:00:00 2001 From: Scott Twiname Date: Tue, 23 Apr 2024 15:47:59 +1200 Subject: [PATCH] Fix shaddowing issue with transactions --- eth/filters/api_subql.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eth/filters/api_subql.go b/eth/filters/api_subql.go index f139b302b33c..a738820d47f1 100644 --- a/eth/filters/api_subql.go +++ b/eth/filters/api_subql.go @@ -263,7 +263,7 @@ func (api *SubqlAPI) resolveFieldSelector(ctx context.Context, fieldSelector *Fi return nil } - logTxs := []ethapi.RPCTransaction{} + logTxs := []*ethapi.RPCTransaction{} txLogs := []*types.Log{} // Fill in transactions for logs @@ -275,7 +275,7 @@ func (api *SubqlAPI) resolveFieldSelector(ctx context.Context, fieldSelector *Fi if err != nil { return err } - logTxs = append(logTxs, rpcTx) + logTxs = append(logTxs, &rpcTx) } } } @@ -298,7 +298,7 @@ func (api *SubqlAPI) resolveFieldSelector(ctx context.Context, fieldSelector *Fi // Append after resolving so we don't resolve in a loop. e.g log -> transaction -> logs for _, tx := range logTxs { - block.Transactions[*tx.TransactionIndex] = &tx + block.Transactions[*tx.TransactionIndex] = tx } for _, log := range txLogs {