Skip to content

Commit

Permalink
fix: waitForIndexer waiting for transactions that failed
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-p committed Dec 16, 2024
1 parent 0611b81 commit 67546c6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/testing/transaction-logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ export class TransactionLogger {
return new Proxy<Algodv2>(algod, new TransactionLoggingAlgodv2ProxyHandler(this))
}

/** Wait until all logged transactions IDs appear in the given `Indexer`. */
async waitForIndexer(indexer: Indexer) {
await Promise.all(this._sentTransactionIds.map((txnId) => runWhenIndexerCaughtUp(() => indexer.lookupTransactionByID(txnId).do())))
/** Wait until indexer has the last round from algod. */
async waitForIndexer(algod: Algodv2, indexer: Indexer) {
const round = (await algod.status().do()).lastRound
await runWhenIndexerCaughtUp(() => indexer.lookupBlock(round).do())
}
}

Expand Down

0 comments on commit 67546c6

Please sign in to comment.