Skip to content

Commit

Permalink
chore: check if wasm compiler is already downloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh committed Jan 9, 2025
1 parent 22389d6 commit d341544
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,18 @@ export async function downloadConfiguredCompilers(
await wasmCompilerDownloader.updateCompilerListIfNeeded(versions);

for (const version of versions) {
if (!quiet) {
console.log(`Downloading solc ${version} (WASM build)`);
}
if (!(await wasmCompilerDownloader.isCompilerDownloaded(version))) {
if (!quiet) {
console.log(`Downloading solc ${version} (WASM build)`);
}

const success = await wasmCompilerDownloader.downloadCompiler(version);
const success = await wasmCompilerDownloader.downloadCompiler(version);

if (!success) {
throw new HardhatError(HardhatError.ERRORS.SOLIDITY.DOWNLOAD_FAILED, {
remoteVersion: version,
});
if (!success) {
throw new HardhatError(HardhatError.ERRORS.SOLIDITY.DOWNLOAD_FAILED, {
remoteVersion: version,
});
}
}
}
}
Expand Down

0 comments on commit d341544

Please sign in to comment.