Skip to content

Commit f511ad8

Browse files
authored
Merge pull request #6987 from NomicFoundation/partial_compilation
Partial compilation
2 parents 63c7723 + 5b5b411 commit f511ad8

39 files changed

+5151
-414
lines changed

.changeset/unlucky-monkeys-speak.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@nomicfoundation/hardhat-verify": patch
3+
"hardhat": patch
4+
---
5+
6+
Minimize compilation jobs based on changes in files and config across runs

v-next/hardhat-verify/src/internal/artifacts.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,22 @@ export async function getCompilerInput(
7676
sourceName: string,
7777
buildProfileName: string,
7878
): Promise<CompilerInput> {
79-
const compilationJob = await solidity.getCompilationJobs(
79+
const getCompilationJobsResult = await solidity.getCompilationJobs(
8080
[path.join(rootFilePath, sourceName)],
8181
{
8282
buildProfile: buildProfileName,
8383
quiet: true,
84+
force: true,
8485
},
8586
);
8687

88+
assertHardhatInvariant(
89+
!("reason" in getCompilationJobsResult),
90+
"getCompilationJobs should not error",
91+
);
92+
93+
const compilationJob = getCompilationJobsResult.compilationJobsPerFile;
94+
8795
// TODO: should this be an error instead?
8896
assertHardhatInvariant(
8997
compilationJob instanceof Map && compilationJob.size === 1,

0 commit comments

Comments
 (0)