diff --git a/apps/remix-ide-e2e/src/tests/debugger.test.ts b/apps/remix-ide-e2e/src/tests/debugger.test.ts index 60408cf1d3..c659dabc01 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.test.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.test.ts @@ -95,7 +95,7 @@ module.exports = { .waitForElementVisible('#stepdetail') .waitForElementVisible({ locateStrategy: 'xpath', - selector: '//*[@data-id="treeViewLivm trace step" and contains(.,"545")]', + selector: '//*[@data-id="treeViewLivm trace step" and contains(.,"531")]', }) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`constructor (string memory name_, string memory symbol_) { diff --git a/apps/remix-ide/ci/makeMockCompiler.js b/apps/remix-ide/ci/makeMockCompiler.js index fe55444109..f2912e0d04 100644 --- a/apps/remix-ide/ci/makeMockCompiler.js +++ b/apps/remix-ide/ci/makeMockCompiler.js @@ -3,7 +3,7 @@ var fs = require('fs') var compiler = require('solc') var compilerInput = require('@remix-project/remix-solidity').CompilerInput -var defaultVersion = 'soljson-v0.8.7+commit.e28d00a7.js' +var defaultVersion = 'soljson-v0.8.17+commit.8df45f5f.js' const path = require('path') compiler.loadRemoteVersion(defaultVersion, (error, solcSnapshot) => { diff --git a/apps/solidity-compiler/src/app/compiler.ts b/apps/solidity-compiler/src/app/compiler.ts index 0e5c67678c..f0562b296f 100644 --- a/apps/solidity-compiler/src/app/compiler.ts +++ b/apps/solidity-compiler/src/app/compiler.ts @@ -9,7 +9,7 @@ import { CompileTabLogic } from '@remix-ui/solidity-compiler' const defaultCompilerParameters = { runs: '200', optimize: false, - version: 'soljson-v0.8.7+commit.e28d00a7', + version: 'soljson-v0.8.17+commit.8df45f5f', evmVersion: null, // compiler default language: 'Solidity', useFileConfiguration: false, diff --git a/libs/remix-tests/src/testRunner.ts b/libs/remix-tests/src/testRunner.ts index fe5014d2f9..7731786068 100644 --- a/libs/remix-tests/src/testRunner.ts +++ b/libs/remix-tests/src/testRunner.ts @@ -218,6 +218,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com if (!isJSONInterfaceAvailable) { return resultsCallback(new Error('Contract interface not available'), { passingNum, failureNum, timePassed }) } const runList: RunListInterface[] = createRunList(testObject.options.jsonInterface, fileAST, testName) const web3 = opts.web3 || new Web3() + web3.eth.handleRevert = true // enables returning error reason on revert const accts: TestResultInterface = { type: 'accountList', value: opts.accounts @@ -375,23 +376,27 @@ export function runTest (testName: string, testObject: any, contractDetails: Com console.error(err) return next(err) } - }).on('error', async (err: Error) => { + }).on('error', async (err) => { const time: number = (Date.now() - startTime) / 1000.0 + let errMsg = err.message + let txHash + if (err.reason) errMsg = `transaction reverted with the reason: ${err.reason}` const resp: TestResultInterface = { type: 'testFailure', value: changeCase.sentenceCase(func.name), filename: testObject.filename, time: time, - errMsg: err.message, + errMsg, context: testName, web3 } - if (err.message.includes('Transaction has been reverted by the EVM')) { - const txHash = JSON.parse(err.message.replace('Transaction has been reverted by the EVM:', '')).transactionHash - if (web3.eth && web3.eth.getHHLogsForTx) hhLogs = await web3.eth.getHHLogsForTx(txHash) - if (hhLogs && hhLogs.length) resp.hhLogs = hhLogs - resp.debugTxHash = txHash + if (err.receipt) txHash = err.receipt.transactionHash + else if (err.message.includes('Transaction has been reverted by the EVM')) { + txHash = JSON.parse(err.message.replace('Transaction has been reverted by the EVM:', '')).transactionHash } + if (web3.eth && web3.eth.getHHLogsForTx && txHash) hhLogs = await web3.eth.getHHLogsForTx(txHash) + if (hhLogs && hhLogs.length) resp.hhLogs = hhLogs + resp.debugTxHash = txHash testCallback(undefined, resp) failureNum += 1 timePassed += time diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 38633d24d2..e8ed7edf01 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -53,7 +53,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { customVersions: [], compilerLicense: null, selectedVersion: null, - defaultVersion: 'soljson-v0.8.7+commit.e28d00a7.js', // this default version is defined: in makeMockCompiler (for browser test) + defaultVersion: 'soljson-v0.8.17+commit.8df45f5f.js', // this default version is defined: in makeMockCompiler (for browser test) runs: '', compiledFileName: '', includeNightlies: false, diff --git a/package.json b/package.json index e5b848822d..1c4e31e6a3 100644 --- a/package.json +++ b/package.json @@ -56,8 +56,8 @@ "browsertest": "sleep 5 && yarn run nightwatch_local", "csslint": "csslint --ignore=order-alphabetical --errors='errors,duplicate-properties,empty-rules' --exclude-list='apps/remix-ide/src/assets/css/font-awesome.min.css' apps/remix-ide/src/assets/css/", "downloadsolc_assets_e2e": "node ./apps/remix-ide/ci/download_e2e_assets.js", - "downloadsolc_assets": "wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./apps/remix-ide/src/assets/js/soljson.js && wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./apps/solidity-compiler/src/assets/js/soljson.js", - "downloadsolc_assets_dist": "wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./dist/apps/remix-ide/assets/js/soljson.js && wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./dist/apps/solidity-compiler/assets/js/soljson.js", + "downloadsolc_assets": "wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.17+commit.8df45f5f.js -O ./apps/remix-ide/src/assets/js/soljson.js && wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.17+commit.8df45f5f.js -O ./apps/solidity-compiler/src/assets/js/soljson.js", + "downloadsolc_assets_dist": "wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.17+commit.8df45f5f.js -O ./dist/apps/remix-ide/assets/js/soljson.js && wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.17+commit.8df45f5f.js -O ./dist/apps/solidity-compiler/assets/js/soljson.js", "make-mock-compiler": "node apps/remix-ide/ci/makeMockCompiler.js", "minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false", "build:production": "NODE_ENV=production nx build remix-ide --configuration=production --skip-nx-cache",