mirror of
https://github.com/embarklabs/embark.git
synced 2026-08-31 19:41:11 +00:00
This commit adds two new configuration settings for Smart Contract configuration:
- `interfaces` - Any Smart Contract that represent an interface or is used for inheritance
- `libraries` - Any Smart Contract that is used as a library
This makes the configuration less redundant in cases where otherwise the `deploy`
property has been set to `false`, such as:
```
deploy: {
Ownable: {
deploy: false
},
...
}
```
The above can now be done via:
```
interfaces: ['Ownable'],
deploy: {
...
}
```
20 lines
945 B
JavaScript
20 lines
945 B
JavaScript
import DeploymentChecks from "./deploymentChecks";
|
|
import TrackingFunctions from "./trackingFunctions";
|
|
|
|
class DeployTracker {
|
|
|
|
constructor(embark, {trackContracts, plugins}) {
|
|
const {logger, events, fs, config} = embark;
|
|
this.embark = embark;
|
|
|
|
const trackingFunctions = new TrackingFunctions({config, fs, logger, events, trackContracts});
|
|
const deploymentChecks = new DeploymentChecks({trackingFunctions, logger, events, plugins, contractsConfig: config.contractsConfig});
|
|
|
|
this.embark.registerActionForEvent("deployment:contract:deployed", trackingFunctions.trackAndSaveContract.bind(trackingFunctions));
|
|
this.embark.registerActionForEvent("deployment:contract:shouldDeploy", deploymentChecks.checkContractConfig.bind(deploymentChecks));
|
|
this.embark.registerActionForEvent("deployment:contract:shouldDeploy", deploymentChecks.checkIfAlreadyDeployed.bind(deploymentChecks));
|
|
}
|
|
}
|
|
|
|
module.exports = DeployTracker;
|