mirror of https://github.com/embarklabs/embark.git
Update contracts.js
This commit is contained in:
parent
9e8ebe9cb3
commit
4b451f0290
|
@ -60,10 +60,10 @@ ContractsConfig.prototype.compileContracts = function(env) {
|
||||||
options = contractsConfig[className];
|
options = contractsConfig[className];
|
||||||
if (options.args == null) continue;
|
if (options.args == null) continue;
|
||||||
|
|
||||||
ref = options.args;
|
ref = options.args; //get arguments
|
||||||
for (j = 0; j < ref.length; j++) {
|
for (j = 0; j < ref.length; j++) {
|
||||||
arg = ref[j];
|
arg = ref[j];
|
||||||
if (arg[0] === "$") {
|
if (arg[0] === "$") { //check if they are a contract dependency
|
||||||
if (this.contractDependencies[className] === void 0) {
|
if (this.contractDependencies[className] === void 0) {
|
||||||
this.contractDependencies[className] = [];
|
this.contractDependencies[className] = [];
|
||||||
}
|
}
|
||||||
|
@ -77,26 +77,23 @@ ContractsConfig.prototype.compileContracts = function(env) {
|
||||||
|
|
||||||
var all_compiled_contracts = {};
|
var all_compiled_contracts = {};
|
||||||
// compile files
|
// compile files
|
||||||
for (j = 0; j < this.contractFiles.length; j++) {
|
compiled_contracts = this.compiler.compile(this.contractFiles);
|
||||||
contractFile = this.contractFiles[j];
|
|
||||||
|
|
||||||
compiled_contracts = this.compiler.compile(contractFile);
|
for (var className in compiled_contracts) {
|
||||||
for (var className in compiled_contracts) {
|
var contract = compiled_contracts[className];
|
||||||
var contract = compiled_contracts[className];
|
|
||||||
|
|
||||||
if (this.is_a_token(className, compiled_contracts)) {
|
if (this.is_a_token(className, compiled_contracts)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
all_compiled_contracts[className] = contract;
|
all_compiled_contracts[className] = contract;
|
||||||
this.all_contracts.push(className);
|
this.all_contracts.push(className);
|
||||||
this.contractDB[className] = {
|
this.contractDB[className] = {
|
||||||
args: [],
|
args: [],
|
||||||
types: ['file'],
|
types: ['file'],
|
||||||
gasPrice: this.blockchainConfig.gasPrice,
|
gasPrice: this.blockchainConfig.gasPrice,
|
||||||
gasLimit: this.blockchainConfig.gasLimit,
|
gasLimit: this.blockchainConfig.gasLimit,
|
||||||
compiled: contract
|
compiled: contract
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue