Skip to content

Commit 67546c6

Browse files
committed
fix: waitForIndexer waiting for transactions that failed
1 parent 0611b81 commit 67546c6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/testing/transaction-logger.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ export class TransactionLogger {
4949
return new Proxy<Algodv2>(algod, new TransactionLoggingAlgodv2ProxyHandler(this))
5050
}
5151

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

0 commit comments

Comments
 (0)