Skip to content

Commit

Permalink
Sort files when creating the solc input
Browse files Browse the repository at this point in the history
  • Loading branch information
fvictorio committed Oct 28, 2022
1 parent 8575354 commit 0429ea9
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -4,7 +4,13 @@ export function getInputFromCompilationJob(
compilationJob: CompilationJob
): CompilerInput {
const sources: { [sourceName: string]: { content: string } } = {};
for (const file of compilationJob.getResolvedFiles()) {

// we sort the files so that we always get the same compilation input
const resolvedFiles = compilationJob
.getResolvedFiles()
.sort((a, b) => a.sourceName.localeCompare(b.sourceName));

for (const file of resolvedFiles) {
sources[file.sourceName] = {
content: file.content.rawContent,
};
Expand Down

0 comments on commit 0429ea9

Please sign in to comment.