2015-10-09 14:57:30 +00:00
|
|
|
var ethersim = require('ethersim');
|
|
|
|
var web3 = require('web3');
|
|
|
|
|
2015-10-12 14:50:52 +00:00
|
|
|
Test = function(contractFiles, _env) {
|
|
|
|
this.env = _env || 'development';
|
|
|
|
this.web3 = web3;
|
|
|
|
this.web3.setProvider(ethersim.web3Provider());
|
|
|
|
this.contractFiles = contractFiles;
|
2015-10-09 14:57:30 +00:00
|
|
|
|
2015-10-12 14:50:52 +00:00
|
|
|
Embark.init(this.web3);
|
2015-10-09 14:57:30 +00:00
|
|
|
Embark.blockchainConfig.loadConfigFile('config/blockchain.yml');
|
|
|
|
Embark.contractsConfig.loadConfigFile('config/contracts.yml');
|
|
|
|
|
2015-10-12 14:50:52 +00:00
|
|
|
Embark.contractsConfig.init(this.contractFiles, this.env);
|
|
|
|
}
|
2015-10-09 14:57:30 +00:00
|
|
|
|
2015-10-12 14:50:52 +00:00
|
|
|
Test.prototype.deployAll = function(cb) {
|
|
|
|
Embark.deployContracts('development', this.contractFiles, "/tmp/abi.js", "chains.json", false, false, function(abi) {
|
2015-10-09 14:57:30 +00:00
|
|
|
eval(abi);
|
|
|
|
cb();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Test;
|