diff --git a/lib/modules/coverage/contract_source.js b/lib/modules/coverage/contract_source.js index 579442f7d..a0c368215 100644 --- a/lib/modules/coverage/contract_source.js +++ b/lib/modules/coverage/contract_source.js @@ -97,6 +97,11 @@ class ContractSource { } } + isInterface() { + return this.contractBytecode !== undefined && + Object.values(this.contractBytecode).every((contractBytecode) => { return (Object.values(contractBytecode).length <= 1); }); + } + /*eslint complexity: ["error", 38]*/ generateCodeCoverage(trace) { if(!this.ast || !this.contractBytecode) throw new Error('Error generating coverage: solc output was not assigned'); diff --git a/lib/modules/coverage/contract_sources.js b/lib/modules/coverage/contract_sources.js index 602dca86b..2dec7dbb5 100644 --- a/lib/modules/coverage/contract_sources.js +++ b/lib/modules/coverage/contract_sources.js @@ -60,6 +60,7 @@ class ContractSources { var coverageReport = {}; for(var file in this.files) { + if(this.files[file].isInterface()) continue; coverageReport[file] = this.files[file].generateCodeCoverage(trace); }