aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-cov/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-03-09 23:01:31 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-03-12 10:37:29 +0800
commitf590aa11f79d3dfb8585b0b42103db74dcb6ee13 (patch)
tree06979c13079ca485c855c296ac971bbda8c205d6 /packages/sol-cov/src
parent6b7f48644c79c59a7137cd84f9e753910e506df9 (diff)
downloaddexon-sol-tools-f590aa11f79d3dfb8585b0b42103db74dcb6ee13.tar
dexon-sol-tools-f590aa11f79d3dfb8585b0b42103db74dcb6ee13.tar.gz
dexon-sol-tools-f590aa11f79d3dfb8585b0b42103db74dcb6ee13.tar.bz2
dexon-sol-tools-f590aa11f79d3dfb8585b0b42103db74dcb6ee13.tar.lz
dexon-sol-tools-f590aa11f79d3dfb8585b0b42103db74dcb6ee13.tar.xz
dexon-sol-tools-f590aa11f79d3dfb8585b0b42103db74dcb6ee13.tar.zst
dexon-sol-tools-f590aa11f79d3dfb8585b0b42103db74dcb6ee13.zip
Throw an error if artifacts not found
Diffstat (limited to 'packages/sol-cov/src')
-rw-r--r--packages/sol-cov/src/collect_contract_data.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/sol-cov/src/collect_contract_data.ts b/packages/sol-cov/src/collect_contract_data.ts
index d97a7937f..a0ce2640f 100644
--- a/packages/sol-cov/src/collect_contract_data.ts
+++ b/packages/sol-cov/src/collect_contract_data.ts
@@ -25,6 +25,9 @@ export const collectContractsData = (artifactsPath: string, sourcesPath: string,
const includedSourceCode = fs.readFileSync(source).toString();
return includedSourceCode;
});
+ if (_.isUndefined(artifact.networks[networkId])) {
+ throw new Error(`No ${baseName} artifacts found for networkId ${networkId}`);
+ }
const contractData = {
baseName,
sourceCodes,