fix blockchain environment
This commit is contained in:
parent
d4aac45ea6
commit
dec7ae8a94
|
@ -5,7 +5,7 @@ Embark.contractsConfig.loadConfigFile('config/contracts.yml');
|
|||
|
||||
var files = ["app/contracts/simple_storage.sol"];
|
||||
|
||||
Embark.contractsConfig.init(files);
|
||||
Embark.contractsConfig.init(files, 'development');
|
||||
var EmbarkSpec = Embark.tests(files);
|
||||
|
||||
describe("SimpleStorage", function() {
|
||||
|
|
|
@ -8,7 +8,7 @@ ContractsConfig = function(blockchainConfig, compiler) {
|
|||
this.contractFiles = [];
|
||||
}
|
||||
|
||||
ContractsConfig.prototype.init = function(files) {
|
||||
ContractsConfig.prototype.init = function(files, env) {
|
||||
this.all_contracts = [];
|
||||
this.contractDB = {};
|
||||
this.contractFiles = files;
|
||||
|
@ -17,7 +17,8 @@ ContractsConfig.prototype.init = function(files) {
|
|||
|
||||
//TODO: have to specify environment otherwise wouldn't work with staging
|
||||
if (this.blockchainConfig.config != undefined) {
|
||||
this.blockchainConfig = this.blockchainConfig.config('development');
|
||||
//this.blockchainConfig = this.blockchainConfig.config('development');
|
||||
this.blockchainConfig = this.blockchainConfig.config(env);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ Deploy = function(env, contractFiles, blockchainConfig, contractsConfig) {
|
|||
throw new Error("==== can't connect to " + this.blockchainConfig.rpcHost + ":" + this.blockchainConfig.rpcPort + " check if an ethereum node is running");
|
||||
}
|
||||
|
||||
console.log("address is : " + primaryAddress);
|
||||
console.log("primary account address is : " + primaryAddress);
|
||||
};
|
||||
|
||||
Deploy.prototype.deploy_contracts = function(env) {
|
||||
|
@ -76,7 +76,6 @@ Deploy.prototype.deploy_contracts = function(env) {
|
|||
}
|
||||
var contractAddress = receipt.contractAddress;
|
||||
this.deployedContracts[className] = contractAddress;
|
||||
console.log('address is ' + contractAddress);
|
||||
|
||||
console.log("deployed " + className + " at " + contractAddress);
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ Embark = {
|
|||
},
|
||||
|
||||
deployContracts: function(env, contractFiles, destFile) {
|
||||
this.contractsConfig.init(contractFiles);
|
||||
this.contractsConfig.init(contractFiles, env);
|
||||
var deploy = new Deploy(env, contractFiles, this.blockchainConfig.config(env), this.contractsConfig);
|
||||
deploy.deploy_contracts(env);
|
||||
return deploy.generate_abi_file(destFile);
|
||||
|
|
|
@ -57,7 +57,7 @@ TestContract = function(contract, className, args) {
|
|||
}
|
||||
|
||||
test = function(contractsConfig, contractFiles) {
|
||||
contractsConfig.init(contractFiles);
|
||||
contractsConfig.init(contractFiles, 'development');
|
||||
|
||||
contractsConfig.compileContracts();
|
||||
this.contractDB = contractsConfig.contractDB;
|
||||
|
|
|
@ -47,7 +47,7 @@ describe('embark.config.contracts', function() {
|
|||
]
|
||||
contractsConfig = new Config.Contracts(blockchainConfig, compiler);
|
||||
contractsConfig.loadConfigFile('test/support/contracts.yml');
|
||||
contractsConfig.init(files);
|
||||
contractsConfig.init(files, 'development');
|
||||
contractsConfig.compileContracts();
|
||||
});
|
||||
|
||||
|
@ -66,7 +66,7 @@ describe('embark.config.contracts', function() {
|
|||
]
|
||||
contractsConfig = new Config.Contracts(blockchainConfig, compiler);
|
||||
contractsConfig.loadConfigFile('test/support/arguments.yml');
|
||||
contractsConfig.init(files);
|
||||
contractsConfig.init(files, 'development');
|
||||
contractsConfig.compileContracts('development');
|
||||
});
|
||||
|
||||
|
@ -82,7 +82,7 @@ describe('embark.config.contracts', function() {
|
|||
]
|
||||
contractsConfig = new Config.Contracts(blockchainConfig, compiler);
|
||||
contractsConfig.loadConfigFile('test/support/instances.yml');
|
||||
contractsConfig.init(files);
|
||||
contractsConfig.init(files, 'development');
|
||||
contractsConfig.compileContracts('development');
|
||||
});
|
||||
|
||||
|
@ -99,7 +99,7 @@ describe('embark.config.contracts', function() {
|
|||
]
|
||||
contractsConfig = new Config.Contracts(blockchainConfig, compiler);
|
||||
contractsConfig.loadConfigFile('test/support/arguments2.yml');
|
||||
contractsConfig.init(files);
|
||||
contractsConfig.init(files, 'development');
|
||||
contractsConfig.compileContracts('development');
|
||||
});
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ setDeployConfig = function(config) {
|
|||
var compiler = new Compiler(_blockchainConfig);
|
||||
var contractsConfig = new Config.Contracts(blockchainConfig, compiler);
|
||||
contractsConfig.loadConfigFile(config.contracts);
|
||||
contractsConfig.init(config.files);
|
||||
contractsConfig.init(config.files, 'development');
|
||||
compiler.init('development');
|
||||
return new Deploy('development', config.files, blockchainConfig, contractsConfig);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ describe('embark.test', function() {
|
|||
var compiler = new Compiler(_blockchainConfig);
|
||||
var contractsConfig = new Config.Contracts(blockchainConfig, compiler);
|
||||
contractsConfig.loadConfigFile('test/support/contracts.yml');
|
||||
contractsConfig.init(files);
|
||||
contractsConfig.init(files, 'development');
|
||||
|
||||
describe('simple test', function() {
|
||||
var embarkSpec = new Test(contractsConfig, files);
|
||||
|
|
Loading…
Reference in New Issue