Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bump devnet, hotfix devnet create block #1219

Merged
merged 3 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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