Skip to content

Commit

Permalink
Attempt to fix tilt error
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley committed Oct 27, 2023
1 parent 09d0a16 commit cac188c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sdk/js-query/src/query/ethCall.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ async function getEthCallByTimestampArgs(): Promise<[bigint, bigint, bigint]> {
let targetBlockNumber = BigInt(0);
let targetBlockTime = BigInt(0);
while (targetBlockNumber === BigInt(0)) {
const followingBlock = await web3.eth.getBlock(followingBlockNumber);
let followingBlock = await web3.eth.getBlock(followingBlockNumber);
while (Number(followingBlock) <= 0) {
await sleep(1000);
followingBlock = await web3.eth.getBlock(followingBlockNumber);
}
const targetBlock = await web3.eth.getBlock(
(Number(followingBlockNumber) - 1).toString()
);
Expand All @@ -86,6 +90,10 @@ async function getEthCallByTimestampArgs(): Promise<[bigint, bigint, bigint]> {
return [targetBlockTime, targetBlockNumber, followingBlockNumber];
}

function sleep(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}

describe("eth call", () => {
test("serialize request", () => {
const toAddress = "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270";
Expand Down

0 comments on commit cac188c

Please sign in to comment.