From 64d6dae672e71f6c81b472a58cb9c443607262c9 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 7 Feb 2019 12:58:46 +0100 Subject: Remove the bin_paths and fetch the solidity release list from github repo --- packages/sol-compiler/src/compiler.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'packages/sol-compiler/src/compiler.ts') diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index 686ba4f82..45608eb55 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -21,7 +21,6 @@ import * as semver from 'semver'; import solc = require('solc'); import { compilerOptionsSchema } from './schemas/compiler_options_schema'; -import { binPaths } from './solc/bin_paths'; import { addHexPrefixToContractBytecode, compileDockerAsync, @@ -29,6 +28,7 @@ import { createDirIfDoesNotExistAsync, getContractArtifactIfExistsAsync, getDependencyNameToPackagePath, + getSolcJSReleasesAsync, getSourcesWithDependencies, getSourceTreeHash, makeContractPathsRelative, @@ -211,6 +211,7 @@ export class Compiler { // map contract paths to data about them for later verification and persistence const contractPathToData: ContractPathToData = {}; + const solcJSReleases = await getSolcJSReleasesAsync(); const resolvedContractSources = []; for (const contractName of contractNames) { const spyResolver = new SpyResolver(this._resolver); @@ -226,7 +227,7 @@ export class Compiler { } contractPathToData[contractSource.path] = contractData; const solcVersion = _.isUndefined(this._solcVersionIfExists) - ? semver.maxSatisfying(_.keys(binPaths), parseSolidityVersionRange(contractSource.source)) + ? semver.maxSatisfying(_.keys(solcJSReleases), parseSolidityVersionRange(contractSource.source)) : this._solcVersionIfExists; const isFirstContractWithThisVersion = _.isUndefined(versionToInputs[solcVersion]); if (isFirstContractWithThisVersion) { @@ -272,7 +273,7 @@ export class Compiler { fullSolcVersion = versionCommandOutputParts[versionCommandOutputParts.length - 1].trim(); compilerOutput = await compileDockerAsync(solcVersion, input.standardInput); } else { - fullSolcVersion = binPaths[solcVersion]; + fullSolcVersion = solcJSReleases[solcVersion]; compilerOutput = await compileSolcJSAsync(solcVersion, input.standardInput); } if (!_.isUndefined(compilerOutput.errors)) { -- cgit v1.2.3