aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-compiler/src/compiler.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-07-19 23:48:06 +0800
committerFabio Berger <me@fabioberger.com>2018-07-19 23:48:06 +0800
commitd8898cf9a30cc349868afcf2b78e6369e57aa726 (patch)
treef96d1aa76c7e5aa9e3311d5cdbd0d31c8ec8d7fb /packages/sol-compiler/src/compiler.ts
parent1aaf633df883f62fad890b2d87a2dc89067821c5 (diff)
parent3de88d5345c7a4549bc69e2ca28f0601f5d42189 (diff)
downloaddexon-sol-tools-d8898cf9a30cc349868afcf2b78e6369e57aa726.tar
dexon-sol-tools-d8898cf9a30cc349868afcf2b78e6369e57aa726.tar.gz
dexon-sol-tools-d8898cf9a30cc349868afcf2b78e6369e57aa726.tar.bz2
dexon-sol-tools-d8898cf9a30cc349868afcf2b78e6369e57aa726.tar.lz
dexon-sol-tools-d8898cf9a30cc349868afcf2b78e6369e57aa726.tar.xz
dexon-sol-tools-d8898cf9a30cc349868afcf2b78e6369e57aa726.tar.zst
dexon-sol-tools-d8898cf9a30cc349868afcf2b78e6369e57aa726.zip
merge v2-prototype
Diffstat (limited to 'packages/sol-compiler/src/compiler.ts')
-rw-r--r--packages/sol-compiler/src/compiler.ts19
1 files changed, 9 insertions, 10 deletions
diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts
index bb701a8ce..3620a3ec1 100644
--- a/packages/sol-compiler/src/compiler.ts
+++ b/packages/sol-compiler/src/compiler.ts
@@ -8,11 +8,10 @@ import {
Resolver,
URLResolver,
} from '@0xproject/sol-resolver';
-import { logUtils } from '@0xproject/utils';
+import { fetchAsync, logUtils } from '@0xproject/utils';
import chalk from 'chalk';
import * as ethUtil from 'ethereumjs-util';
import * as fs from 'fs';
-import 'isomorphic-fetch';
import * as _ from 'lodash';
import * as path from 'path';
import * as requireFromString from 'require-from-string';
@@ -59,13 +58,13 @@ const CONFIG_FILE = 'compiler.json';
* to artifact files.
*/
export class Compiler {
- private _resolver: Resolver;
- private _nameResolver: NameResolver;
- private _contractsDir: string;
- private _compilerSettings: solc.CompilerSettings;
- private _artifactsDir: string;
- private _solcVersionIfExists: string | undefined;
- private _specifiedContracts: string[] | TYPE_ALL_FILES_IDENTIFIER;
+ private readonly _resolver: Resolver;
+ private readonly _nameResolver: NameResolver;
+ private readonly _contractsDir: string;
+ private readonly _compilerSettings: solc.CompilerSettings;
+ private readonly _artifactsDir: string;
+ private readonly _solcVersionIfExists: string | undefined;
+ private readonly _specifiedContracts: string[] | TYPE_ALL_FILES_IDENTIFIER;
/**
* Instantiates a new instance of the Compiler class.
* @return An instance of the Compiler class.
@@ -149,7 +148,7 @@ export class Compiler {
} else {
logUtils.log(`Downloading ${fullSolcVersion}...`);
const url = `${constants.BASE_COMPILER_URL}${fullSolcVersion}`;
- const response = await fetch(url);
+ const response = await fetchAsync(url);
const SUCCESS_STATUS = 200;
if (response.status !== SUCCESS_STATUS) {
throw new Error(`Failed to load ${fullSolcVersion}`);