aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-compiler/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2019-02-04 17:12:49 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2019-02-04 17:38:02 +0800
commit6943bbcacbd9a1df0cdddb2696a768aec4b3d2c4 (patch)
tree768bb7240b510a8e9f0c735ae658497583160627 /packages/sol-compiler/src
parent1d3fff32a29b4e958cd32acb016577683df95d3d (diff)
downloaddexon-0x-contracts-6943bbcacbd9a1df0cdddb2696a768aec4b3d2c4.tar.gz
dexon-0x-contracts-6943bbcacbd9a1df0cdddb2696a768aec4b3d2c4.tar.zst
dexon-0x-contracts-6943bbcacbd9a1df0cdddb2696a768aec4b3d2c4.zip
Temp
Diffstat (limited to 'packages/sol-compiler/src')
-rw-r--r--packages/sol-compiler/src/compiler.ts11
-rw-r--r--packages/sol-compiler/src/utils/compiler.ts5
2 files changed, 7 insertions, 9 deletions
diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts
index efee3eb8a..743acacaa 100644
--- a/packages/sol-compiler/src/compiler.ts
+++ b/packages/sol-compiler/src/compiler.ts
@@ -195,9 +195,7 @@ export class Compiler {
path.basename(contractSource.path, constants.SOLIDITY_FILE_EXTENSION),
);
} else {
- contractNamesToCompile = this._specifiedContracts.map(specifiedContract =>
- path.basename(specifiedContract, constants.SOLIDITY_FILE_EXTENSION),
- );
+ return this._specifiedContracts;
}
return contractNamesToCompile;
}
@@ -217,12 +215,9 @@ export class Compiler {
for (const contractName of contractNames) {
const spyResolver = new SpyResolver(this._resolver);
const contractSource = spyResolver.resolve(contractName);
- const sourceTreeHashHex = getSourceTreeHash(
- spyResolver,
- path.join(this._contractsDir, contractSource.path),
- ).toString('hex');
+ const sourceTreeHashHex = getSourceTreeHash(spyResolver, contractSource.path).toString('hex');
const contractData = {
- contractName,
+ contractName: path.basename(contractName, constants.SOLIDITY_FILE_EXTENSION),
currentArtifactIfExists: await getContractArtifactIfExistsAsync(this._artifactsDir, contractName),
sourceTreeHashHex: `0x${sourceTreeHashHex}`,
};
diff --git a/packages/sol-compiler/src/utils/compiler.ts b/packages/sol-compiler/src/utils/compiler.ts
index c75f76dac..dffd07b1d 100644
--- a/packages/sol-compiler/src/utils/compiler.ts
+++ b/packages/sol-compiler/src/utils/compiler.ts
@@ -26,7 +26,10 @@ export async function getContractArtifactIfExistsAsync(
contractName: string,
): Promise<ContractArtifact | void> {
let contractArtifact;
- const currentArtifactPath = `${artifactsDir}/${contractName}.json`;
+ const currentArtifactPath = `${artifactsDir}/${path.basename(
+ contractName,
+ constants.SOLIDITY_FILE_EXTENSION,
+ )}.json`;
try {
const opts = {
encoding: 'utf8',