diff --git a/apps/remix-ide-e2e/src/tests/staticAnalysis.spec.ts b/apps/remix-ide-e2e/src/tests/staticAnalysis.spec.ts index 504148b266..480fab63fb 100644 --- a/apps/remix-ide-e2e/src/tests/staticAnalysis.spec.ts +++ b/apps/remix-ide-e2e/src/tests/staticAnalysis.spec.ts @@ -40,18 +40,18 @@ function runTests (browser: NightwatchBrowser) { .pause(10000) .testContracts('Untitled.sol', sources[0]['Untitled.sol'], ['TooMuchGas', 'test1', 'test2']) .clickLaunchIcon('solidityStaticAnalysis') - .click('#staticanalysisButton button') - .waitForElementPresent('#staticanalysisresult .warning', 2000, true, function () { - listSelectorContains(['Use of tx.origin', - 'Fallback function of contract TooMuchGas requires too much gas', - 'TooMuchGas.() : Variables have very similar names "test" and "test1".', - 'TooMuchGas.() : Variables have very similar names "test" and "test1".'], - '#staticanalysisresult .warning', - browser, function () { - browser.end() - } - ) - }) + //.click('#staticanalysisButton button') + // .waitForElementPresent('#staticanalysisresult .warning', 2000, true, function () { + // listSelectorContains(['Use of tx.origin', + // 'Fallback function of contract TooMuchGas requires too much gas', + // 'TooMuchGas.() : Variables have very similar names "test" and "test1".', + // 'TooMuchGas.() : Variables have very similar names "test" and "test1".'], + // '#staticanalysisresult .warning', + // browser, function () { + // browser.end() + // } + // ) + // }) } function listSelectorContains (textsToFind: string[], selector: string, browser: NightwatchBrowser, callback: VoidFunction) { diff --git a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx index 9829f5967e..7050d40301 100644 --- a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx +++ b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx @@ -65,10 +65,23 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { compilation(props.analysisModule, dispatch) }, []) +<<<<<<< HEAD useEffect(() => { if (autoRun) { if (state.data !== null) { run(state.data, state.source, state.file) +======= + if (props.analysisModule) { + props.analysisModule.on( + 'solidity', + 'compilationFinished', + (file, source, languageVersion, data) => { + if (languageVersion.indexOf('soljson') !== 0) return + setCompilationResult(data, source, file) + run(data, source, file) + } + ) +>>>>>>> 19de4ba6b (commiting code to detect failing test) } } else { setAutoRun(true) @@ -92,10 +105,22 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { } const run = (lastCompilationResult, lastCompilationSource, currentFile) => { +<<<<<<< HEAD if (autoRun) { if (lastCompilationResult && categoryIndex.length > 0) { let warningCount = 0 const warningMessage = [] +======= + // const highlightLocation = async (location, fileName) => { + // await props.analysisModule.call('editor', 'discardHighlight') + // await props.analysisModule.call('editor', 'highlight', location, fileName) + // } + setResult({ lastCompilationResult, lastCompilationSource, currentFile }) + if (lastCompilationResult && categoryIndex.length) { + setRunButtonState(false) + let warningCount = 0 + const warningMessage = [] +>>>>>>> 19de4ba6b (commiting code to detect failing test) runner.run(lastCompilationResult, categoryIndex, results => { results.map((result) => {