Do not connect to the node until it is needed in test

This commit is contained in:
Anthony Laibe 2018-07-30 09:27:59 +01:00 committed by Iuri Matias
parent e996d329fa
commit a7af853993

View File

@ -321,6 +321,21 @@ class Test {
function resetContracts(next) {
self.engine.events.request("contracts:reset:dependencies", next);
},
function compileContracts(next) {
if (Object.keys(self.builtContracts).length > 0) {
return next();
}
console.info('Compiling contracts'.cyan);
self.engine.contractsManager.build(() => {
self.builtContracts = cloneDeep(self.engine.contractsManager.contracts);
let className;
for (className in self.builtContracts) {
self.builtContracts[className].dependencyCount = null;
}
self.compiledContracts = cloneDeep(self.engine.contractsManager.compiledContracts);
next();
});
},
function deploy(next) {
self._deploy(options, (err, accounts) => {
if (err) {