Move compiler URL to constants

This commit is contained in:
Leonid Logvinov
2018-03-09 15:31:19 +01:00
parent c7d340e822
commit ad4f607643
2 changed files with 2 additions and 1 deletions

View File

@@ -196,7 +196,7 @@ export class Compiler {
solcjs = fs.readFileSync(compilerBinFilename).toString();
} else {
utils.consoleLog(`Downloading ${fullSolcVersion}...`);
const url = `https://ethereum.github.io/solc-bin/bin/${fullSolcVersion}`;
const url = `${constants.BASE_COMPILER_URL}${fullSolcVersion}`;
const response = await fetch(url);
if (response.status !== 200) {
throw new Error(`Failed to load ${fullSolcVersion}`);

View File

@@ -1,3 +1,4 @@
export const constants = {
SOLIDITY_FILE_EXTENSION: '.sol',
BASE_COMPILER_URL: 'https://ethereum.github.io/solc-bin/bin/',
};