Merge branch 'develop'

This commit is contained in:
Iuri Matias 2015-09-14 21:39:10 -04:00
commit 381896cbd3
9 changed files with 26 additions and 11 deletions

View File

@ -29,7 +29,7 @@ var deploy = function(env, embarkConfig) {
}
program
.version('0.9.1')
.version('0.9.2')
program.command('new [name]').description('New application').action(function(name) {
if (name === undefined) {

View File

@ -1,2 +1,2 @@
node_modules/
chains/development.json
config/chains/development.json

View File

@ -10,8 +10,8 @@
"license": "ISC",
"homepage": "",
"devDependencies": {
"embark-framework": "^0.9.1",
"grunt-embark": "^0.4.1",
"embark-framework": "^0.9.2",
"grunt-embark": "^0.4.3",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-coffee": "^0.13.0",
"grunt-contrib-concat": "^0.5.1",

View File

@ -19,6 +19,7 @@ staging:
rpc_whitelist: "*"
datadir: default
network_id: 0
deploy_timeout: 45
console: true
account:
init: false

View File

@ -21,9 +21,20 @@ Compiler.prototype.init = function(env) {
};
Compiler.prototype.compile_solidity = function(contractFile) {
var cmd, result, output, json, compiled_object;
var cmd, result, output, version, json, compiled_object;
cmd = "solc --input-file " + contractFile + " --combined-json binary,json-abi";
cmd = "solc --version";
result = exec(cmd, {silent: true});
output = result.output;
version = output.split('\n')[1].split(' ')[1].slice(0,5);
if (version == '0.1.1') {
cmd = "solc --input-file " + contractFile + " --combined-json binary,json-abi";
}
else {
cmd = "solc --input-file " + contractFile + " --combined-json bin,abi";
}
result = exec(cmd, {silent: true});
output = result.output;
@ -39,9 +50,9 @@ Compiler.prototype.compile_solidity = function(contractFile) {
var contract = json[className];
compiled_object[className] = {};
compiled_object[className].code = contract.binary;
compiled_object[className].code = contract.binary || contact.bin;
compiled_object[className].info = {};
compiled_object[className].info.abiDefinition = JSON.parse(contract["json-abi"]);
compiled_object[className].info.abiDefinition = JSON.parse(contract["abi"] || contract["json-abi"]);
}
return compiled_object;

View File

@ -41,6 +41,7 @@ BlockchainConfig.prototype.config = function(env) {
genesisBlock: config.genesis_block,
datadir: config.datadir,
chains: config.chains,
deployTimeout: config.deploy_timeout || 20,
networkId: networkId,
maxPeers: 4,
port: config.port || "30303",

View File

@ -39,7 +39,7 @@ Deploy.prototype.deploy_contract = function(contractObject, contractParams) {
while ((receipt = web3.eth.getTransactionReceipt(transactionHash)) === null || receipt.contractAddress === null) {
sleep(1000);
time += 1;
if (time >= 20) {
if (time >= this.blockchainConfig.deployTimeout) {
return false;
}
}
@ -176,4 +176,3 @@ Deploy.prototype.generate_and_write_abi_file = function(destFile) {
};
module.exports = Deploy;

View File

@ -1,6 +1,6 @@
{
"name": "embark-framework",
"version": "0.9.1",
"version": "0.9.2",
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"

View File

@ -44,6 +44,7 @@ describe('embark.config.blockchain', function() {
genesis_block: 'config/genesis.json',
datadir: '/tmp/embark',
chains: 'chains_development.json',
deploy_timeout: 45,
mine_when_needed: true,
gas_limit: 123,
gas_price: 100,
@ -69,6 +70,7 @@ describe('embark.config.blockchain', function() {
genesisBlock: 'config/genesis.json',
datadir: '/tmp/embark',
chains: 'chains_development.json',
deployTimeout: 45,
networkId: 0,
maxPeers: 4,
port: "30303",
@ -114,6 +116,7 @@ describe('embark.config.blockchain', function() {
genesisBlock: undefined,
datadir: '/tmp/embark',
chains: undefined,
deployTimeout: 20,
networkId: 0,
maxPeers: 4,
port: "30303",