diff --git a/package-lock.json b/package-lock.json index 9637366950..ad86992f85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2006,7 +2006,8 @@ "aes-js": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", - "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=" + "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=", + "dev": true }, "agent-base": { "version": "2.1.1", @@ -9372,7 +9373,8 @@ "js-sha3": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true }, "js-tokens": { "version": "3.0.2", @@ -13215,69 +13217,17 @@ "remix-lib": "0.4.22" }, "dependencies": { - "ethereumjs-vm": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.1.1.tgz", - "integrity": "sha512-Bh2avDY9Hyon9TvJ/fmkdyd5JDnmTudLJ5oKhmTfXn0Jjq7UzP4YRNp7e5PWoWXSmdXAGXU9W0DXK5TV9Qy/NQ==", - "dev": true, - "requires": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "core-js-pure": "^3.0.1", - "ethereumjs-account": "^3.0.0", - "ethereumjs-block": "^2.2.1", - "ethereumjs-blockchain": "^4.0.2", - "ethereumjs-common": "^1.3.2", - "ethereumjs-tx": "^2.1.1", - "ethereumjs-util": "~6.1.0", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.3.2", - "rustbn.js": "~0.2.0", - "safe-buffer": "^5.1.1", - "util.promisify": "^1.0.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", - "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", - "dev": true, - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "0.1.6", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - } - } - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "dev": true, - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - }, "remix-lib": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/remix-lib/-/remix-lib-0.4.19.tgz", - "integrity": "sha512-TJ2PATzCsXIRR+khB6nBIjhPAY1c9lxhKyp+csbrkoYTUw+LcifAvvQA3W0FPRgoWZI3JFE2Vbt0WMvVOMLjhA==", + "version": "0.4.22", + "resolved": "https://registry.npmjs.org/remix-lib/-/remix-lib-0.4.22.tgz", + "integrity": "sha512-nyRfFENxq+RtgX7lul1TV50eBCflNhAb1Dxaekd+xKQN9eM6IBOayMjAxZG01EDXZ57lsHqsr0p3kS4/ueqerA==", "dev": true, "requires": { "async": "^2.1.2", - "ethereumjs-block": "^2.2.1", - "ethereumjs-tx": "^2.1.1", + "ethereumjs-block": "^2.2.2", + "ethereumjs-tx": "^2.1.2", "ethereumjs-util": "^6.2.0", - "ethereumjs-vm": "4.1.1", + "ethereumjs-vm": "4.1.3", "ethers": "^4.0.40", "events": "^3.0.0", "solc": "^0.6.0", @@ -18134,7 +18084,8 @@ "xmlhttprequest": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", - "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" + "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=", + "dev": true }, "xregexp": { "version": "2.0.0", diff --git a/package.json b/package.json index 04f741b8e1..d4833aaa8b 100644 --- a/package.json +++ b/package.json @@ -168,6 +168,7 @@ "nightwatch_local_transactionExecution": "nightwatch ./test-browser/tests/transactionExecution.js --config nightwatch.js --env chrome ", "nightwatch_local_staticAnalysis": "nightwatch ./test-browser/tests/staticAnalysis.js --config nightwatch.js --env chrome ", "nightwatch_local_signingMessage": "nightwatch ./test-browser/tests/signingMessage.js --config nightwatch.js --env chrome ", + "nightwatch_local_specialFunctions": "nightwatch ./test-browser/tests/specialFunctions.js --config nightwatch.js --env chrome ", "nightwatch_local_solidityUnittests": "nightwatch ./test-browser/tests/solidityUnittests.js --config nightwatch.js --env chrome ", "nightwatch_local_remixd": "nightwatch ./test-browser/tests/remix.js --config nightwatch.js --env chrome ", "nightwatch_local_console": "nightwatch ./test-browser/tests/console.js --config nightwatch.js --env chrome ", diff --git a/src/app/tabs/runTab/settings.js b/src/app/tabs/runTab/settings.js index 09375020a3..ff3dc221d0 100644 --- a/src/app/tabs/runTab/settings.js +++ b/src/app/tabs/runTab/settings.js @@ -115,7 +115,7 @@ class SettingsUI {
Value
- + + ` const llIError = yo` @@ -201,95 +195,6 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address return instance } -UniversalDAppUI.prototype.confirmationCb = function (network, tx, gasEstimation, continueTxExecution, cancelCb) { - let self = this - if (network.name !== 'Main') { - return continueTxExecution(null) - } - var amount = Web3.utils.fromWei(typeConversion.toInt(tx.value), 'ether') - var content = confirmDialog(tx, amount, gasEstimation, self.udapp, - (gasPrice, cb) => { - let txFeeText, priceStatus - // TODO: this try catch feels like an anti pattern, can/should be - // removed, but for now keeping the original logic - try { - var fee = Web3.utils.toBN(tx.gas).mul(Web3.utils.toBN(Web3.utils.toWei(gasPrice.toString(10), 'gwei'))) - txFeeText = ' ' + Web3.utils.fromWei(fee.toString(10), 'ether') + ' Ether' - priceStatus = true - } catch (e) { - txFeeText = ' Please fix this issue before sending any transaction. ' + e.message - priceStatus = false - } - cb(txFeeText, priceStatus) - }, - (cb) => { - self.executionContext.web3().eth.getGasPrice((error, gasPrice) => { - const warnMessage = ' Please fix this issue before sending any transaction. ' - if (error) { - return cb('Unable to retrieve the current network gas price.' + warnMessage + error) - } - try { - var gasPriceValue = Web3.utils.fromWei(gasPrice.toString(10), 'gwei') - cb(null, gasPriceValue) - } catch (e) { - cb(warnMessage + e.message, null, false) - } - }) - } - ) - modalDialog( - 'Confirm transaction', - content, - { label: 'Confirm', - fn: () => { - self.udapp.config.setUnpersistedProperty( - 'doNotShowTransactionConfirmationAgain', - content.querySelector('input#confirmsetting').checked - ) - // TODO: check if this is check is still valid given the refactor - if (!content.gasPriceStatus) { - cancelCb('Given gas price is not correct') - } else { - var gasPrice = Web3.utils.toWei(content.querySelector('#gasprice').value, 'gwei') - continueTxExecution(gasPrice) - } - } - }, - { - label: 'Cancel', - fn: () => { - return cancelCb('Transaction canceled by user.') - } - } - ) -} - -const continueCb = (error, continueTxExecution, cancelCb) => { - if (error) { - const msg = typeof error !== 'string' ? error.message : error - modalDialog( - 'Gas estimation failed', - yo` -
Gas estimation errored with the following message (see below). - The transaction execution will likely fail. Do you want to force sending?
${msg}
- `, - { - label: 'Send Transaction', - fn: () => continueTxExecution() - }, - { - label: 'Cancel Transaction', - fn: () => cancelCb() - } - ) - } else { - continueTxExecution() - } -} - -const promptCb = (okCb, cancelCb) => { - modalCustom.promptPassphrase('Passphrase requested', 'Personal mode is enabled. Please provide passphrase of account', '', okCb, cancelCb) -} // TODO this is used by renderInstance when a new instance is displayed. // this returns a DOM element. diff --git a/test-browser/commands/sendLowLevelTx.js b/test-browser/commands/sendLowLevelTx.js index 0b95caf045..49aaf4e1ed 100644 --- a/test-browser/commands/sendLowLevelTx.js +++ b/test-browser/commands/sendLowLevelTx.js @@ -1,10 +1,14 @@ const EventEmitter = require('events') class sendLowLevelTx extends EventEmitter { - command (address, value, callData, callback) { + command (browser, address, value, callData, callback) { this.api.perform((client, done) => { - this.api.execute(function (value) { - document.getElementById('deployAndRunLLTxSendTransaction').click - done() + browser.execute(function (value) { + browser.waitForElementVisible('deployAndRunLLTxSendTransaction', 1000) + .getElementById('deployAndRunLLTxCalldata').value = callData + .waitForElementVisible('deployAndRunTransferValue') + .getElementById('deployAndRunTransferValue').value = value + .click('deployAndRunLLTxSendTransaction', callback) + .done() if (callback) { callback.call(this.api) } diff --git a/test-browser/tests/specialFunctions.js b/test-browser/tests/specialFunctions.js index 2efbcc9521..a038e53384 100644 --- a/test-browser/tests/specialFunctions.js +++ b/test-browser/tests/specialFunctions.js @@ -11,12 +11,12 @@ module.exports = { }, 'Use special functions receive/fullback': function (browser) { browser.waitForElementVisible('#icon-panel', 10000) - .testContracts('browser/receiveAndfFallback.sol', sources[0]['receiveAndfFallback.sol'], ['CheckSpecials']) + .testContracts('receiveAndFallback.sol', sources[0]['browser/receiveAndFallback.sol'], ['CheckSpecials']) .clickLaunchIcon('udapp') .selectContract('CheckSpecials') .createContract('') .clickInstance(0) - .perform((done) => { + .perform((done) => { /* browser.getAddressAtPosition(0, (address) => { browser.sendLowLevelTx(address, '0', '0xaa') .journalLastChild('dd') @@ -24,14 +24,14 @@ module.exports = { .assert.containsText('label[id="deployAndRunLLTxError"]', '') .perform(done) }) - }) + */ }) }, tearDown: sauce } var sources = [ { - 'browser/receiveAndfFallback.sol': { + 'browser/receiveAndFallback.sol': { content: ` contract CheckSpecials { receive() payable external{}