Skip to content

Commit

Permalink
fix: adjust linkCompilerInput
Browse files Browse the repository at this point in the history
  • Loading branch information
cristovaoth committed Sep 13, 2024
1 parent a9524e9 commit c1012a3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/artifact/internal/linkBuildArtifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ function linkCompilerInput(
compilerInput: any,
mastercopies: Record<string, Record<string, MastercopyArtifact>>
): any {
const result = { ...compilerInput };
for (const libraryPath of Object.keys(artifact.linkReferences)) {
compilerInput.settings.libraries[libraryPath] =
compilerInput.settings.libraries[libraryPath] || {};
for (const libraryName of Object.keys(
artifact.linkReferences[libraryPath]
)) {
Expand All @@ -115,13 +114,15 @@ function linkCompilerInput(

assert(isAddress(libraryAddress));

compilerInput.settings = {
...compilerInput.settings,
result.settings = {
...result.settings,
libraries: {
...compilerInput.settings.libraries,
...result.settings.libraries,
[libraryPath]: { [libraryName]: libraryAddress },
},
};
}
}

return result;
}

0 comments on commit c1012a3

Please sign in to comment.