From 20ffc1e72adace7dadedc8bbfde2ad87a7e14349 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Fri, 31 Jan 2020 21:00:11 +0100 Subject: [PATCH] CHanged the error text and added text for odd number of digits for calldata --- src/app/ui/universal-dapp-ui.js | 10 +++++++--- test-browser/tests/specialFunctions.js | 14 +++++++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/app/ui/universal-dapp-ui.js b/src/app/ui/universal-dapp-ui.js index 8ac799580e2..8854770f578 100644 --- a/src/app/ui/universal-dapp-ui.js +++ b/src/app/ui/universal-dapp-ui.js @@ -133,7 +133,11 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address - + @@ -176,13 +180,13 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address let calldata = calldataInput.value if (calldata) { if (calldata.length < 2 || calldata.length < 4 && helper.is0XPrefixed(calldata)) { - return setLLIError('the calldata should be a valid hexadecimal value with size of at least one byte.') + return setLLIError('The calldata should be a valid hexadecimal value with size of at least one byte.') } else { if (helper.is0XPrefixed(calldata)) { calldata = calldata.substr(2, calldata.length) } if (!helper.isHexadecimal(calldata)) { - return setLLIError('the calldata should be a valid hexadecimal value with size of at least one byte.') + return setLLIError('The calldata should be a valid hexadecimal value.') } } if (!fallback) { diff --git a/test-browser/tests/specialFunctions.js b/test-browser/tests/specialFunctions.js index acd150a69e7..1b2e5ae90c3 100644 --- a/test-browser/tests/specialFunctions.js +++ b/test-browser/tests/specialFunctions.js @@ -34,7 +34,19 @@ module.exports = { browser.sendLowLevelTx(address, '0', '0xa') .pause(1000) .waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`) - .assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, `the calldata should be a valid hexadecimal value with size of at least one byte.`) + .assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, `The calldata should be a valid hexadecimal value with size of at least one byte.`) + .perform(done) + }) + }) + }, + 'Use special functions receive/fallback - both are declared, failing sending data with odd number of digits': function (browser) { + // don't need to redeploy it, same contract + browser.perform((done) => { + browser.getAddressAtPosition(0, (address) => { + browser.sendLowLevelTx(address, '0', '0x1aa') + .pause(1000) + .waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`) + .assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, `The calldata should be a valid hexadecimal value.`) .perform(done) }) })