Merge branch 'master' into refactoring-static-analyser

pull/1104/head
David Zagi 4 years ago committed by GitHub
commit 6ff9baa113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts
  2. 18
      apps/remix-ide/src/app/tabs/test-tab.js
  3. 3
      libs/remix-debug/src/solidity-decoder/internalCallTree.ts
  4. 4
      libs/remixd/package.json
  5. 16
      libs/remixd/src/bin/remixd.ts
  6. 20
      package-lock.json
  7. 3
      package.json

@ -82,7 +82,7 @@ module.exports = {
.clickElementAtPosition('.singleTestLabel', 0) .clickElementAtPosition('.singleTestLabel', 0)
.clickElementAtPosition('.singleTestLabel', 1) .clickElementAtPosition('.singleTestLabel', 1)
.scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]')
.pause(5000) .pause(2000)
.click('*[data-id="testTabRunTestsTabStopAction"]') .click('*[data-id="testTabRunTestsTabStopAction"]')
.waitForElementContainsText('*[data-id="testTabRunTestsTabStopAction"]', 'Stopping', 60000) .waitForElementContainsText('*[data-id="testTabRunTestsTabStopAction"]', 'Stopping', 60000)
.waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '/tests/ks2b_test.sol', 120000) .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '/tests/ks2b_test.sol', 120000)

@ -76,6 +76,7 @@ module.exports = class TestTab extends ViewPlugin {
this.updateGenerateFileAction() this.updateGenerateFileAction()
if (!this.areTestsRunning) this.updateRunAction(file) if (!this.areTestsRunning) this.updateRunAction(file)
this.updateTestFileList() this.updateTestFileList()
this.clearResults()
this.testTabLogic.getTests((error, tests) => { this.testTabLogic.getTests((error, tests) => {
if (error) return tooltip(error) if (error) return tooltip(error)
this.data.allTests = tests this.data.allTests = tests
@ -434,21 +435,26 @@ module.exports = class TestTab extends ViewPlugin {
this.uiPathList.appendChild(yo`<option>${this.inputPath.value}</option>`) this.uiPathList.appendChild(yo`<option>${this.inputPath.value}</option>`)
} }
clearResults () {
yo.update(this.resultStatistics, yo`<span></span>`)
this.call('editor', 'clearAnnotations')
this.testsOutput.innerHTML = ''
this.testsOutput.hidden = true
this.testsExecutionStopped.hidden = true
this.testsExecutionStoppedError.hidden = true
}
runTests () { runTests () {
this.areTestsRunning = true this.areTestsRunning = true
this.hasBeenStopped = false this.hasBeenStopped = false
this.readyTestsNumber = 0 this.readyTestsNumber = 0
this.runningTestsNumber = this.data.selectedTests.length this.runningTestsNumber = this.data.selectedTests.length
yo.update(this.resultStatistics, this.createResultLabel())
const stopBtn = document.getElementById('runTestsTabStopAction') const stopBtn = document.getElementById('runTestsTabStopAction')
stopBtn.removeAttribute('disabled') stopBtn.removeAttribute('disabled')
const runBtn = document.getElementById('runTestsTabRunAction') const runBtn = document.getElementById('runTestsTabRunAction')
runBtn.setAttribute('disabled', 'disabled') runBtn.setAttribute('disabled', 'disabled')
this.call('editor', 'clearAnnotations') this.clearResults()
this.testsOutput.innerHTML = '' yo.update(this.resultStatistics, this.createResultLabel())
this.testsOutput.hidden = true
this.testsExecutionStopped.hidden = true
this.testsExecutionStoppedError.hidden = true
const tests = this.data.selectedTests const tests = this.data.selectedTests
if (!tests) return if (!tests) return
this.resultStatistics.hidden = tests.length === 0 this.resultStatistics.hidden = tests.length === 0

@ -108,7 +108,8 @@ export class InternalCallTree {
} }
parentScope (scopeId) { parentScope (scopeId) {
return scopeId.replace(/(.\d|\d)$/, '') if (scopeId.indexOf('.') === -1) return ''
return scopeId.replace(/(\.\d+)$/, '')
} }
findScopeId (vmtraceIndex) { findScopeId (vmtraceIndex) {

@ -44,7 +44,9 @@
"commander": "^2.20.3", "commander": "^2.20.3",
"fs-extra": "^3.0.1", "fs-extra": "^3.0.1",
"isbinaryfile": "^3.0.2", "isbinaryfile": "^3.0.2",
"ws": "^7.3.0" "ws": "^7.3.0",
"latest-version": "^5.1.0",
"semver": "^6.3.0"
}, },
"python": { "python": {
"execPath": "python3", "execPath": "python3",

@ -1,4 +1,6 @@
#!/usr/bin/env node #!/usr/bin/env node
import latestVersion from 'latest-version'
import * as semver from 'semver'
import WebSocket from '../websocket' import WebSocket from '../websocket'
import * as servicesList from '../serviceList' import * as servicesList from '../serviceList'
import * as WS from 'ws' // eslint-disable-line import * as WS from 'ws' // eslint-disable-line
@ -8,6 +10,18 @@ import * as fs from 'fs-extra'
import * as path from 'path' import * as path from 'path'
import * as program from 'commander' import * as program from 'commander'
async function warnLatestVersion () {
const latest = await latestVersion('@remix-project/remixd')
const pjson = require('../package.json')
if (semver.eq(latest, pjson.version)) {
console.log('\x1b[32m%s\x1b[0m', `[INFO] you are using the latest version ${latest}`)
} else if (semver.gt(latest, pjson.version)) {
console.log('\x1b[33m%s\x1b[0m', `[WARN] latest version of remixd is ${latest}, you are using ${pjson.version}`)
console.log('\x1b[33m%s\x1b[0m', '[WARN] please update using the following command:')
console.log('\x1b[33m%s\x1b[0m', '[WARN] npm install @remix-project/remixd -g')
}
}
const services = { const services = {
git: (readOnly: boolean) => new servicesList.GitClient(readOnly), git: (readOnly: boolean) => new servicesList.GitClient(readOnly),
folder: (readOnly: boolean) => new servicesList.Sharedfolder(readOnly) folder: (readOnly: boolean) => new servicesList.Sharedfolder(readOnly)
@ -40,6 +54,8 @@ function startService<S extends 'git' | 'folder'> (service: S, callback: (ws: WS
}).parse(process.argv) }).parse(process.argv)
// eslint-disable-next-line // eslint-disable-next-line
await warnLatestVersion()
if (!program.remixIde) { if (!program.remixIde) {
console.log('\x1b[33m%s\x1b[0m', '[WARN] You can only connect to remixd from one of the supported origins.') console.log('\x1b[33m%s\x1b[0m', '[WARN] You can only connect to remixd from one of the supported origins.')
} else { } else {

20
package-lock.json generated

@ -15178,8 +15178,7 @@
"deep-extend": { "deep-extend": {
"version": "0.6.0", "version": "0.6.0",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="
"dev": true
}, },
"deep-is": { "deep-is": {
"version": "0.1.3", "version": "0.1.3",
@ -21217,8 +21216,7 @@
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
"dev": true
}, },
"init-package-json": { "init-package-json": {
"version": "1.10.3", "version": "1.10.3",
@ -24668,7 +24666,6 @@
"version": "5.1.0", "version": "5.1.0",
"resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz",
"integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==",
"dev": true,
"requires": { "requires": {
"package-json": "^6.3.0" "package-json": "^6.3.0"
} }
@ -33827,7 +33824,6 @@
"version": "6.5.0", "version": "6.5.0",
"resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz",
"integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==",
"dev": true,
"requires": { "requires": {
"got": "^9.6.0", "got": "^9.6.0",
"registry-auth-token": "^4.0.0", "registry-auth-token": "^4.0.0",
@ -35709,7 +35705,6 @@
"version": "1.2.8", "version": "1.2.8",
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
"integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
"dev": true,
"requires": { "requires": {
"deep-extend": "^0.6.0", "deep-extend": "^0.6.0",
"ini": "~1.3.0", "ini": "~1.3.0",
@ -36217,10 +36212,9 @@
} }
}, },
"registry-auth-token": { "registry-auth-token": {
"version": "4.2.0", "version": "4.2.1",
"resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.0.tgz", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz",
"integrity": "sha512-P+lWzPrsgfN+UEpDS3U8AQKg/UjZX6mQSJueZj3EK+vNESoqBSpBUD3gmu4sF9lOsjXWjF11dQKUqemf3veq1w==", "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==",
"dev": true,
"requires": { "requires": {
"rc": "^1.2.8" "rc": "^1.2.8"
} }
@ -36229,7 +36223,6 @@
"version": "5.1.0", "version": "5.1.0",
"resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz",
"integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==",
"dev": true,
"requires": { "requires": {
"rc": "^1.2.8" "rc": "^1.2.8"
} }
@ -39088,8 +39081,7 @@
"strip-json-comments": { "strip-json-comments": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo="
"dev": true
}, },
"strong-log-transformer": { "strong-log-transformer": {
"version": "2.1.0", "version": "2.1.0",

@ -160,6 +160,7 @@
"jquery": "^3.3.1", "jquery": "^3.3.1",
"jszip": "^3.6.0", "jszip": "^3.6.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"latest-version": "^5.1.0",
"merge": "^1.2.0", "merge": "^1.2.0",
"npm-install-version": "^6.0.2", "npm-install-version": "^6.0.2",
"react": "16.13.1", "react": "16.13.1",
@ -274,7 +275,7 @@
"request": "^2.83.0", "request": "^2.83.0",
"rimraf": "^2.6.1", "rimraf": "^2.6.1",
"selenium-standalone": "^6.17.0", "selenium-standalone": "^6.17.0",
"semver": "^6.1.2", "semver": "^6.3.0",
"solc": "0.7.4", "solc": "0.7.4",
"swarmgw": "^0.3.1", "swarmgw": "^0.3.1",
"tap-spec": "^5.0.0", "tap-spec": "^5.0.0",

Loading…
Cancel
Save