Skip to content

Commit

Permalink
fix: update release url for anvil-zksync and era-test-node releases
Browse files Browse the repository at this point in the history
  • Loading branch information
kiriyaga committed Dec 5, 2024
1 parent 6bfb1c2 commit b57b9cc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/hardhat-zksync-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"undici": "^6.18.2",
"sinon-chai": "^3.7.0",
"sinon": "^18.0.0",
"semver": "^7.6.2",
"source-map-support": "^0.5.21",
"debug": "^4.3.5"
},
Expand All @@ -50,6 +51,7 @@
"@types/fs-extra": "^11.0.4",
"@types/mocha": "^10.0.6",
"@types/node": "^18.11.17",
"@types/semver": "^7.5.8",
"@types/proxyquire": "^1.3.31",
"@types/sinon-chai": "^3.2.10",
"@typescript-eslint/eslint-plugin": "^7.12.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/hardhat-zksync-node/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type { Dispatcher } from 'undici';
import { getCompilersDir } from 'hardhat/internal/util/global-dir';
import { createProvider } from 'hardhat/internal/core/providers/construction';
import { HardhatConfig } from 'hardhat/types';
import semver from 'semver';

import {
ALLOWED_CACHE_VALUES,
Expand Down Expand Up @@ -200,7 +201,9 @@ export async function getNodeUrl(repo: string, release: string): Promise<string>
throw new ZkSyncNodePluginError(`Unsupported platform: ${platform}`);
}

return `${repo}/releases/download/v${release}/era_test_node-v${release}-${getArch()}-${platform}.tar.gz`;
return semver.gte(release, '0.1.0')
? `${repo}/releases/download/v${release}/anvil-zksync-v${release}-${getArch()}-${platform}.tar.gz`
: `${repo}/releases/download/v${release}/era_test_node-v${release}-${getArch()}-${platform}.tar.gz`;
}

function isTarGzFile(filePath: string): boolean {
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b57b9cc

Please sign in to comment.