Skip to content

Commit

Permalink
Merge branch 'develop' into chore/types-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasaric committed Sep 5, 2024
2 parents 17c2c87 + aac437b commit 025eb93
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# TODO - periodically check if conditional services are supported; https://github.com/actions/runner/issues/822
services:
devnet:
image: ${{ (inputs.use-devnet) && 'shardlabs/starknet-devnet-rs:0.1.2-seed0' || '' }}
image: ${{ (inputs.use-devnet) && 'shardlabs/starknet-devnet-rs:0.2.0-rc.2' || '' }}
ports:
- 5050:5050

Expand Down
13 changes: 11 additions & 2 deletions __tests__/config/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,21 @@ export const getTestAccount = (provider: ProviderInterface) => {

export const createBlockForDevnet = async (): Promise<void> => {
if (!(process.env.IS_DEVNET === 'true')) return;
await fetch(new URL('/create_block', process.env.TEST_RPC_URL), { method: 'POST' });
const response = await fetch(new URL('/create_block', process.env.TEST_RPC_URL), {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: '{}',
});

if (!response.ok) {
const errorText = await response.text();
throw new Error(`DEVNET status ${response.status}: ${errorText}`);
}
};

export async function waitNextBlock(provider: RpcProvider, delay: number) {
const initBlock = await provider.getBlockNumber();
createBlockForDevnet();
await createBlockForDevnet();
let isNewBlock: boolean = false;
while (!isNewBlock) {
// eslint-disable-next-line no-await-in-loop
Expand Down

0 comments on commit 025eb93

Please sign in to comment.