disable SUT when sol.v is less than 0.4.12

pull/2659/head^2
lianahus 2 years ago committed by Aniket
parent 652d6f7814
commit 7cd5869334
  1. 3
      apps/solidity-compiler/src/app/compiler-api.ts
  2. 2
      libs/remix-analyzer/test/analysis/staticAnalysisIntegration-test-0.4.24.ts
  3. 18
      libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx
  4. 1
      package.json
  5. 5
      yarn.lock

@ -222,9 +222,10 @@ export const CompilerApiMixin = (Base) => class extends Base {
}
this.compiler.event.register('loadingCompiler', this.data.eventHandlers.onLoadingCompiler)
this.data.eventHandlers.onCompilerLoaded = () => {
this.data.eventHandlers.onCompilerLoaded = (version) => {
this.data.loading = false
this.statusChanged({ key: 'none' })
this.emit('compilerLoaded', version)
}
this.compiler.event.register('compilerLoaded', this.data.eventHandlers.onCompilerLoaded)

@ -38,7 +38,7 @@ const testFiles: string[] = [
'forLoopIteratesOverDynamicArray.sol'
]
let compilationResults: Record<string, CompilationResult> = {}
const compilationResults: Record<string, CompilationResult> = {}
test('setup', function (t: test.Test) {
solcOrg.loadRemoteVersion('v0.4.24+commit.e67f0147', (error, compiler) => {

@ -1,4 +1,5 @@
import React, { useState, useRef, useEffect, ReactElement } from 'react' // eslint-disable-line
import * as semver from 'semver'
import { eachOfSeries } from 'async' // eslint-disable-line
import type Web3 from 'web3'
import { canUseWorker, urlFromVersion } from '@remix-project/remix-solidity'
@ -154,8 +155,23 @@ export const SolidityUnitTesting = (props: Record<string, any>) => { // eslint-d
await setCurrentPath(defaultPath)
})
const truncateVersion = (version: string) => {
const tmp: RegExpExecArray | null = /^(\d+.\d+.\d+)/.exec(version)
return tmp ? tmp[1] : version
}
testTab.fileManager.events.on('noFileSelected', async () => { await updateForNewCurrent() })
testTab.fileManager.events.on('currentFileChanged', async (file: string) => await updateForNewCurrent(file))
testTab.fileManager.events.on('currentFileChanged', async (file: string) => {
await updateForNewCurrent(file)
})
testTab.on('solidity', 'compilerLoaded', async (version: string) => {
const { currentVersion } = testTab.compileTab.getCurrentCompilerConfig()
if (!semver.gt(truncateVersion(currentVersion), '0.4.12')) {
setDisableRunButton(true)
setRunButtonTitle('Please select Solidity compiler version greater than 0.4.12.')
}
})
}, []) // eslint-disable-line

@ -252,6 +252,7 @@
"@types/react-dom": "^17.0.9",
"@types/react-router-dom": "^5.3.0",
"@types/request": "^2.48.7",
"@types/semver": "^7.3.10",
"@types/tape": "^4.13.0",
"@types/ws": "^7.2.4",
"@typescript-eslint/eslint-plugin": "^4.32.0",

@ -4637,6 +4637,11 @@
integrity sha512-NxxZZek50ylIACiXebKQYHD3D4One3WXOasEXWazL6aTfYbZob7ClNKxUpg8I4/oWArX87oPWvj1cHKqfel3Hg==
dependencies:
"@types/ws" "*"
"@types/semver@^7.3.10":
version "7.3.10"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.10.tgz#5f19ee40cbeff87d916eedc8c2bfe2305d957f73"
integrity sha512-zsv3fsC7S84NN6nPK06u79oWgrPVd0NvOyqgghV1haPaFcVxIrP4DLomRwGAXk0ui4HZA7mOcSFL98sMVW9viw==
"@types/source-list-map@*":
version "0.1.2"

Loading…
Cancel
Save