Skip to content

Commit

Permalink
fix(plugins/solc): don't read pluginConfig from plugin.config
Browse files Browse the repository at this point in the history
In #2330 (comment) we've changed the `solc` plugin to read its
`pluginConfig` from `embark.config`. This was done under the assumption that
the `embark.config` is always properly populated with a dedicated `pluginConfig`.
In our testing environment we pass `Embark` objects to plugins, while in reality, we pass `Plugin` instances.
These two are different in nature, so relying on `embark.config` inside the plugin seemed the
most pragmatic way forward without introducing a bigger refactoring in the testing APIs.

Unfortunately it turned out that `embark.config` isn't populated with a `pluginConfig`
which essentially caused it to break apps.

This commit reverts that change done in the mentioned PR and patches the Embark testing
API to behave like a `Plugin` while still being an `Embark` instance.
  • Loading branch information
0x-r4bbit committed Apr 2, 2020
1 parent 1a61bc6 commit de8f217
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/plugins/solc/src/lib/Compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function compileSolc(embark, contractFiles, contractDirectories, options, callba
}

const logger = embark.logger;
const outputBinary = embark.config.pluginConfig.outputBinary;
const outputBinary = embark.pluginConfig.outputBinary;
const outputDir = embark.config.buildDir + embark.config.contractDirectories[0];
const solcConfig = embark.config.embarkConfig.options.solc;

Expand Down
1 change: 1 addition & 0 deletions packages/utils/testing/src/embark.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Embark {
this.plugins = plugins;
this.config = config || {};
this.config.plugins = plugins;
this.pluginConfig = config.pluginConfig || {};
this.ipc = ipc;
this.config.ipc = ipc;
this.assert = new EmbarkAssert(this);
Expand Down

0 comments on commit de8f217

Please sign in to comment.