Merge pull request #3 from ethereum/setup-remixide

Update Remix-IDE (master & branches), Setup Linting and E2E tests in circleci
pull/7/head
David Disu 5 years ago committed by GitHub
commit 81d3ffe854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      .babelrc
  2. 16
      .circleci/config.yml
  3. 1
      .env
  4. 3
      .gitignore
  5. 315
      apps/remix-ide/.eslintrc.json
  6. 6
      apps/remix-ide/ci/browser_tests.sh
  7. 8
      apps/remix-ide/ci/browser_tests_chrome.sh
  8. 8
      apps/remix-ide/ci/browser_tests_firefox.sh
  9. 6
      apps/remix-ide/ci/browser_tests_run_deploy.sh
  10. 15
      apps/remix-ide/ci/makeMockCompiler.js
  11. 0
      apps/remix-ide/css/font-awesome.min.css~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  12. 4
      apps/remix-ide/css/font-awesome.min.css~HEAD
  13. 0
      apps/remix-ide/css/pygment_trac.css~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  14. 69
      apps/remix-ide/css/pygment_trac.css~HEAD
  15. 0
      apps/remix-ide/fonts/FontAwesome.otf~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  16. BIN
      apps/remix-ide/fonts/FontAwesome.otf~HEAD
  17. 0
      apps/remix-ide/fonts/fontawesome-webfont.eot~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  18. BIN
      apps/remix-ide/fonts/fontawesome-webfont.eot~HEAD
  19. 0
      apps/remix-ide/fonts/fontawesome-webfont.svg~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  20. 2671
      apps/remix-ide/fonts/fontawesome-webfont.svg~HEAD
  21. 0
      apps/remix-ide/fonts/fontawesome-webfont.ttf~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  22. BIN
      apps/remix-ide/fonts/fontawesome-webfont.ttf~HEAD
  23. 0
      apps/remix-ide/fonts/fontawesome-webfont.woff2~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  24. BIN
      apps/remix-ide/fonts/fontawesome-webfont.woff2~HEAD
  25. 0
      apps/remix-ide/fonts/fontawesome-webfont.woff~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  26. BIN
      apps/remix-ide/fonts/fontawesome-webfont.woff~HEAD
  27. 0
      apps/remix-ide/img/debuggerLogo.webp~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  28. BIN
      apps/remix-ide/img/debuggerLogo.webp~HEAD
  29. 0
      apps/remix-ide/img/gasStation_50.png~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  30. BIN
      apps/remix-ide/img/gasStation_50.png~HEAD
  31. 0
      apps/remix-ide/img/hexagon-remix-greengrey-texture.png~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  32. BIN
      apps/remix-ide/img/hexagon-remix-greengrey-texture.png~HEAD
  33. 0
      apps/remix-ide/img/homeStickers.png~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  34. BIN
      apps/remix-ide/img/homeStickers.png~HEAD
  35. 0
      apps/remix-ide/img/moreLogo.webp~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  36. BIN
      apps/remix-ide/img/moreLogo.webp~HEAD
  37. 0
      apps/remix-ide/img/mythxLogo.webp~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  38. BIN
      apps/remix-ide/img/mythxLogo.webp~HEAD
  39. 0
      apps/remix-ide/img/pipelineLogo.webp~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  40. BIN
      apps/remix-ide/img/pipelineLogo.webp~HEAD
  41. 0
      apps/remix-ide/img/sleepingRemiCroped.webp~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  42. BIN
      apps/remix-ide/img/sleepingRemiCroped.webp~HEAD
  43. 0
      apps/remix-ide/img/solidityLogo.webp~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  44. BIN
      apps/remix-ide/img/solidityLogo.webp~HEAD
  45. 0
      apps/remix-ide/img/sourceVerifyLogo.webp~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  46. BIN
      apps/remix-ide/img/sourceVerifyLogo.webp~HEAD
  47. 0
      apps/remix-ide/img/vyperLogo.webp~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  48. BIN
      apps/remix-ide/img/vyperLogo.webp~HEAD
  49. 0
      apps/remix-ide/img/workshopLogo.webp~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  50. BIN
      apps/remix-ide/img/workshopLogo.webp~HEAD
  51. 0
      apps/remix-ide/js/0.7.7/app.js~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  52. 271121
      apps/remix-ide/js/0.7.7/app.js~HEAD
  53. 0
      apps/remix-ide/js/browserfs.min.js~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  54. 8
      apps/remix-ide/js/browserfs.min.js~HEAD
  55. 12
      apps/remix-ide/nightwatch.js
  56. 12
      apps/remix-ide/nightwatch.js~36bc4ab5a5b52c76327ec5b5f7a8896938b18525
  57. 7
      apps/remix-ide/src/app/editor/editor.js
  58. 6
      apps/remix-ide/src/app/editor/sourceHighlighter.js
  59. 2
      apps/remix-ide/src/app/panels/tab-proxy.js
  60. 75
      apps/remix-ide/src/app/tabs/staticanalysis/staticAnalysisView.js
  61. 6
      apps/remix-ide/src/app/ui/landing-page/landing-page.js
  62. 21
      apps/remix-ide/src/app/ui/renderer.js
  63. 6
      apps/remix-ide/src/app/ui/styles/renderer-styles.js
  64. 21
      apps/remix-ide/test-browser/commands/editorScroll.js
  65. 2
      apps/remix-ide/test-browser/commands/signMessage.js
  66. 5
      apps/remix-ide/test-browser/commands/testFunction.js
  67. 105
      apps/remix-ide/test-browser/tests/editor.test.js
  68. 6
      apps/remix-ide/test-browser/tests/fileExplorer.test.js
  69. 5
      apps/remix-ide/test-browser/tests/runAndDeploy.js
  70. 8
      apps/remix-ide/test-browser/tests/staticAnalysis.test.js
  71. 19799
      package-lock.json
  72. 71
      package.json
  73. 11
      seleniumConfig.js
  74. 1
      soljson.js
  75. 23
      workspace.json
  76. 1894
      yarn.lock

@ -1,6 +0,0 @@
{
"presets": ["@babel/preset-env"],
"ignore": [
"node_modules"
]
}

@ -17,7 +17,7 @@ jobs:
environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI"
- FILES_TO_PACKAGE: "assets background.js build icon.png index.html manifest.json README.md soljson.js package.json"
- FILES_TO_PACKAGE: "apps/remix-ide/assets apps/remix-ide/background.js apps/remix-ide/build apps/remix-ide/icon.png apps/remix-ide/index.html apps/remix-ide/manifest.json apps/remix-ide/README.md apps/remix-ide/soljson.js apps/remix-ide/package.json"
working_directory: ~/remix-project
parallelism: 20
@ -51,7 +51,7 @@ jobs:
environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI"
- FILES_TO_PACKAGE: "assets background.js build icon.png index.html manifest.json README.md soljson.js package.json"
- FILES_TO_PACKAGE: "apps/remix-ide/assets apps/remix-ide/background.js apps/remix-ide/build apps/remix-ide/icon.png apps/remix-ide/index.html apps/remix-ide/manifest.json apps/remix-ide/README.md apps/remix-ide/soljson.js apps/remix-ide/package.json"
working_directory: ~/remix-project
parallelism: 20
@ -91,7 +91,7 @@ jobs:
environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI"
- FILES_TO_PACKAGE: "assets background.js build icon.png index.html manifest.json README.md soljson.js package.json"
- FILES_TO_PACKAGE: "apps/remix-ide/assets apps/remix-ide/background.js apps/remix-ide/build apps/remix-ide/icon.png apps/remix-ide/index.html apps/remix-ide/manifest.json apps/remix-ide/README.md apps/remix-ide/soljson.js apps/remix-ide/package.json"
working_directory: ~/remix-project
steps:
@ -123,7 +123,7 @@ jobs:
environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI"
- FILES_TO_PACKAGE: "assets background.js build icon.png index.html manifest.json README.md soljson.js package.json"
- FILES_TO_PACKAGE: "apps/remix-ide/assets apps/remix-ide/background.js apps/remix-ide/build apps/remix-ide/icon.png apps/remix-ide/index.html apps/remix-ide/manifest.json apps/remix-ide/README.md apps/remix-ide/soljson.js apps/remix-ide/package.json"
working_directory: ~/remix-project
steps:
@ -134,7 +134,7 @@ jobs:
name: Deploy
command: |
if [ "${CIRCLE_BRANCH}" == "remix_live" ]; then
./ci/deploy_from_travis_remix-live.sh;
./apps/remix-ide/ci/deploy_from_travis_remix-live.sh;
fi
- store_artifacts:
path: ./apps/remix-ide/reports/screenshots
@ -152,7 +152,7 @@ jobs:
environment:
- COMMIT_AUTHOR_EMAIL: "yann@ethereum.org"
- COMMIT_AUTHOR: "Circle CI"
- FILES_TO_PACKAGE: "assets background.js build icon.png index.html manifest.json README.md soljson.js package.json"
- FILES_TO_PACKAGE: "apps/remix-ide/assets apps/remix-ide/background.js apps/remix-ide/build apps/remix-ide/icon.png apps/remix-ide/index.html apps/remix-ide/manifest.json apps/remix-ide/README.md apps/remix-ide/soljson.js apps/remix-ide/package.json"
working_directory: ~/remix-project
steps:
@ -163,10 +163,10 @@ jobs:
name: Deploy
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
./ci/deploy_from_travis_remix-alpha.sh;
./apps/remix-ide/ci/deploy_from_travis_remix-alpha.sh;
fi
- store_artifacts:
path: ./apps/reports/screenshots
path: ./apps/remix-ide/reports/screenshots
workflows:
version: 2

@ -1,4 +1,3 @@
NODE_OPTIONS=--max-old-space-size=3072
gist_token = <token>
account_passphrase = <passphrase>
account_password = <password>

3
.gitignore vendored

@ -1,3 +1,4 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
@ -36,4 +37,4 @@ testem.log
# System Files
.DS_Store
Thumbs.db
Thumbs.db

@ -0,0 +1,315 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
},
"rules": {
"accessor-pairs": "error",
"array-bracket-newline": "off",
"array-bracket-spacing": [
"off",
"never"
],
"array-callback-return": "off",
"array-element-newline": "off",
"arrow-body-style": "off",
"arrow-parens": [
"off",
"always"
],
"arrow-spacing": [
"error",
{
"after": true,
"before": true
}
],
"block-scoped-var": "off",
"block-spacing": "error",
"brace-style": [
"off",
"1tbs"
],
"callback-return": "off",
"camelcase": "off",
"capitalized-comments": "off",
"class-methods-use-this": "off",
"comma-dangle": "off",
"comma-spacing": [
"error",
{
"after": true,
"before": false
}
],
"comma-style": [
"error",
"last"
],
"complexity": "off",
"computed-property-spacing": [
"off",
"never"
],
"consistent-return": "off",
"consistent-this": "off",
"curly": "off",
"default-case": "error",
"default-case-last": "off",
"default-param-last": "off",
"dot-location": "off",
"dot-notation": "off",
"eol-last": "error",
"eqeqeq": "off",
"func-call-spacing": "error",
"func-name-matching": "error",
"func-names": "off",
"func-style": [
"off",
"declaration"
],
"function-call-argument-newline": [
"off",
"consistent"
],
"function-paren-newline": "off",
"generator-star-spacing": "error",
"global-require": "off",
"grouped-accessor-pairs": "error",
"guard-for-in": "off",
"handle-callback-err": "error",
"id-blacklist": "error",
"id-length": "off",
"id-match": "error",
"implicit-arrow-linebreak": [
"off",
"beside"
],
"indent": "off",
"indent-legacy": "off",
"init-declarations": "off",
"jsx-quotes": "error",
"key-spacing": "error",
"keyword-spacing": [
"error",
{
"after": true,
"before": true
}
],
"line-comment-position": "off",
"linebreak-style": [
"error",
"unix"
],
"lines-around-comment": "off",
"lines-around-directive": "off",
"lines-between-class-members": [
"off",
"always"
],
"max-classes-per-file": "off",
"max-depth": "off",
"max-len": "off",
"max-lines": "off",
"max-lines-per-function": "off",
"max-nested-callbacks": "error",
"max-params": "off",
"max-statements": "off",
"max-statements-per-line": "off",
"multiline-comment-style": [
"off",
"separate-lines"
],
"new-cap": "off",
"new-parens": "error",
"newline-after-var": "off",
"newline-before-return": "off",
"newline-per-chained-call": "off",
"no-alert": "error",
"no-array-constructor": "error",
"no-await-in-loop": "off",
"no-bitwise": "off",
"no-buffer-constructor": "error",
"no-caller": "error",
"no-catch-shadow": "error",
"no-confusing-arrow": "off",
"no-console": "off",
"no-constructor-return": "error",
"no-continue": "error",
"no-div-regex": "error",
"no-duplicate-imports": "error",
"no-else-return": "off",
"no-empty-function": "off",
"no-eq-null": "off",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-extra-parens": "off",
"no-floating-decimal": "error",
"no-implicit-coercion": "off",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-inline-comments": "off",
"no-invalid-this": "off",
"no-iterator": "error",
"no-label-var": "error",
"no-labels": "error",
"no-lone-blocks": "off",
"no-lonely-if": "off",
"no-loop-func": "off",
"no-magic-numbers": "off",
"no-mixed-operators": "off",
"no-mixed-requires": "error",
"no-multi-assign": "off",
"no-multi-spaces": "off",
"no-multi-str": "error",
"no-multiple-empty-lines": "error",
"no-native-reassign": "error",
"no-negated-condition": "off",
"no-negated-in-lhs": "error",
"no-nested-ternary": "off",
"no-new": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-new-require": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-param-reassign": "off",
"no-path-concat": "error",
"no-plusplus": "off",
"no-process-env": "off",
"no-process-exit": "off",
"no-proto": "error",
"no-restricted-exports": "off",
"no-restricted-globals": "error",
"no-restricted-imports": "error",
"no-restricted-modules": "error",
"no-restricted-properties": "error",
"no-restricted-syntax": "error",
"no-return-assign": "error",
"no-return-await": "off",
"no-script-url": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-shadow": "off",
"no-spaced-func": "error",
"no-sync": "off",
"no-tabs": "error",
"no-template-curly-in-string": "error",
"no-ternary": "off",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-undefined": "off",
"no-underscore-dangle": "off",
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": "error",
"no-unused-expressions": "off",
"no-use-before-define": "off",
"no-useless-backreference": "off",
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "off",
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-useless-return": "off",
"no-var": "off",
"no-void": "off",
"no-warning-comments": "off",
"no-whitespace-before-property": "error",
"nonblock-statement-body-position": "error",
"object-curly-newline": "off",
"object-curly-spacing": "off",
"object-shorthand": "off",
"one-var": "off",
"one-var-declaration-per-line": "error",
"operator-assignment": "off",
"operator-linebreak": "error",
"padded-blocks": "off",
"padding-line-between-statements": "error",
"prefer-arrow-callback": "off",
"prefer-const": "off",
"prefer-destructuring": "off",
"prefer-exponentiation-operator": "error",
"prefer-named-capture-group": "off",
"prefer-numeric-literals": "error",
"prefer-object-spread": "error",
"prefer-promise-reject-errors": "off",
"prefer-reflect": "off",
"prefer-regex-literals": "error",
"prefer-rest-params": "off",
"prefer-spread": "off",
"prefer-template": "off",
"quote-props": "off",
"quotes": "off",
"radix": "off",
"require-atomic-updates": "off",
"require-await": "off",
"require-jsdoc": "off",
"require-unicode-regexp": "off",
"rest-spread-spacing": "error",
"semi": "off",
"semi-spacing": "error",
"semi-style": "off",
"sort-keys": [
"off",
"asc"
],
"sort-vars": "off",
"space-before-blocks": "error",
"space-before-function-paren": "error",
"space-in-parens": [
"error",
"never"
],
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": [
"off",
"always"
],
"strict": "off",
"switch-colon-spacing": "off",
"symbol-description": "error",
"template-curly-spacing": [
"error",
"never"
],
"template-tag-spacing": [
"off",
"never"
],
"unicode-bom": [
"error",
"never"
],
"valid-jsdoc": "off",
"vars-on-top": "off",
"wrap-iife": "error",
"wrap-regex": "off",
"yield-star-spacing": "error",
"yoda": [
"error",
"never"
],
"no-unused-vars": "off",
"no-redeclare": "off",
"no-empty": "off",
"no-constant-condition": "off",
"no-async-promise-executor": "off",
"no-useless-catch": "off",
"no-extra-semi": "off",
"no-undef": "off"
}
}

@ -4,11 +4,11 @@ set -e
setupRemixd () {
mkdir remixdSharedfolder
cd contracts
cd apps/remix-ide/contracts
echo 'sharing folder: '
echo $PWD
./../node_modules/remixd/bin/remixd -s $PWD --remix-ide http://127.0.0.1:8080 &
cd ..
../../../node_modules/.bin/remixd -s $PWD --remix-ide http://127.0.0.1:8080 &
cd ../../..
}
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}

@ -4,11 +4,11 @@ set -e
setupRemixd () {
mkdir remixdSharedfolder
cd contracts
cd apps/remix-ide/contracts
echo 'sharing folder: '
echo $PWD
remixd -s $PWD --remix-ide http://127.0.0.1:8080 &
cd ..
../../../node_modules/.bin/remixd -s $PWD --remix-ide http://127.0.0.1:8080 &
cd ../../..
}
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
@ -21,7 +21,7 @@ setupRemixd
sleep 5
TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings)
TESTFILES=$(circleci tests glob "./apps/remix-ide/test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings)
npm run nightwatch_local_chrome $TESTFILES
echo "$TEST_EXITCODE"

@ -4,11 +4,11 @@ set -e
setupRemixd () {
mkdir remixdSharedfolder
cd contracts
cd apps/remix-ide/contracts
echo 'sharing folder: '
echo $PWD
remixd -s $PWD --remix-ide http://127.0.0.1:8080 &
cd ..
../../../node_modules/.bin/remixd -s $PWD --remix-ide http://127.0.0.1:8080 &
cd ../../..
}
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
@ -21,7 +21,7 @@ setupRemixd
sleep 5
TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings)
TESTFILES=$(circleci tests glob "./apps/remix-ide/test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings)
npm run nightwatch_local_firefox $TESTFILES
echo "$TEST_EXITCODE"

@ -4,11 +4,11 @@ set -e
setupRemixd () {
mkdir remixdSharedfolder
cd contracts
cd apps/remix-ide/contracts
echo 'sharing folder: '
echo $PWD
remixd -s $PWD --remix-ide http://127.0.0.1:8080 &
cd ..
../../../node_modules/.bin/remixd -s $PWD --remix-ide http://127.0.0.1:8080 &
cd ../../..
}
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}

@ -4,11 +4,15 @@ var fs = require('fs')
var compiler = require('solc')
var compilerInput = require('remix-solidity').CompilerInput
var defaultVersion = 'v0.6.6+commit.6c089d02'
const path = require('path')
compiler.loadRemoteVersion(defaultVersion, (error, solcSnapshot) => {
console.log('solcSnapshot: ', solcSnapshot)
if (error) console.log(error)
var compilationResult = {}
gatherCompilationResults('./test-browser/tests/', compilationResult, solcSnapshot)
const testsFolder = path.resolve(__dirname + '/../test-browser/tests/') + '/' // eslint-disable-line
gatherCompilationResults(testsFolder, compilationResult, solcSnapshot)
replaceSolCompiler(compilationResult, solcSnapshot)
})
@ -16,7 +20,7 @@ function gatherCompilationResults (dir, compilationResult, solcSnapshot) {
var filenames = fs.readdirSync(dir, 'utf8')
filenames.map(function (item, i) {
if (item.endsWith('.js')) {
var testDef = require('.' + dir + item)
var testDef = require(dir + item)
if ('@sources' in testDef) {
var sources = testDef['@sources']()
for (var files in sources) {
@ -61,7 +65,10 @@ function compile (solcSnapshot, source, optimization, addCompilationResult) {
}
function replaceSolCompiler (results, solcSnapshot) {
fs.readFile('./test-browser/mockcompiler/compiler.js', 'utf8', function (error, data) {
const compilerPath = path.resolve(__dirname + '/../test-browser/mockcompiler/compiler.js') // eslint-disable-line
const soljsonPath = path.resolve(__dirname + '/../soljson.js') // eslint-disable-line
fs.readFile(compilerPath, 'utf8', function (error, data) {
if (error) {
console.log(error)
process.exit(1)
@ -70,7 +77,7 @@ function replaceSolCompiler (results, solcSnapshot) {
console.log(solcSnapshot.version())
data = data + '\n\nvar mockCompilerVersion = \'' + solcSnapshot.version() + '\''
data = data + '\n\nvar mockData = ' + JSON.stringify(results) + ';\n'
fs.writeFile('./soljson.js', data, 'utf8', function (error) {
fs.writeFile(soljsonPath, data, 'utf8', function (error) {
if (error) {
console.log(error)
process.exit(1)

File diff suppressed because one or more lines are too long

@ -0,0 +1,69 @@
.highlight { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { font-weight: bold } /* Keyword.Constant */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
.highlight .kn { font-weight: bold } /* Keyword.Namespace */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d14 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
.highlight .sc { color: #d14 } /* Literal.String.Char */
.highlight .sd { color: #d14 } /* Literal.String.Doc */
.highlight .s2 { color: #d14 } /* Literal.String.Double */
.highlight .se { color: #d14 } /* Literal.String.Escape */
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
.highlight .si { color: #d14 } /* Literal.String.Interpol */
.highlight .sx { color: #d14 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d14 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
.type-csharp .highlight .k { color: #0000FF }
.type-csharp .highlight .kt { color: #0000FF }
.type-csharp .highlight .nf { color: #000000; font-weight: normal }
.type-csharp .highlight .nc { color: #2B91AF }
.type-csharp .highlight .nn { color: #000000 }
.type-csharp .highlight .s { color: #A31515 }
.type-csharp .highlight .sc { color: #A31515 }

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 960 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,13 +1,13 @@
'use strict'
require('@babel/register')()
const crxFile = require('fs').readFileSync('test-browser/extensions/chrome/metamask.crx')
const crxFile = require('fs').readFileSync('apps/remix-ide/test-browser/extensions/chrome/metamask.crx')
const metamaskExtension = new Buffer.from(crxFile).toString('base64') // eslint-disable-line
module.exports = {
'src_folders': ['test-browser/tests'],
'output_folder': 'reports/tests',
'custom_commands_path': ['test-browser/commands'],
'src_folders': ['apps/remix-ide/test-browser/tests'],
'output_folder': 'apps/remix-ide/reports/tests',
'custom_commands_path': ['apps/remix-ide/test-browser/commands'],
'custom_assertions_path': '',
'page_objects_path': '',
'globals_path': '',
@ -22,7 +22,7 @@ module.exports = {
},
'screenshots': {
'enabled': true,
'path': './reports/screenshots',
'path': 'apps/remix-ide/reports/screenshots',
'on_failure': true,
'on_error': true
},
@ -31,7 +31,7 @@ module.exports = {
'javascriptEnabled': true,
'acceptSslCerts': true
},
'exclude': ['tests/runAndDeploy.js']
'exclude': ['apps/remix-ide/test-browser/tests/runAndDeploy.js']
},
'chrome': {

@ -1,13 +1,13 @@
'use strict'
require('@babel/register')()
const crxFile = require('fs').readFileSync('apps/remix-ide/test-browser/extensions/chrome/metamask.crx')
const crxFile = require('fs').readFileSync('test-browser/extensions/chrome/metamask.crx')
const metamaskExtension = new Buffer.from(crxFile).toString('base64') // eslint-disable-line
module.exports = {
'src_folders': ['apps/remix-ide/test-browser/tests'],
'output_folder': 'apps/remix-ide/reports/tests',
'custom_commands_path': ['apps/remix-ide/test-browser/commands'],
'src_folders': ['test-browser/tests'],
'output_folder': 'reports/tests',
'custom_commands_path': ['test-browser/commands'],
'custom_assertions_path': '',
'page_objects_path': '',
'globals_path': '',
@ -22,7 +22,7 @@ module.exports = {
},
'screenshots': {
'enabled': true,
'path': 'apps/remix-ide/reports/screenshots',
'path': './reports/screenshots',
'on_failure': true,
'on_error': true
},
@ -31,7 +31,7 @@ module.exports = {
'javascriptEnabled': true,
'acceptSslCerts': true
},
'exclude': ['apps/remix-ide/test-browser/tests/runAndDeploy.js']
'exclude': ['tests/runAndDeploy.js']
},
'chrome': {

@ -46,7 +46,7 @@ const profile = {
name: 'editor',
description: 'service - editor',
version: packageJson.version,
methods: ['highlight', 'discardHighlight', 'clearAnnotations', 'addAnnotation']
methods: ['highlight', 'discardHighlight', 'discardHighlightAt', 'clearAnnotations', 'addAnnotation']
}
class Editor extends Plugin {
@ -202,6 +202,11 @@ class Editor extends Plugin {
this.sourceHighlighters.discardHighlight(from)
}
discardHighlightAt (line, filePath) {
const { from } = this.currentRequest
this.sourceHighlighters.discardHighlightAt(line, filePath, from)
}
setTheme (type) {
this.editor.setTheme('ace/theme/' + this._themes[type])
}

@ -13,6 +13,7 @@ class SourceHighlighter {
fileManager: this._components.registry.get('filemanager').api,
compilerArtefacts: this._components.registry.get('compilersartefacts').api
}
this.position = null
this.statementMarker = null
this.fullLineMarker = null
this.source = null
@ -46,6 +47,7 @@ class SourceHighlighter {
.highlightcode {
position:absolute;
z-index:20;
opacity: 0.3;
background-color: ${style || 'var(--info)'};
}
.highlightcode_fullLine {
@ -59,9 +61,9 @@ class SourceHighlighter {
}
`
this.statementMarker = this._deps.editor.addMarker(lineColumnPos, this.source, css.highlightcode.className + ' ' + css.customBackgroundColor.className)
this.statementMarker = this._deps.editor.addMarker(lineColumnPos, this.source, css.highlightcode.className + ' ' + css.customBackgroundColor.className + ' ' + `highlightLine${lineColumnPos.start.line}`)
this._deps.editor.scrollToLine(lineColumnPos.start.line, true, true, function () {})
this.position = lineColumnPos
if (lineColumnPos.start.line === lineColumnPos.end.line) {
this.fullLineMarker = this._deps.editor.addMarker({
start: {

@ -189,7 +189,7 @@ export class TabProxy {
// @todo(#2492) remove style after the mainPanel layout fix.
this._view.tabs = yo`
<div style="display: -webkit-box; min-height: 35px">
<div style="display: -webkit-box; max-height: 32px">
${zoomBtns}
${this._view.filetabs}
</div>

@ -6,6 +6,7 @@ var remixLib = require('remix-lib')
var utils = remixLib.util
var css = require('./styles/staticAnalysisView-styles')
var Renderer = require('../../ui/renderer')
const SourceHighlighter = require('../../editor/sourceHighlighter')
var EventManager = require('../../../lib/events')
@ -18,6 +19,8 @@ function staticAnalysisView (localRegistry, analysisModule) {
this.lastCompilationResult = null
this.lastCompilationSource = null
this.currentFile = 'No file compiled'
this.sourceHighlighter = new SourceHighlighter()
this.analysisModule = analysisModule
self._components = {
renderer: new Renderer()
}
@ -75,7 +78,7 @@ staticAnalysisView.prototype.render = function () {
${this.modulesView}
</div>
<div class="mt-2 p-2 d-flex border-top flex-column">
<span>The last results for:</span>
<span>last results for:</span>
<span class="text-break break-word word-break font-weight-bold" id="staticAnalysisCurrentFile">${this.currentFile}</span>
</div>
<div class="${css.result} my-1" id='staticanalysisresult'></div>
@ -105,6 +108,10 @@ staticAnalysisView.prototype.run = function () {
if (!this.view) {
return
}
const highlightLocation = (location, fileName) => {
// await this.analysisModule.call('editor', 'highlight', location, fileName) @todo(#2834) use this after fixing the issue
this.sourceHighlighter.currentSourceLocationFromfileName(location, fileName)
}
const selected = this.selectedModules()
const warningContainer = $('#staticanalysisresult')
warningContainer.empty()
@ -113,10 +120,33 @@ staticAnalysisView.prototype.run = function () {
if (this.lastCompilationResult && selected.length) {
this.runBtn.removeAttribute('disabled')
let warningCount = 0
this.runner.run(this.lastCompilationResult, selected, function (results) {
results.map(function (result, i) {
result.report.map(function (item, i) {
this.runner.run(this.lastCompilationResult, selected, (results) => {
const groupedModules = utils.groupBy(preProcessModules(this.runner.modules()), 'categoryId')
results.map((result, j) => {
let moduleName
Object.keys(groupedModules).map((key) => {
groupedModules[key].forEach((el) => {
if (el.name === result.name) {
moduleName = groupedModules[key][0].categoryDisplayName
return
}
})
})
let alreadyExistedEl = this.view.querySelector(`[id="staticAnalysisModule${moduleName}"]`)
if (!alreadyExistedEl) {
warningContainer.append(`
<div class="mb-4" name="staticAnalysisModules" id="staticAnalysisModule${moduleName}">
<span class="text-dark h6">${moduleName}</span>
</div>
`)
}
result.report.map((item, i) => {
let location = ''
let locationString = 'not available'
let column = 0
let row = 0
let fileName = this.currentFile
if (item.location) {
var split = item.location.split(':')
var file = split[2]
@ -127,14 +157,39 @@ staticAnalysisView.prototype.run = function () {
location = self._deps.offsetToLineColumnConverter.offsetToLineColumn(location,
parseInt(file),
self.lastCompilationSource.sources,
self.lastCompilationResult.sources)
location = Object.keys(self.lastCompilationResult.contracts)[file] + ':' + (location.start.line + 1) + ':' + (location.start.column + 1) + ':'
self.lastCompilationResult.sources
)
row = location.start.line
column = location.start.column
locationString = (row + 1) + ':' + column + ':'
fileName = Object.keys(self.lastCompilationResult.contracts)[file]
}
warningCount++
const msg = yo`<span>${location} ${item.warning} ${item.more ? yo`<span><br><a href="${item.more}" target="blank">more</a></span>` : yo`<span></span>`}</span>`
self._components.renderer.error(msg, warningContainer, {type: 'staticAnalysisWarning alert alert-warning', useSpan: true})
const msg = yo`
<span class="d-flex flex-column">
<span class="h6 font-weight-bold">${result.name}</span>
${item.warning}
${item.more ? yo`<span><a href="${item.more}" target="blank">more</a></span>` : yo`<span></span>`}
<span class="" title="Position in ${fileName}">Pos: ${locationString}</span>
</span>`
self._components.renderer.error(
msg,
this.view.querySelector(`[id="staticAnalysisModule${moduleName}"]`),
{
click: () => highlightLocation(location, fileName),
type: 'warning',
useSpan: true,
errFile: fileName,
errLine: row,
errCol: column
}
)
})
})
// hide empty staticAnalysisModules sections
this.view.querySelectorAll('[name="staticAnalysisModules"]').forEach((section) => {
if (!section.getElementsByClassName('alert-warning').length) section.hidden = true
})
self.event.trigger('staticAnaysisWarning', [warningCount])
})
} else {
@ -206,8 +261,8 @@ staticAnalysisView.prototype.renderModules = function () {
return yo`
<div class="${css.block}">
<input type="radio" name="accordion" class="w-100 d-none card" id="heading${categoryId}" onclick=${(e) => this.handleCollapse(e)}"/>
<label for="heading${categoryId}" style="cursor: pointer;" class="pl-3 h6 card-header d-flex justify-content-between font-weight-bold border-left px-1 py-2 w-100">
<span>${category[0].categoryDisplayName}</span>
<label for="heading${categoryId}" style="cursor: pointer;" class="pl-3 card-header h6 d-flex justify-content-between font-weight-bold border-left px-1 py-2 w-100">
${category[0].categoryDisplayName}
<div>
<i class="fas fa-angle-double-right"></i>
</div>

@ -195,7 +195,7 @@ export class LandingPage extends ViewPlugin {
const createEnvButton = (imgPath, envID, envText, callback) => {
return yo`
<button class="btn btn-lg border-secondary d-flex mr-3 justify-content-center flex-column align-items-center ${css.envButton}" data-id="landingPageStartSolidity" onclick=${() => callback()}>
<button class="btn border-secondary d-flex mr-3 text-nowrap justify-content-center flex-column align-items-center ${css.envButton}" data-id="landingPageStartSolidity" onclick=${() => callback()}>
<img class="m-2 align-self-center ${css.envLogo}" id=${envID} src="${imgPath}">
<label class="text-uppercase text-dark ${css.envLabel}">${envText}</label>
</button>
@ -233,8 +233,8 @@ export class LandingPage extends ViewPlugin {
<div class="${css.logoContainer}">${img}</div>
</div>
<div class="${css.jumboBtnContainer} px-5">
<button class="btn btn-primary btn-lg mx-3" href="#" onclick=${() => learnMore()} role="button">Learn more</button>
<button class="btn btn-secondary btn-lg" onclick=${() => switchToPreviousVersion()}>Use previous version</button>
<button class="btn btn-primary mx-3" href="#" onclick=${() => learnMore()} role="button">Learn more</button>
<button class="btn btn-secondary" onclick=${() => switchToPreviousVersion()}>Use previous version</button>
</div>
</div><!-- end of jumbotron -->
</div><!-- end of jumbotron container -->

@ -55,7 +55,18 @@ Renderer.prototype._errorClick = function (errFile, errLine, errCol) {
*
* @param {String or DOMElement} message
* @param {DOMElement} container
* @param {Object} options {useSpan, noAnnotations, click:(Function), type:(warning, error, staticAnalysisWarning), errFile, errLine, errCol}
* @param {Object} options {
* useSpan,
* noAnnotations,
* click:(Function),
* type:(
* warning,
* error
* ),
* errFile,
* errLine,
* errCol
* }
*/
Renderer.prototype.error = function (message, container, opt) {
if (!message) return
@ -71,7 +82,7 @@ Renderer.prototype.error = function (message, container, opt) {
}
var errLocation = text.match(/^([^:]*):([0-9]*):(([0-9]*):)? /)
if (errLocation) {
if ((!opt.errFile || !opt.errCol || !opt.errLine) && errLocation) {
errLocation = parseRegExError(errLocation)
opt.errFile = errLocation.errFile
opt.errLine = errLocation.errLine
@ -94,10 +105,10 @@ Renderer.prototype.error = function (message, container, opt) {
$(container).append($error)
$error.click((ev) => {
if (opt.errFile && opt.errLine) {
this._errorClick(opt.errFile, opt.errLine, opt.errCol)
} else if (opt.click) {
if (opt.click) {
opt.click(message)
} else if (opt.errFile && opt.errLine && opt.errCol) {
this._errorClick(opt.errFile, opt.errLine, opt.errCol)
}
})

@ -3,7 +3,6 @@ var yo = require('yo-yo')
var css = yo`<style>
.sol.success,
.sol.error,
.sol.staticAnalysisWarning,
.sol.warning {
white-space: pre-line;
word-wrap: break-word;
@ -17,7 +16,6 @@ var css = yo`<style>
.sol.success pre,
.sol.error pre,
.sol.staticAnalysisWarning pre,
.sol.warning pre {
white-space: pre-line;
overflow-y: hidden;
@ -30,7 +28,6 @@ var css = yo`<style>
}
.sol.success .close,
.sol.staticAnalysisWarning .close,
.sol.error .close,
.sol.warning .close {
white-space: pre-line;
@ -48,9 +45,6 @@ var css = yo`<style>
.sol.warning {
}
.sol.staticAnalysisWarning {
}
.sol.success {
/* background-color: // styles.rightPanel.message_Success_BackgroundColor; */
}</style>`

@ -0,0 +1,21 @@
const EventEmitter = require('events')
// fix for editor scroll
class ScrollEditor extends EventEmitter {
command (direction, numberOfTimes) {
const browser = this.api
browser.waitForElementPresent('.ace_text-input')
for (let i = 0; i < numberOfTimes; i++) {
if (direction.toLowerCase() === 'up') browser.sendKeys('.ace_text-input', browser.Keys.ARROW_UP)
if (direction.toLowerCase() === 'down') browser.sendKeys('.ace_text-input', browser.Keys.ARROW_DOWN)
}
browser.perform((done) => {
done()
this.emit('complete')
})
return this
}
}
module.exports = ScrollEditor

@ -18,7 +18,7 @@ function signMsg (browser, msg, cb) {
browser
.waitForElementPresent('i[id="remixRunSignMsg"]')
.click('i[id="remixRunSignMsg"]')
.waitForElementPresent('textarea[id="prompt_text"]')
.waitForElementVisible('textarea[id="prompt_text"]')
.setValue('textarea[id="prompt_text"]', msg, () => {
browser.modalFooterOKClick().perform(
(client, done) => {

@ -10,12 +10,11 @@ class TestFunction extends EventEmitter {
browser.waitForElementVisible(`*[data-id="txLogger${txHash}"]`)
.click(`*[data-id="txLogger${txHash}"]`)
.waitForElementVisible(`*[data-id="txLoggerTable${txHash}"]`)
.click(`*[data-id="txLoggerTable${txHash}"]`)
// fetch and format transaction logs as key => pair object
.elements('css selector', `*[data-shared="key_${txHash}"]`, (res) => {
res.value.forEach(function (jsonWebElement) {
const jsonWebElementId = jsonWebElement.ELEMENT
const jsonWebElementId = jsonWebElement.ELEMENT || jsonWebElement[Object.keys(jsonWebElement)[0]]
browser.elementIdText(jsonWebElementId, (jsonElement) => {
const key = jsonElement.value.trim()
@ -26,7 +25,7 @@ class TestFunction extends EventEmitter {
})
.elements('css selector', `*[data-shared="pair_${txHash}"]`, (res) => {
res.value.forEach(function (jsonWebElement, index) {
const jsonWebElementId = jsonWebElement.ELEMENT
const jsonWebElementId = jsonWebElement.ELEMENT || jsonWebElement[Object.keys(jsonWebElement)[0]]
browser.elementIdText(jsonWebElementId, (jsonElement) => {
let value = jsonElement.value

@ -70,6 +70,41 @@ module.exports = {
.checkElementStyle('.ace_comment.ace_doc', 'color', aceThemes.dark.comment)
.checkElementStyle('.ace_function', 'color', aceThemes.dark.function)
.checkElementStyle('.ace_variable', 'color', aceThemes.dark.variable)
},
'Should highlight source code': function (browser) {
browser.addFile('sourcehighlight.js', sourcehighlightScript)
.switchFile('browser/sourcehighlight.js')
.executeScript('remix.exeCurrent()')
.editorScroll('down', 60)
.waitForElementPresent('.highlightLine32')
.checkElementStyle('.highlightLine32', 'background-color', 'rgb(8, 108, 181)')
.waitForElementPresent('.highlightLine40')
.checkElementStyle('.highlightLine40', 'background-color', 'rgb(8, 108, 181)')
.waitForElementPresent('.highlightLine50')
.checkElementStyle('.highlightLine50', 'background-color', 'rgb(8, 108, 181)')
},
'Should remove 1 highlight from source code': function (browser) {
browser.addFile('removeSourcehighlightScript.js', removeSourcehighlightScript)
.switchFile('browser/removeSourcehighlightScript.js')
.executeScript('remix.exeCurrent()')
.switchFile('browser/3_Ballot.sol')
.editorScroll('down', 60)
.waitForElementNotPresent('.highlightLine32')
.checkElementStyle('.highlightLine40', 'background-color', 'rgb(8, 108, 181)')
.checkElementStyle('.highlightLine50', 'background-color', 'rgb(8, 108, 181)')
},
'Should remove all highlights from source code': function (browser) {
browser.addFile('removeAllSourcehighlightScript.js', removeAllSourcehighlightScript)
.switchFile('browser/removeAllSourcehighlightScript.js')
.executeScript('remix.exeCurrent()')
.switchFile('browser/3_Ballot.sol')
.editorScroll('down', 60)
.waitForElementNotPresent('.highlightLine32')
.waitForElementNotPresent('.highlightLine40')
.waitForElementNotPresent('.highlightLine50')
.end()
},
@ -90,3 +125,73 @@ var aceThemes = {
variable: 'rgb(153, 119, 68)'
}
}
const sourcehighlightScript = {
content: `
(async () => {
try {
const pos = {
start: {
line: 32,
column: 3
},
end: {
line: 32,
column: 20
}
}
await remix.call('editor', 'highlight', pos, 'browser/3_Ballot.sol')
const pos2 = {
start: {
line: 40,
column: 3
},
end: {
line: 40,
column: 20
}
}
await remix.call('editor', 'highlight', pos2, 'browser/3_Ballot.sol')
const pos3 = {
start: {
line: 50,
column: 3
},
end: {
line: 50,
column: 20
}
}
await remix.call('editor', 'highlight', pos3, 'browser/3_Ballot.sol')
} catch (e) {
console.log(e.message)
}
})()
`
}
const removeSourcehighlightScript = {
content: `
(async () => {
try {
await remix.call('editor', 'discardHighlightAt', 32, 'browser/3_Ballot.sol')
} catch (e) {
console.log(e.message)
}
})()
`
}
const removeAllSourcehighlightScript = {
content: `
(async () => {
try {
await remix.call('editor', 'discardHighlight')
} catch (e) {
console.log(e.message)
}
})()
`
}

@ -29,11 +29,7 @@ module.exports = {
'Should rename `5_New_contract.sol` to 5_Renamed_Contract.sol': function (browser) {
browser
.waitForElementVisible('*[data-id="treeViewLibrowser/5_New_contract.sol"]')
.rightClick('[data-path="browser/5_New_contract.sol"]')
.click('*[id="menuitemrename"]')
.sendKeys('[data-path="browser/5_New_contract.sol"]', '5_Renamed_Contract.sol')
.sendKeys('[data-path="browser/5_New_contract.sol"]', browser.Keys.ENTER)
.keys()
.renameFile('browser/5_New_contract.sol', '5_Renamed_Contract.sol', 'browser/5_Renamed_Contract.sol')
.waitForElementVisible('*[data-id="treeViewLibrowser/5_Renamed_Contract.sol"]')
},

@ -47,9 +47,9 @@ module.exports = {
.waitForElementPresent('*[data-id="Deploy - transact (not payable)"]')
.click('*[data-id="Deploy - transact (not payable)"]')
.pause(5000)
.testFunction('0xe9b627a180f90a24feb6850f29e4121ea312f315f61756c31468ffbda2955a64', {
.testFunction('0xc39ee005c1e1368c84f02e458de4b41dbb966631a8714d15ef8362dada249ede', {
status: '0x1 Transaction mined and execution succeed',
'transaction hash': '0xe9b627a180f90a24feb6850f29e4121ea312f315f61756c31468ffbda2955a64'
'transaction hash': '0xc39ee005c1e1368c84f02e458de4b41dbb966631a8714d15ef8362dada249ede'
})
},
@ -196,7 +196,6 @@ var sources = [
content:
`
pragma solidity ^0.6.0;
contract helloWorld {
string public message;

@ -38,11 +38,11 @@ function runTests (browser) {
.testContracts('Untitled.sol', sources[0]['browser/Untitled.sol'], ['TooMuchGas', 'test1', 'test2'])
.clickLaunchIcon('solidityStaticAnalysis')
.click('#staticanalysisView button')
.waitForElementPresent('#staticanalysisresult .staticAnalysisWarning', 2000, true, function () {
listSelectorContains(['browser/Untitled.sol:3:33:Use of tx.origin',
.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.'],
'#staticanalysisresult .staticAnalysisWarning',
'#staticanalysisresult .warning',
browser, function () {
browser.end()
}
@ -61,7 +61,7 @@ function listSelectorContains (textsToFind, selector, browser, callback) {
}, [selector], function (result) {
console.log(result.value)
for (var k in textsToFind) {
console.log('testing ' + result.value[k] + ' against ' + textsToFind[k])
console.log('testing `' + result.value[k] + '` against `' + textsToFind[k] + '`')
browser.assert.equal(result.value[k].indexOf(textsToFind[k]) !== -1, true)
}
callback()

19799
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -55,32 +55,32 @@
"browsertest": "sleep 5 && npm run nightwatch_local",
"csslint": "csslint --ignore=order-alphabetical --errors='errors,duplicate-properties,empty-rules' --exclude-list='apps/remix-ide/assets/css/font-awesome.min.css' apps/remix-ide/assets/css/",
"downloadsolc_root": "wget --no-check-certificate https://solc-bin.ethereum.org/bin/soljson-v0.6.6+commit.6c089d02.js -O soljson.js",
"make-mock-compiler": "node ci/makeMockCompiler.js",
"make-mock-compiler": "node apps/remix-ide/ci/makeMockCompiler.js",
"minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false",
"nightwatch_parallel": "nightwatch -e chrome,firefox --config apps/remix-ide/nightwatch.js",
"nightwatch_local_firefox": "nightwatch --config apps/remix-ide/nightwatch.js --env firefox",
"nightwatch_local_chrome": "nightwatch --config apps/remix-ide/nightwatch.js --env chrome",
"nightwatch_local_ballot": "nightwatch ./apps/remix-ide/test-browser/tests/ballot.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_libraryDeployment": "nightwatch ./apps/remix-ide/test-browser/tests/libraryDeployment.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_solidityImport": "nightwatch ./apps/remix-ide/test-browser/tests/solidityImport.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_recorder": "nightwatch ./apps/remix-ide/test-browser/tests/recorder.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_transactionExecution": "nightwatch ./apps/remix-ide/test-browser/tests/transactionExecution.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_staticAnalysis": "nightwatch ./apps/remix-ide/test-browser/tests/staticAnalysis.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_signingMessage": "nightwatch ./apps/remix-ide/test-browser/tests/signingMessage.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_specialFunctions": "nightwatch ./apps/remix-ide/test-browser/tests/specialFunctions.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_solidityUnitTests": "nightwatch ./apps/remix-ide/test-browser/tests/solidityUnittests.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_remixd": "nightwatch ./apps/remix-ide/test-browser/tests/remixd.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_terminal": "nightwatch ./apps/remix-ide/test-browser/tests/terminal.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_gist": "nightwatch ./apps/remix-ide/test-browser/tests/gist.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_workspace": "nightwatch ./apps/remix-ide/test-browser/tests/workspace.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_defaultLayout": "nightwatch ./apps/remix-ide/test-browser/tests/defaultLayout.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_pluginManager": "nightwatch ./apps/remix-ide/test-browser/tests/pluginManager.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_publishContract": "nightwatch ./apps/remix-ide/test-browser/tests/publishContract.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_generalSettings": "nightwatch ./apps/remix-ide/test-browser/tests/generalSettings.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_fileExplorer": "nightwatch ./apps/remix-ide/test-browser/tests/fileExplorer.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_debugger": "nightwatch ./apps/remix-ide/test-browser/tests/debugger.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_editor": "nightwatch ./apps/remix-ide/test-browser/tests/editor.test.js --config nightwatch.js --env chrome ",
"nightwatch_local_runAndDeploy": "nightwatch ./apps/remix-ide/test-browser/tests/runAndDeploy.js --config nightwatch.js --env chrome-runAndDeploy ",
"nightwatch_local_ballot": "nightwatch ./apps/remix-ide/test-browser/tests/ballot.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_libraryDeployment": "nightwatch ./apps/remix-ide/test-browser/tests/libraryDeployment.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_solidityImport": "nightwatch ./apps/remix-ide/test-browser/tests/solidityImport.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_recorder": "nightwatch ./apps/remix-ide/test-browser/tests/recorder.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_transactionExecution": "nightwatch ./apps/remix-ide/test-browser/tests/transactionExecution.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_staticAnalysis": "nightwatch ./apps/remix-ide/test-browser/tests/staticAnalysis.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_signingMessage": "nightwatch ./apps/remix-ide/test-browser/tests/signingMessage.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_specialFunctions": "nightwatch ./apps/remix-ide/test-browser/tests/specialFunctions.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_solidityUnitTests": "nightwatch ./apps/remix-ide/test-browser/tests/solidityUnittests.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_remixd": "nightwatch ./apps/remix-ide/test-browser/tests/remixd.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_terminal": "nightwatch ./apps/remix-ide/test-browser/tests/terminal.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_gist": "nightwatch ./apps/remix-ide/test-browser/tests/gist.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_workspace": "nightwatch ./apps/remix-ide/test-browser/tests/workspace.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_defaultLayout": "nightwatch ./apps/remix-ide/test-browser/tests/defaultLayout.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_pluginManager": "nightwatch ./apps/remix-ide/test-browser/tests/pluginManager.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_publishContract": "nightwatch ./apps/remix-ide/test-browser/tests/publishContract.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_generalSettings": "nightwatch ./apps/remix-ide/test-browser/tests/generalSettings.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_fileExplorer": "nightwatch ./apps/remix-ide/test-browser/tests/fileExplorer.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_debugger": "nightwatch ./apps/remix-ide/test-browser/tests/debugger.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_editor": "nightwatch ./apps/remix-ide/test-browser/tests/editor.test.js --config apps/remix-ide/nightwatch.js --env chrome ",
"nightwatch_local_runAndDeploy": "nightwatch ./apps/remix-ide/test-browser/tests/runAndDeploy.js --config apps/remix-ide/nightwatch.js --env chrome-runAndDeploy ",
"onchange": "onchange apps/remix-ide/build/app.js -- npm-run-all lint",
"prepublish": "mkdirp build; npm-run-all -ls downloadsolc_root build",
"remixd": "remixd -s ./apps/remix-ide/contracts --remix-ide http://127.0.0.1:8080",
@ -92,15 +92,6 @@
"reinstall": "rm ./node-modules/ -rf; rm package-lock.json; rm ./build/ -rf; npm install; npm run build",
"ganache-cli": "npx ganache-cli"
},
"standard": {
"ignore": [
"apps/remix-ide/build/",
"apps/remix-ide/src/app/editor/mode-solidity.js",
"apps/remix-ide/soljson.js",
"apps/remix-ide/assets/js/"
],
"parser": "babel-eslint"
},
"browserify": {
"transform": [
[
@ -138,17 +129,9 @@
"dependencies": {
"@remixproject/engine": "^0.2.3",
"http-server": "^0.11.1",
"remixd": "0.1.8-alpha.10",
"standard": "^8.5.0"
"remixd": "0.1.8-alpha.10"
},
"devDependencies": {
"@nrwl/workspace": "9.2.4",
"@types/node": "~8.9.4",
"ts-node": "~7.0.0",
"tslint": "~6.0.0",
"eslint": "6.8.0",
"typescript": "~3.8.3",
"prettier": "1.19.1",
"@babel/core": "^7.4.5",
"@babel/plugin-transform-object-assign": "^7.2.0",
"@babel/polyfill": "^7.4.4",
@ -158,7 +141,10 @@
"@babel/preset-stage-0": "^7.0.0",
"@babel/register": "^7.4.4",
"@fortawesome/fontawesome-free": "^5.8.1",
"@nrwl/linter": "^9.3.0",
"@nrwl/workspace": "9.2.4",
"@resolver-engine/imports": "^0.3.0",
"@types/node": "~8.9.4",
"ace-mode-move": "0.0.1",
"ace-mode-solidity": "^0.1.0",
"ace-mode-zokrates": "^1.0.0",
@ -177,6 +163,7 @@
"csslint": "^1.0.2",
"deep-equal": "^1.0.1",
"dotenv": "^8.2.0",
"eslint": "6.8.0",
"ethereumjs-util": "^6.2.0",
"ethers": "^4.0.27",
"events": "^3.0.0",
@ -201,6 +188,7 @@
"npm-merge-driver": "^2.3.5",
"npm-run-all": "^4.0.2",
"onchange": "^3.2.1",
"prettier": "1.19.1",
"remix-analyzer": "0.5.2",
"remix-debug": "0.4.4",
"remix-lib": "0.4.29",
@ -216,6 +204,9 @@
"solc": "^0.6.0",
"swarmgw": "^0.3.1",
"tape": "^4.5.1",
"ts-node": "~7.0.0",
"tslint": "~6.0.0",
"typescript": "~3.8.3",
"uglify-js": "^2.8.16",
"vm-browserify": "0.0.4",
"watchify": "^3.9.0",

@ -1,11 +0,0 @@
module.exports = {
version: '3.8.1',
baseURL: 'https://selenium-release.storage.googleapis.com',
drivers: {
chrome: {
version: '2.39',
arch: process.arch,
baseURL: 'https://chromedriver.storage.googleapis.com'
}
}
}

File diff suppressed because one or more lines are too long

@ -38,12 +38,18 @@
}
},
"lint": {
"builder": "@nrwl/workspace:run-commands",
"builder": "@nrwl/linter:lint",
"options": {
"commands": [
{
"command": "standard | notify-error"
}
"linter": "eslint",
"config": "apps/remix-ide/.eslintrc.json",
"files": [
"apps/remix-ide/**/*.js"
],
"exclude": ["**/node_modules/**",
"apps/remix-ide/build/**/*.js",
"apps/remix-ide/src/app/editor/mode-solidity.js",
"apps/remix-ide/soljson.js",
"apps/remix-ide/assets/js/**/*.js"
]
}
},
@ -52,7 +58,7 @@
"options": {
"commands": [
{
"command": "csslint && standard && node test/index.js"
"command": "csslint && node apps/remix-ide/test/index.js"
}
]
}
@ -63,7 +69,7 @@
}
},
"cli": {
"defaultCollection": "@nrwl/web"
"defaultCollection": "@nrwl/workspace"
},
"schematics": {
"@nrwl/workspace": {
@ -82,6 +88,9 @@
},
"library": {
"linter": "eslint"
},
"storybook-configuration": {
"linter": "eslint"
}
},
"@nrwl/next": {

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save