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

Commit

Permalink
Change variable name and add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
eggplantzzz committed Sep 15, 2020
1 parent 84c23ba commit 99df0e5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions packages/compile-solidity/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const { run } = require("./run");
const { normalizeOptions } = require("./legacy/options");

const Compile = {
// this takes an object with keys being the name and values being source
// material as well as an options object
async sources({ sources, options }) {
const compilation = await run(sources, normalizeOptions(options));
return compilation.contracts.length > 0
Expand All @@ -25,7 +27,7 @@ const Compile = {
];

return await Compile.sourcesWithDependencies({
sources: paths,
paths,
options: Config.default().merge(options)
});
},
Expand All @@ -36,12 +38,13 @@ const Compile = {
const paths = await Profiler.updated(options);

return await Compile.sourcesWithDependencies({
sources: paths,
paths,
options: Config.default().merge(options)
});
},

async sourcesWithDependencies({ sources, options }) {
// this takes an array of paths and options
async sourcesWithDependencies({ paths, options }) {
options.logger = options.logger || console;
options.contracts_directory = options.contracts_directory || process.cwd();

Expand All @@ -54,7 +57,7 @@ const Compile = {
const config = Config.default().merge(options);
const { allSources, compilationTargets } = await Profiler.requiredSources(
config.with({
paths: sources,
paths,
base_path: options.contracts_directory,
resolver: options.resolver
})
Expand Down
4 changes: 2 additions & 2 deletions packages/compile-solidity/test/test_JSparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe("JSparser", () => {
const config = Config.default().merge(options);

const { compilations } = await Compile.sourcesWithDependencies({
sources: paths,
paths,
options: config
});
const contractWasCompiled = compilations.some(compilation => {
Expand All @@ -63,7 +63,7 @@ describe("JSparser", () => {

try {
await Compile.sourcesWithDependencies({
sources: paths,
paths,
options: config
});
assert(false, "this call should have failed!");
Expand Down
2 changes: 1 addition & 1 deletion packages/compile-solidity/test/test_supplier.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ describe("CompilerSupplier", function () {
options = Config.default().merge(options);

const { compilations } = await Compile.sourcesWithDependencies({
sources: paths,
paths,
options
});
const ComplexOrdered = findOne(
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/testing/SolidityTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const SolidityTest = {
: "OldSafeSend.sol";

const { compilations } = await Compile.sourcesWithDependencies({
sources: [
paths: [
path.join(__dirname, "Assert.sol"),
path.join(__dirname, "AssertAddress.sol"),
path.join(__dirname, "AssertAddressArray.sol"),
Expand Down

0 comments on commit 99df0e5

Please sign in to comment.