Where: src/lib/indexer.ts, EventIndexer.poll() (around line 45-50)
What's wrong:
for (let seq = startLedger; seq <= endLedger; seq++) {
const ledgerTx = await client.getTransaction(seq.toString());
if (!ledgerTx || !("hash" in ledgerTx)) continue;
const txHash = "hash" in ledgerTx ? (ledgerTx as any).hash : "";
await this.processTransaction(client, txHash, seq);
}
Stellar RPC's getTransaction expects a transaction hash (a 64-char hex
string), not a ledger sequence number. Here it's called with seq.toString()
— i.e. something like "12345678" — for every ledger in the poll range. This
is not a valid transaction hash, so the RPC call will not resolve to a real
transaction; the response will not contain a hash field, the continue
branch fires every time, and processTransaction is never reached with real
data.
Impact: the event indexer — the feature tracked by issue #220 ("Build the
event indexer: ingest contract events into a queryable store") — never
actually discovers or ingests any real on-chain deposit/withdraw events. The
portfolio endpoint (GET /v1/portfolio/:address) and anything depending on
indexer.getEventsByAddress() reads from a store that stays empty.
Suggested fix: iterate actual transactions in the ledger range using the
correct RPC surface (e.g. enumerate transactions per ledger via
getLedgerEntries/an events API such as getEvents, or track transaction
hashes from submitted transactions rather than sequence numbers), and add a
regression test asserting the indexer advances its cursor by processing real
transaction hashes rather than looping ledger numbers into getTransaction.
Note: there is no src/__tests__/indexer.test.ts at all, so this path is
completely unexercised by the test suite (see the companion "Add tests for
lib/indexer.ts" issue).
Where:
src/lib/indexer.ts,EventIndexer.poll()(around line 45-50)What's wrong:
Stellar RPC's
getTransactionexpects a transaction hash (a 64-char hexstring), not a ledger sequence number. Here it's called with
seq.toString()— i.e. something like
"12345678"— for every ledger in the poll range. Thisis not a valid transaction hash, so the RPC call will not resolve to a real
transaction; the response will not contain a
hashfield, thecontinuebranch fires every time, and
processTransactionis never reached with realdata.
Impact: the event indexer — the feature tracked by issue #220 ("Build the
event indexer: ingest contract events into a queryable store") — never
actually discovers or ingests any real on-chain deposit/withdraw events. The
portfolio endpoint (
GET /v1/portfolio/:address) and anything depending onindexer.getEventsByAddress()reads from a store that stays empty.Suggested fix: iterate actual transactions in the ledger range using the
correct RPC surface (e.g. enumerate transactions per ledger via
getLedgerEntries/an events API such asgetEvents, or track transactionhashes from submitted transactions rather than sequence numbers), and add a
regression test asserting the indexer advances its cursor by processing real
transaction hashes rather than looping ledger numbers into
getTransaction.Note: there is no
src/__tests__/indexer.test.tsat all, so this path iscompletely unexercised by the test suite (see the companion "Add tests for
lib/indexer.ts" issue).