Skip to content

Commit de8f217

Browse files
committed
fix(plugins/solc): don't read pluginConfig from plugin.config
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.
1 parent 1a61bc6 commit de8f217

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/plugins/solc/src/lib/Compiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function compileSolc(embark, contractFiles, contractDirectories, options, callba
5151
}
5252

5353
const logger = embark.logger;
54-
const outputBinary = embark.config.pluginConfig.outputBinary;
54+
const outputBinary = embark.pluginConfig.outputBinary;
5555
const outputDir = embark.config.buildDir + embark.config.contractDirectories[0];
5656
const solcConfig = embark.config.embarkConfig.options.solc;
5757

packages/utils/testing/src/embark.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class Embark {
77
this.plugins = plugins;
88
this.config = config || {};
99
this.config.plugins = plugins;
10+
this.pluginConfig = config.pluginConfig || {};
1011
this.ipc = ipc;
1112
this.config.ipc = ipc;
1213
this.assert = new EmbarkAssert(this);

0 commit comments

Comments
 (0)