Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Change fix and update lib/test to correctly interface with workflow-c…
Browse files Browse the repository at this point in the history
…ompile
  • Loading branch information
eggplantzzz committed Aug 12, 2020
1 parent 16cf2e9 commit 8e5d19b
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions packages/core/lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,19 @@ const Test = {
);
testResolver.cache_on = false;

const { compilations } = await this.compileContractsWithTestFilesIfNeeded(
const {
compilations,
contracts
} = await this.compileContractsWithTestFilesIfNeeded(
solTests,
config,
testResolver
);

const collectedSourceIndexes = compilations.reduce((a, compilation) => {
return a.concat(compilation.sourceIndexes);
}, []);

const testContracts = solTests.map(testFilePath => {
return testResolver.require(testFilePath);
});
Expand All @@ -119,13 +126,13 @@ const Test = {
await this.defineSolidityTests(
mocha,
testContracts,
compilations.sourceIndexes,
collectedSourceIndexes,
runner
);

const debuggerCompilations = Codec.Compilations.Utils.shimArtifacts(
compilations.contracts,
compilations.sourceIndexes
contracts,
collectedSourceIndexes
);

//for stack traces, we'll need to set up a light-mode debugger...
Expand Down Expand Up @@ -246,16 +253,11 @@ const Test = {
}
}
// Compile project contracts and test contracts
const compilations = await Contracts.compile(compileConfig);
const collectedCompilations = compilations.reduce((a, compilation) => {
a.contracts = a.contracts.concat(compilation.contracts);
a.compilations = a.compilations.concat(compilation.compilations);
return a;
}, {});
const { contracts, compilations } = await Contracts.compile(compileConfig);

await Contracts.save(compileConfig, collectedCompilations.contracts);
await Contracts.save(compileConfig, contracts);

return collectedCompilations;
return { contracts, compilations };
},

performInitialDeploy: function (config, resolver) {
Expand Down

0 comments on commit 8e5d19b

Please sign in to comment.