From 9ab674a913d9261bea4e016cc72ff92a9b7103c7 Mon Sep 17 00:00:00 2001 From: Daniel Luca Date: Tue, 4 Dec 2018 16:22:54 +0200 Subject: [PATCH 1/2] Use the provided gas limit, not the estimated one --- remix-lib/src/execution/txRunner.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/remix-lib/src/execution/txRunner.js b/remix-lib/src/execution/txRunner.js index dad77bdc6..85fb3e496 100644 --- a/remix-lib/src/execution/txRunner.js +++ b/remix-lib/src/execution/txRunner.js @@ -140,10 +140,9 @@ class TxRunner { runInNode (from, to, data, value, gasLimit, useCall, confirmCb, gasEstimationForceSend, promptCb, callback) { const self = this - var tx = { from: from, to: to, data: data, value: value } + var tx = { from: from, to: to, data: data, value: value, gas: gasLimit } if (useCall) { - tx.gas = gasLimit return executionContext.web3().eth.call(tx, function (error, result) { callback(error, { result: result, @@ -153,9 +152,6 @@ class TxRunner { } executionContext.web3().eth.estimateGas(tx, function (err, gasEstimation) { gasEstimationForceSend(err, () => { - // callback is called whenever no error - tx.gas = !gasEstimation ? gasLimit : gasEstimation - if (self._api.config.getUnpersistedProperty('doNotShowTransactionConfirmationAgain')) { return self._executeTx(tx, null, self._api, promptCb, callback) } From c7f7313c42aa0153c96e282e4dfbbfe089f61cea Mon Sep 17 00:00:00 2001 From: Daniel Luca Date: Wed, 5 Dec 2018 09:23:47 +0200 Subject: [PATCH 2/2] Fix tests even though they seem unrelated --- remix-lib/test/txFormat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remix-lib/test/txFormat.js b/remix-lib/test/txFormat.js index c8192ed80..c45893c66 100644 --- a/remix-lib/test/txFormat.js +++ b/remix-lib/test/txFormat.js @@ -15,7 +15,7 @@ tape('ContractParameters - (TxFormat.buildData) - format input parameters', func output = JSON.parse(output) var contract = output.contracts['test.sol']['uintContractTest'] context = { output, contract } - var bytecode = '608060405234801561001057600080fd5b5061011e806100206000396000f3fe608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634b521953146044575b600080fd5b348015604f57600080fd5b5060a360048036036060811015606457600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505060a5565b005b8260008190555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505056fea165627a7a7230582053a6bee96a62b9079722b2a0004a405aa29803abc12ed6dd0322007ebb44a5f60029' + var bytecode = '608060405234801561001057600080fd5b50610118806100206000396000f3fe6080604052600436106039576000357c0100000000000000000000000000000000000000000000000000000000900480634b52195314603e575b600080fd5b348015604957600080fd5b50609d60048036036060811015605e57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050609f565b005b8260008190555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505056fea165627a7a72305820eef04af1d305b2d1a4227d962175cf0c1ddc8c5a50f11189b73615d73344a0270029' t.test('(TxFormat.buildData)', function (st) { st.plan(3) testWithInput(st, '123123, "0xf7a10e525d4b168f45f74db1b61f63d3e7619ea8", "34"', bytecode + '000000000000000000000000000000000000000000000000000000000001e0f3000000000000000000000000f7a10e525d4b168f45f74db1b61f63d3e7619ea80000000000000000000000000000000000000000000000000000000000000022') @@ -97,7 +97,7 @@ function testLinkLibrary2 (st, callbackDeployLibraries) { } } - var data = '608060405234801561001057600080fd5b5061026b806100206000396000f3fe608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680636d4ce63c14610046575b600080fd5b34801561005257600080fd5b5061005b61005d565b005b73f7a10e525d4b168f45f74db1b61f63d3e7619e116344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b1580156100bd57600080fd5b505af41580156100d1573d6000803e3d6000fd5b5050505073f7a10e525d4b168f45f74db1b61f63d3e7619e336344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b15801561013557600080fd5b505af4158015610149573d6000803e3d6000fd5b5050505073f7a10e525d4b168f45f74db1b61f63d3e7619e336344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b1580156101ad57600080fd5b505af41580156101c1573d6000803e3d6000fd5b5050505073f7a10e525d4b168f45f74db1b61f63d3e7619e116344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b15801561022557600080fd5b505af4158015610239573d6000803e3d6000fd5b5050505056fea165627a7a72305820d2fdcf2968ba13c89dd82748af1cac609a670e333fce635bc2212c2a50508be70029' + var data = '608060405234801561001057600080fd5b50610265806100206000396000f3fe60806040526004361061003b576000357c0100000000000000000000000000000000000000000000000000000000900480636d4ce63c14610040575b600080fd5b34801561004c57600080fd5b50610055610057565b005b73f7a10e525d4b168f45f74db1b61f63d3e7619e116344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b1580156100b757600080fd5b505af41580156100cb573d6000803e3d6000fd5b5050505073f7a10e525d4b168f45f74db1b61f63d3e7619e336344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b15801561012f57600080fd5b505af4158015610143573d6000803e3d6000fd5b5050505073f7a10e525d4b168f45f74db1b61f63d3e7619e336344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b1580156101a757600080fd5b505af41580156101bb573d6000803e3d6000fd5b5050505073f7a10e525d4b168f45f74db1b61f63d3e7619e116344733ae16040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160006040518083038186803b15801561021f57600080fd5b505af4158015610233573d6000803e3d6000fd5b5050505056fea165627a7a723058205e9e996af607b71801d51adf6eed43d4eb1d878cf7370a6029d9312a8fb40e150029' var deployMsg = ['creation of library test.sol:lib1 pending...', 'creation of library test.sol:lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2_lib2 pending...']