runWhenIndexerCaughtUp
runWhenIndexerCaughtUp<
T>(run):Promise<T>
Defined in: src/testing/indexer.ts:12
Runs the given indexer call until a 404 error is no longer returned. Tried every 200ms up to 100 times. Very rudimentary implementation designed for automated testing.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”() => Promise<T>
The code to run
Returns
Section titled “Returns”Promise<T>
The result (as a promise), or throws if the indexer didn’t catch up in time
Example
Section titled “Example”const transaction = await runWhenIndexerCaughtUp(() => indexer.lookupTransactionByID(txnId).do())