diff --git a/sol/tests.sol b/sol/tests.sol index c439054b12..ea57c834c8 100644 --- a/sol/tests.sol +++ b/sol/tests.sol @@ -62,38 +62,38 @@ library Assert { AssertionEvent(result, message); } -// function notEqual(int a, int b, string message) public returns (bool result) { -// result = (a != b); -// AssertionEvent(result, message); -// } - -// function notEqual(bool a, bool b, string message) public returns (bool result) { -// result = (a != b); -// AssertionEvent(result, message); -// } -// -// // TODO: only for certain versions of solc -// //function notEqual(fixed a, fixed b, string message) public returns (bool result) { -// // result = (a != b); -// // AssertionEvent(result, message); -// //} -// -// // TODO: only for certain versions of solc -// //function notEqual(ufixed a, ufixed b, string message) public returns (bool result) { -// // result = (a != b); -// // AssertionEvent(result, message); -// //} -// -// function notEqual(address a, address b, string message) public returns (bool result) { -// result = (a != b); -// AssertionEvent(result, message); -// } -// -// function notEqual(bytes32 a, bytes32 b, string message) public returns (bool result) { -// result = (a != b); -// AssertionEvent(result, message); -// } -// + function notEqual(int a, int b, string message) public returns (bool result) { + result = (a != b); + AssertionEvent(result, message); + } + + function notEqual(bool a, bool b, string message) public returns (bool result) { + result = (a != b); + AssertionEvent(result, message); + } + + // TODO: only for certain versions of solc + //function notEqual(fixed a, fixed b, string message) public returns (bool result) { + // result = (a != b); + // AssertionEvent(result, message); + //} + + // TODO: only for certain versions of solc + //function notEqual(ufixed a, ufixed b, string message) public returns (bool result) { + // result = (a != b); + // AssertionEvent(result, message); + //} + + function notEqual(address a, address b, string message) public returns (bool result) { + result = (a != b); + AssertionEvent(result, message); + } + + function notEqual(bytes32 a, bytes32 b, string message) public returns (bool result) { + result = (a != b); + AssertionEvent(result, message); + } + // // TODO: needs to be convert to bytes first to be comparable // //function notEqual(string a, string b, string message) public returns (bool result) { // // result = (a != b); diff --git a/src/deployer.js b/src/deployer.js index 1bae8cd9d8..7f8d07ed31 100644 --- a/src/deployer.js +++ b/src/deployer.js @@ -83,7 +83,8 @@ function deployAll (compileResult, web3, callback) { console.dir(accounts); deployObject.send({ from: accounts[0], - gas: Math.ceil(gasValue * 1.1) + //gas: Math.ceil(gasValue * 1.2) + gas: 1200000 }).on('receipt', function (receipt) { console.dir("==== got the receipt"); diff --git a/src/provider.js b/src/provider.js index ff2b85cf45..785ac31a80 100644 --- a/src/provider.js +++ b/src/provider.js @@ -30,7 +30,7 @@ Provider.prototype.sendAsync = function(payload, callback) { return callback(null, jsonRPCResponse(payload.id, this.accounts.map((x) => x.address))) } if (payload.method === 'eth_estimateGas') { - callback(null, jsonRPCResponse(payload.id, 800000)) + callback(null, jsonRPCResponse(payload.id, 1200000)) } if (payload.method === 'eth_gasPrice') { callback(null, jsonRPCResponse(payload.id, 1)) diff --git a/src/txProcess.js b/src/txProcess.js index b7bb1ab21f..334a01e80d 100644 --- a/src/txProcess.js +++ b/src/txProcess.js @@ -33,6 +33,9 @@ function createContract(payload, from, data, value, gasLimit, txRunner, callback console.log('-- createContract'); console.dir(arguments); let finalCallback = function(err, result) { + if (err) { + return callback(err); + } let contractAddress = ('0x' + result.result.createdAddress.toString('hex')) callback(null, jsonRPCResponse(payload.id, result.transactionHash)) } @@ -71,8 +74,8 @@ function processTx(accounts, payload, isCall, callback) { executionContext.init(api.config); let txRunner = new TxRunner(accounts, api); - let { from: from, to: to, data: data, value: value, gasLimit: gasLimit } = payload.params[0]; - gasLimit = gasLimit || 800000; + let { from: from, to: to, data: data, value: value, gas: gas } = payload.params[0]; + gas = gas || 1200000; let callbacks = { confirmationCb: (network, tx, gasEstimation, continueTxExecution, cancelCb) => { @@ -87,9 +90,9 @@ function processTx(accounts, payload, isCall, callback) { } if (to) { - runTx(payload, from, to, data, value, gasLimit, txRunner, callbacks, isCall, callback); + runTx(payload, from, to, data, value, gas, txRunner, callbacks, isCall, callback); } else { - createContract(payload, from, data, value, gasLimit, txRunner, callbacks, callback); + createContract(payload, from, data, value, gas, txRunner, callbacks, callback); } }