Migrate to Hardhat (#2397)

This commit is contained in:
Francisco Giordano
2020-10-28 17:03:05 -03:00
committed by GitHub
parent 0c27ecc536
commit f06738828b
75 changed files with 4229 additions and 20338 deletions

View File

@ -23,20 +23,19 @@ const ignorePatternsSubtrees = ignorePatterns
.concat(ignorePatterns.map(pat => path.join(pat, '**/*')))
.map(p => p.replace(/^\//, ''));
const solcOutput = readJSON('cache/solc-output.json');
const artifactsDir = 'build/contracts';
let n = 0;
for (const artifact of fs.readdirSync(artifactsDir)) {
const fullArtifactPath = path.join(artifactsDir, artifact);
const { sourcePath: fullSourcePath } = readJSON(fullArtifactPath);
const sourcePath = path.relative('.', fullSourcePath);
for (const sourcePath in solcOutput.contracts) {
const ignore = match.any(sourcePath, ignorePatternsSubtrees);
if (ignore) {
fs.unlinkSync(fullArtifactPath);
n += 1;
for (const contract in solcOutput.contracts[sourcePath]) {
fs.unlinkSync(path.join(artifactsDir, contract + '.json'));
n += 1;
}
}
}