Skip to content

Commit

Permalink
add api blocks/highest
Browse files Browse the repository at this point in the history
  • Loading branch information
canonbrother committed Jan 25, 2024
1 parent dfcd165 commit 0b40e44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions apps/whale-api/src/e2e.defid.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ export class DBlockController extends DefidOceanController {
}
return await this.api.get(`/blocks/${hash}/transactions?size=${query.size}`)
}

async count (): Promise<number> {
return await this.api.get('/blocks/highest')
}
}

export class DFeeController extends DefidOceanController {
Expand Down
7 changes: 3 additions & 4 deletions apps/whale-api/src/e2e.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,9 @@ export async function waitForIndexedHeightLatest (app: NestFastifyApplication, c
export async function waitForIndexedHeight (app: NestFastifyApplication | DefidBin, height: number, timeout: number = 30000): Promise<void> {
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)
Expand Down

0 comments on commit 0b40e44

Please sign in to comment.