aboutsummaryrefslogtreecommitdiffstats
path: root/packages/deployer
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-02-15 05:54:04 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-02-16 02:13:06 +0800
commitaf333b1838628fa0f8d393b19818224c15427106 (patch)
tree177312c7eeca8686b4a9666860ba83c9acc2be7b /packages/deployer
parentf62762bd0e5d3be443e412df1829c2d89ef4640e (diff)
downloaddexon-sol-tools-af333b1838628fa0f8d393b19818224c15427106.tar
dexon-sol-tools-af333b1838628fa0f8d393b19818224c15427106.tar.gz
dexon-sol-tools-af333b1838628fa0f8d393b19818224c15427106.tar.bz2
dexon-sol-tools-af333b1838628fa0f8d393b19818224c15427106.tar.lz
dexon-sol-tools-af333b1838628fa0f8d393b19818224c15427106.tar.xz
dexon-sol-tools-af333b1838628fa0f8d393b19818224c15427106.tar.zst
dexon-sol-tools-af333b1838628fa0f8d393b19818224c15427106.zip
Fix checks, add contract list to compile script in package.json
Diffstat (limited to 'packages/deployer')
-rw-r--r--packages/deployer/src/cli.ts2
-rw-r--r--packages/deployer/src/compiler.ts5
-rw-r--r--packages/deployer/test/deploy_test.ts1
-rw-r--r--packages/deployer/test/util/constants.ts1
4 files changed, 6 insertions, 3 deletions
diff --git a/packages/deployer/src/cli.ts b/packages/deployer/src/cli.ts
index 5e0f2145b..bc1ec8421 100644
--- a/packages/deployer/src/cli.ts
+++ b/packages/deployer/src/cli.ts
@@ -100,7 +100,7 @@ async function onDeployCommand(argv: CliOptions): Promise<void> {
function generateContractsToCompileSet(contracts: string): Set<string> {
const contractsToCompile = new Set();
const contractsArray = contracts.split(',');
- _.forEach(contracts, contractName => {
+ _.forEach(contractsArray, contractName => {
contractsToCompile.add(contractName);
});
return contractsToCompile;
diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts
index 4e5518d0e..beeda1260 100644
--- a/packages/deployer/src/compiler.ts
+++ b/packages/deployer/src/compiler.ts
@@ -139,6 +139,7 @@ export class Compiler {
const contractName = path.basename(contractBaseName, SOLIDITY_FILE_EXTENSION);
const currentArtifactPath = `${this._artifactsDir}/${contractName}.json`;
const sourceHash = `0x${ethUtil.sha3(source).toString('hex')}`;
+ const isContractSpecified = this._contractsToCompile.has(ALL_CONTRACTS_IDENTIFIER) || this._contractsToCompile.has(contractName);
let currentArtifactString: string;
let currentArtifact: ContractArtifact;
@@ -156,9 +157,9 @@ export class Compiler {
(_.isUndefined(oldNetwork) ||
oldNetwork.keccak256 !== sourceHash ||
oldNetwork.optimizer_enabled !== this._optimizerEnabled) &&
- (this._contractsToCompile.has(ALL_CONTRACTS_IDENTIFIER) || this._contractsToCompile.has(contractName));
+ isContractSpecified;
} catch (err) {
- shouldCompile = true;
+ shouldCompile = isContractSpecified;
}
if (!shouldCompile) {
diff --git a/packages/deployer/test/deploy_test.ts b/packages/deployer/test/deploy_test.ts
index 5fe2ffbd7..775a40cf6 100644
--- a/packages/deployer/test/deploy_test.ts
+++ b/packages/deployer/test/deploy_test.ts
@@ -18,6 +18,7 @@ const compilerOpts: CompilerOptions = {
contractsDir,
networkId: constants.networkId,
optimizerEnabled: constants.optimizerEnabled,
+ contractsToCompile: new Set(constants.contractsToCompile),
};
const compiler = new Compiler(compilerOpts);
const deployerOpts = {
diff --git a/packages/deployer/test/util/constants.ts b/packages/deployer/test/util/constants.ts
index d52076607..223bfed27 100644
--- a/packages/deployer/test/util/constants.ts
+++ b/packages/deployer/test/util/constants.ts
@@ -8,4 +8,5 @@ export const constants = {
timeoutMs: 20000,
zrxTokenAddress: '0xe41d2489571d322189246dafa5ebde1f4699f498',
tokenTransferProxyAddress: '0x8da0d80f5007ef1e431dd2127178d224e32c2ef4',
+ contractsToCompile: '*',
};