From 10a7833838660b19aae90c082fd3eea7282f10de Mon Sep 17 00:00:00 2001 From: emizzle Date: Fri, 2 Aug 2019 15:00:15 +1000 Subject: [PATCH] refactor(@embark/embark-deploy-tracker): Add back contract tracking Add back contract tracking to the refactored code. Deployment checks are added as plugins to the `embark-deployment` module. Adds ability to track if a contract has already been deployed, and skips deployment if so. Updates error handling flow for deployment process. Adds a contract class to the `embark-contracts-manager`, to add a `log` function for the contract. This `log` function can be called from any module that has the contract instance. Adds TS interfaces for contracts configuration. Handles the following cases: 1. Contract already deployed 2. Contract not deployed 3. Contract is configured with `{track: false}` (deploy if not deployed, and don't track) 5. Contract is configured with an `address` in the config 6. `trackContracts` set to `false` from `engine` (always deploy but don't track contracts). Currently used for the tests. 7. Contract deployment produces an error 8. Interface deployment shows warning. PR with unit tests and documenation to follow. # Conflicts: # packages/embark/src/lib/modules/ethereum-blockchain-client/index.js --- packages/embark-deploy-tracker/src/trackingFunctions.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/embark-deploy-tracker/src/trackingFunctions.js b/packages/embark-deploy-tracker/src/trackingFunctions.js index 3c81a65bb..f4fc45b32 100644 --- a/packages/embark-deploy-tracker/src/trackingFunctions.js +++ b/packages/embark-deploy-tracker/src/trackingFunctions.js @@ -58,6 +58,7 @@ export default class TrackingFunctions { } setCurrentChain(_params, callback) { + if (!this.chainFile) return callback(); if (this.chainFile === false) return callback(); if (this.chainConfig === false) { this.currentChain = {contracts: []};