diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-05-07 19:49:21 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-05-07 19:49:21 +0800 |
commit | fcb0a05880f6217f5b5942ec419fcf4df490551d (patch) | |
tree | facd03b8a252dba40b6c5e497ab71173b2f4a100 /packages/deployer/src/compiler.ts | |
parent | fad7dc9f04f39e754ac0ec437736c7bee33fa28e (diff) | |
download | dexon-sol-tools-fcb0a05880f6217f5b5942ec419fcf4df490551d.tar dexon-sol-tools-fcb0a05880f6217f5b5942ec419fcf4df490551d.tar.gz dexon-sol-tools-fcb0a05880f6217f5b5942ec419fcf4df490551d.tar.bz2 dexon-sol-tools-fcb0a05880f6217f5b5942ec419fcf4df490551d.tar.lz dexon-sol-tools-fcb0a05880f6217f5b5942ec419fcf4df490551d.tar.xz dexon-sol-tools-fcb0a05880f6217f5b5942ec419fcf4df490551d.tar.zst dexon-sol-tools-fcb0a05880f6217f5b5942ec419fcf4df490551d.zip |
Improve the readability of the check for should compile
Diffstat (limited to 'packages/deployer/src/compiler.ts')
-rw-r--r-- | packages/deployer/src/compiler.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts index db06ccf43..e81df3c0a 100644 --- a/packages/deployer/src/compiler.ts +++ b/packages/deployer/src/compiler.ts @@ -131,10 +131,10 @@ export class Compiler { shouldCompile = true; } else { const currentArtifact = currentArtifactIfExists as ContractArtifact; - shouldCompile = - currentArtifact.schemaVersion !== '2.0.0' || - !_.isEqual(currentArtifact.compiler.settings, this._compilerSettings) || - currentArtifact.sourceTreeHashHex !== sourceTreeHashHex; + const isUserOnLatestVersion = currentArtifact.schemaVersion === constants.LATEST_ARTIFACT_VERSION; + const didCompilerSettingsChange = !_.isEqual(currentArtifact.compiler.settings, this._compilerSettings); + const didSourceChange = currentArtifact.sourceTreeHashHex !== sourceTreeHashHex; + shouldCompile = isUserOnLatestVersion || didCompilerSettingsChange || didSourceChange; } if (!shouldCompile) { return; @@ -228,7 +228,7 @@ export class Compiler { }; } else { newArtifact = { - schemaVersion: '2.0.0', + schemaVersion: constants.LATEST_ARTIFACT_VERSION, contractName, ...contractVersion, networks: {}, |