Files
Pascal Precht 73d04433cf feat(@embark/deployment): introduce interfaces and libraries configuration
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: {
  ...
}
```
2020-01-15 09:45:42 -05:00

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;