Skip to content

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.

T

() => Promise<T>

The code to run

Promise<T>

The result (as a promise), or throws if the indexer didn’t catch up in time

const transaction = await runWhenIndexerCaughtUp(() => indexer.lookupTransactionByID(txnId).do())