diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-02-07 19:58:46 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-02-07 19:58:46 +0800 |
commit | 64d6dae672e71f6c81b472a58cb9c443607262c9 (patch) | |
tree | 18613efe6d28ddc0f2dd95535d93043108902e2f /packages/sol-compiler/src/compiler.ts | |
parent | c20285dd3655a9685b52205229e675c797cd4418 (diff) | |
download | dexon-0x-contracts-64d6dae672e71f6c81b472a58cb9c443607262c9.tar dexon-0x-contracts-64d6dae672e71f6c81b472a58cb9c443607262c9.tar.gz dexon-0x-contracts-64d6dae672e71f6c81b472a58cb9c443607262c9.tar.bz2 dexon-0x-contracts-64d6dae672e71f6c81b472a58cb9c443607262c9.tar.lz dexon-0x-contracts-64d6dae672e71f6c81b472a58cb9c443607262c9.tar.xz dexon-0x-contracts-64d6dae672e71f6c81b472a58cb9c443607262c9.tar.zst dexon-0x-contracts-64d6dae672e71f6c81b472a58cb9c443607262c9.zip |
Remove the bin_paths and fetch the solidity release list from github repo
Diffstat (limited to 'packages/sol-compiler/src/compiler.ts')
-rw-r--r-- | packages/sol-compiler/src/compiler.ts | 7 |
1 files changed, 4 insertions, 3 deletions
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)) { |