diff --git a/apps/whale-api/src/e2e.defid.module.ts b/apps/whale-api/src/e2e.defid.module.ts index 29b832437a..03aa295685 100644 --- a/apps/whale-api/src/e2e.defid.module.ts +++ b/apps/whale-api/src/e2e.defid.module.ts @@ -159,6 +159,10 @@ export class DBlockController extends DefidOceanController { } return await this.api.get(`/blocks/${hash}/transactions?size=${query.size}`) } + + async count (): Promise { + return await this.api.get('/blocks/highest') + } } export class DFeeController extends DefidOceanController { diff --git a/apps/whale-api/src/e2e.module.ts b/apps/whale-api/src/e2e.module.ts index ed3db5edf3..3f41bf6dab 100644 --- a/apps/whale-api/src/e2e.module.ts +++ b/apps/whale-api/src/e2e.module.ts @@ -86,10 +86,9 @@ export async function waitForIndexedHeightLatest (app: NestFastifyApplication, c export async function waitForIndexedHeight (app: NestFastifyApplication | DefidBin, height: number, timeout: number = 30000): Promise { if (app instanceof DefidBin) { await waitForExpect(async () => { - // TODO(canonbrother): ocean getblockcount - // const count = await app.ocean.getBlockCount() - // expect(count).toBeGreaterThan(height) - // await app.rpc.generate(1) + const count = await app.ocean.blockController.count() + expect(count).toBeGreaterThan(height) + await app.rpc.generate(1) }, timeout) } else { const blockMapper = app.get(BlockMapper)