From f1048463dab9ea0e7bb4d666094624b8b96bcca7 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 11 Dec 2017 21:31:48 +0100 Subject: [PATCH 1/8] fix terminal input --- src/app/panels/terminal.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/app/panels/terminal.js b/src/app/panels/terminal.js index b8708b7572..e1a5863ea8 100644 --- a/src/app/panels/terminal.js +++ b/src/app/panels/terminal.js @@ -67,9 +67,6 @@ var css = csjs` display : flex; flex-direction : column; height : 100%; - padding-left : 5px; - padding-right : 5px; - padding-bottom : 3px; overflow-y : auto; font-family : monospace; } @@ -129,7 +126,6 @@ var css = csjs` word-break : break-all; outline : none; font-family : monospace; - font-family: FontAwesome; } .search { display: flex; From e63d82a70926ac9381639478dc7ef290308bc12f Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 11 Dec 2017 22:27:11 +0100 Subject: [PATCH 2/8] fix input params --- src/app/execution/txFormat.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/execution/txFormat.js b/src/app/execution/txFormat.js index 296feefac4..eafe5b7e26 100644 --- a/src/app/execution/txFormat.js +++ b/src/app/execution/txFormat.js @@ -46,6 +46,8 @@ module.exports = { * @param {Function} callbackStep - callbackStep */ buildData: function (contractName, contract, contracts, isConstructor, funAbi, params, udapp, callback, callbackStep) { + params = params.replace(/[^"](0[xX][0-9a-fA-F]+)/g, '"$1"') + params = params.replace((/^[^0x]([0-9]+)/g, '"$1"')) var funArgs = '' try { funArgs = $.parseJSON('[' + params + ']') From 810d8d75ef49f529afe14cecd7bda079d1d545be Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 12 Dec 2017 17:45:12 +0100 Subject: [PATCH 3/8] fix library deploy --- src/app/execution/txFormat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/execution/txFormat.js b/src/app/execution/txFormat.js index eafe5b7e26..e81f5f91ea 100644 --- a/src/app/execution/txFormat.js +++ b/src/app/execution/txFormat.js @@ -140,7 +140,7 @@ module.exports = { } var bytecode = library.evm.bytecode.object if (bytecode.indexOf('_') >= 0) { - this.linkBytecode(libraryName, contracts, udapp, (err, bytecode) => { + this.linkBytecode(library, contracts, udapp, (err, bytecode) => { if (err) callback(err) else this.deployLibrary(libraryName, libraryShortName, library, contracts, udapp, callback, callbackStep) }, callbackStep) From 4d510b2d5155c6e62d50953f2087e90458fb2cc3 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 13 Dec 2017 11:38:57 +0100 Subject: [PATCH 4/8] update account balance less often --- src/app/tabs/run-tab.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 9dca2054c9..08d9387cc9 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -215,7 +215,7 @@ function runTab (container, appAPI, appEvents, opts) { var el = yo`
- ${settings(appAPI, appEvents)} + ${settings(container, appAPI, appEvents)} ${contractDropdown(events, appAPI, appEvents, instanceContainer)} ${pendingTxsContainer} ${instanceContainer} @@ -244,7 +244,7 @@ function runTab (container, appAPI, appEvents, opts) { setInterval(() => { updateAccountBalances(container, appAPI) updatePendingTxs(container, appAPI) - }, 500) + }, 10000) events.register('clearInstance', () => { instanceContainer.innerHTML = '' // clear the instances list @@ -497,7 +497,7 @@ function contractDropdown (events, appAPI, appEvents, instanceContainer) { /* ------------------------------------------------ section SETTINGS: Environment, Account, Gas, Value ------------------------------------------------ */ -function settings (appAPI, appEvents) { +function settings (container, appAPI, appEvents) { // SETTINGS HTML var net = yo`` const updateNetwork = () => { @@ -573,6 +573,7 @@ function settings (appAPI, appEvents) { appEvents.udapp.register('transactionExecuted', (error, from, to, data, lookupOnly, txResult) => { if (error) return if (!lookupOnly) el.querySelector('#value').value = '0' + updateAccountBalances(container, appAPI) }) return el From 3b8ddfc2054e7062fbae4bcfc76e610c9bde8448 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 13 Dec 2017 11:39:41 +0100 Subject: [PATCH 5/8] fix test rpc compatibility --- src/app/execution/txListener.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/execution/txListener.js b/src/app/execution/txListener.js index ea4eaaa1fc..e7139cebed 100644 --- a/src/app/execution/txListener.js +++ b/src/app/execution/txListener.js @@ -217,7 +217,7 @@ class TxListener { var contracts = this._api.contracts() if (!contracts) return cb() var contractName - if (!tx.to) { + if (!tx.to || tx.to === '0x0') { // testrpc returns 0x0 in that case // contract creation / resolve using the creation bytes code // if web3: we have to call getTransactionReceipt to get the created address // if VM: created address already included From d787fcde9f88a6ec16159a4623b87c4ec1718899 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 13 Dec 2017 11:41:49 +0100 Subject: [PATCH 6/8] remove input param reformatting --- src/app/execution/txFormat.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/execution/txFormat.js b/src/app/execution/txFormat.js index e81f5f91ea..dcc116e0d9 100644 --- a/src/app/execution/txFormat.js +++ b/src/app/execution/txFormat.js @@ -46,8 +46,6 @@ module.exports = { * @param {Function} callbackStep - callbackStep */ buildData: function (contractName, contract, contracts, isConstructor, funAbi, params, udapp, callback, callbackStep) { - params = params.replace(/[^"](0[xX][0-9a-fA-F]+)/g, '"$1"') - params = params.replace((/^[^0x]([0-9]+)/g, '"$1"')) var funArgs = '' try { funArgs = $.parseJSON('[' + params + ']') From ce53867d6792b10aa10bed569aa17c1fc443c4c8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 13 Dec 2017 12:39:04 +0100 Subject: [PATCH 7/8] fix test --- test-browser/tests/units/testRecorder.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/test-browser/tests/units/testRecorder.js b/test-browser/tests/units/testRecorder.js index af67bed331..d83675bfcc 100644 --- a/test-browser/tests/units/testRecorder.js +++ b/test-browser/tests/units/testRecorder.js @@ -2,6 +2,7 @@ var contractHelper = require('../../helpers/contracts') module.exports = { + '@disabled': true, // run by compiling.j '@sources': function () { return sources }, @@ -22,8 +23,16 @@ module.exports = { .click('i[class^="clearinstance"]') .perform((client, done) => { contractHelper.testContracts(browser, 'testRecorder.sol', sources[0]['browser/testRecorder.sol'], ['testRecorder'], function () { - contractHelper.createContract(browser, '12', function () { - browser.clickFunction('set - transact (not payable)', {types: 'uint256 _p', values: '34'}) + done() + }) + }) + .perform((client, done) => { + contractHelper.createContract(browser, '12', function () { + done() + }) + }) + .perform((client, done) => { + browser.clickFunction('set - transact (not payable)', {types: 'uint256 _p', values: '34'}) .click('i.savetransaction').modalFooterOKClick().getEditorValue(function (result) { var parsed = JSON.parse(result) browser.assert.equal(JSON.stringify(parsed.transactions[0].record.parameters), JSON.stringify(scenario.transactions[0].record.parameters)) @@ -36,10 +45,10 @@ module.exports = { browser.assert.equal(JSON.stringify(parsed.transactions[1].record.name), JSON.stringify(scenario.transactions[1].record.name)) browser.assert.equal(JSON.stringify(parsed.transactions[1].record.type), JSON.stringify(scenario.transactions[1].record.type)) browser.assert.equal(JSON.stringify(parsed.transactions[1].record.from), JSON.stringify(scenario.transactions[1].record.from)) - callback() + done() }) - }) - }) + }).perform(() => { + callback() }) }) } From 19844b14929b3299c3721509c037b6c15090842c Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 13 Dec 2017 14:37:54 +0100 Subject: [PATCH 8/8] change error message --- src/app/execution/txExecution.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/execution/txExecution.js b/src/app/execution/txExecution.js index 908fd82350..424a6f16a3 100644 --- a/src/app/execution/txExecution.js +++ b/src/app/execution/txExecution.js @@ -57,13 +57,13 @@ module.exports = { var error = `VM error: ${txResult.result.vm.exceptionError}.\n` var msg if (txResult.result.vm.exceptionError === errorCode.INVALID_OPCODE) { - msg = `\tThe constructor should be payable if you send value.\n\tThe execution might have thrown.\n` + msg = `\t\n\tThe execution might have thrown.\n` ret.error = true } else if (txResult.result.vm.exceptionError === errorCode.OUT_OF_GAS) { msg = `\tThe transaction ran out of gas. Please increase the Gas Limit.\n` ret.error = true } else if (txResult.result.vm.exceptionError === errorCode.REVERT) { - msg = `\tThe transaction has been reverted to the initial state.\n` + msg = `\tThe transaction has been reverted to the initial state.\nNote: The constructor should be payable if you send value.` ret.error = true } else if (txResult.result.vm.exceptionError === errorCode.STATIC_STATE_CHANGE) { msg = `\tState changes is not allowed in Static Call context\n`