25 lines
691 B
JavaScript
25 lines
691 B
JavaScript
var ethersim = require('ethersim');
|
|
var web3 = require('web3');
|
|
|
|
Test = function(contractFiles, _env) {
|
|
this.env = _env || 'development';
|
|
this.web3 = web3;
|
|
this.web3.setProvider(ethersim.web3Provider());
|
|
this.contractFiles = contractFiles;
|
|
|
|
Embark.init(this.web3);
|
|
Embark.blockchainConfig.loadConfigFile('config/blockchain.yml');
|
|
Embark.contractsConfig.loadConfigFile('config/contracts.yml');
|
|
|
|
Embark.contractsConfig.init(this.contractFiles, this.env);
|
|
}
|
|
|
|
Test.prototype.deployAll = function(cb) {
|
|
Embark.deployContracts('development', this.contractFiles, "/tmp/abi.js", "chains.json", false, false, function(abi) {
|
|
eval(abi);
|
|
cb();
|
|
});
|
|
}
|
|
|
|
module.exports = Test;
|