diff --git a/common/changes/@subsquid/tron-data/master_2024-10-15-07-18.json b/common/changes/@subsquid/tron-data/master_2024-10-15-07-18.json new file mode 100644 index 000000000..987510536 --- /dev/null +++ b/common/changes/@subsquid/tron-data/master_2024-10-15-07-18.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@subsquid/tron-data", + "comment": "fix missing transactions info", + "type": "patch" + } + ], + "packageName": "@subsquid/tron-data" +} \ No newline at end of file diff --git a/common/changes/@subsquid/tron-processor/master_2024-10-15-07-18.json b/common/changes/@subsquid/tron-processor/master_2024-10-15-07-18.json new file mode 100644 index 000000000..8fb4cf735 --- /dev/null +++ b/common/changes/@subsquid/tron-processor/master_2024-10-15-07-18.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@subsquid/tron-processor", + "comment": "handle transactions with no logs", + "type": "patch" + } + ], + "packageName": "@subsquid/tron-processor" +} \ No newline at end of file diff --git a/tron/tron-data/src/data-source.ts b/tron/tron-data/src/data-source.ts index 4aa43fc57..823ed9746 100644 --- a/tron/tron-data/src/data-source.ts +++ b/tron/tron-data/src/data-source.ts @@ -189,7 +189,7 @@ export class HttpDataSource { } if (req.request.transactionsInfo) { - this.addTransactionsInfo(blocks) + await this.addTransactionsInfo(blocks) } return blocks diff --git a/tron/tron-processor/src/http/filter.ts b/tron/tron-processor/src/http/filter.ts index 9de594f73..6f1dfdc7d 100644 --- a/tron/tron-processor/src/http/filter.ts +++ b/tron/tron-processor/src/http/filter.ts @@ -121,7 +121,7 @@ export function filterBlock(block: Block, dataRequest: DataRequest): void { let include = new IncludeSet() let transactions = new Map(block.transactions.map(tx => [tx.transactionIndex, tx])) - let internalTxByTx = groupBy(block.internalTransactions, input => input.transactionIndex) + let internalTxByTx = groupBy(block.internalTransactions, internalTx => internalTx.transactionIndex) let logsByTx = groupBy(block.logs, log => log.transactionIndex) if (items.logs.present()) { @@ -142,13 +142,13 @@ export function filterBlock(block: Block, dataRequest: DataRequest): void { if (rel == null) continue include.addTransaction(tx) if (rel.logs) { - let logs = assertNotNull(logsByTx.get(tx.transactionIndex)) + let logs = logsByTx.get(tx.transactionIndex) ?? [] for (let log of logs) { include.addLog(log) } } if (rel.internalTransactions) { - let internalTxs = assertNotNull(internalTxByTx.get(tx.transactionIndex)) + let internalTxs = internalTxByTx.get(tx.transactionIndex) ?? [] for (let internalTx of internalTxs) { include.addInternalTransaction(internalTx) }