From d751e258163949081544eb10050858e5262c884c Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 3 Nov 2021 10:53:02 +0100 Subject: [PATCH 01/27] fix changing the theme to remix-dark --- apps/remix-ide/src/app/editor/editor.js | 11 ++++++----- libs/remix-ui/editor/src/lib/remix-ui-editor.tsx | 10 ++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/apps/remix-ide/src/app/editor/editor.js b/apps/remix-ide/src/app/editor/editor.js index a6ea53ca9b..e7e072d3f2 100644 --- a/apps/remix-ide/src/app/editor/editor.js +++ b/apps/remix-ide/src/app/editor/editor.js @@ -97,7 +97,7 @@ class Editor extends Plugin { this.emit(name, ...params) // plugin stack } - onActivation () { + async onActivation () { this.activated = true this.on('sidePanel', 'focusChanged', (name) => { this.keepDecorationsFor(name, 'sourceAnnotationsPerFile') @@ -112,10 +112,11 @@ class Editor extends Plugin { this.currentTheme = translateTheme(theme) this.renderComponent() }) - this.call('theme', 'currentTheme', (theme) => { - this.currentTheme = translateTheme(theme) - this.renderComponent() - }) + try { + this.currentTheme = translateTheme(await this.call('theme', 'currentTheme')) + } catch (e) { + console.log('unable to select the theme ' + e.message) + } this.renderComponent() } diff --git a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx index fceb98d971..489391b0be 100644 --- a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx +++ b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx @@ -82,8 +82,6 @@ export const EditorUI = (props: EditorUIProps) => { monacoRef.current.editor.setTheme(props.theme) }, [props.theme]) - if (monacoRef.current) monacoRef.current.editor.setTheme(props.theme) - const setAnnotationsbyFile = (uri) => { if (props.sourceAnnotationsPerFile[uri]) { const model = editorModelsState[uri]?.model @@ -220,10 +218,10 @@ export const EditorUI = (props: EditorUIProps) => { function handleEditorWillMount (monaco) { monacoRef.current = monaco // see https://microsoft.github.io/monaco-editor/playground.html#customizing-the-appearence-exposed-colors - const lightColor = window.getComputedStyle(document.documentElement).getPropertyValue('--light').trim() - const infoColor = window.getComputedStyle(document.documentElement).getPropertyValue('--info').trim() - const darkColor = window.getComputedStyle(document.documentElement).getPropertyValue('--dark').trim() - const grayColor = window.getComputedStyle(document.documentElement).getPropertyValue('--gray-dark').trim() + const lightColor = '#2a2c3f' + const infoColor = '#086CB5' + const darkColor = '#222336' + const grayColor = '#343a40' monaco.editor.defineTheme('remix-dark', { base: 'vs-dark', inherit: true, // can also be false to completely replace the builtin rules From 51c689436c8f8cf96312bc07e7401f4ef7c5e602 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 3 Nov 2021 12:09:20 +0100 Subject: [PATCH 02/27] make sure tabs are correctly closed --- apps/remix-ide/src/app/panels/tab-proxy.js | 15 ++++++--------- libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx | 5 ++--- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/apps/remix-ide/src/app/panels/tab-proxy.js b/apps/remix-ide/src/app/panels/tab-proxy.js index 7c652ab78b..2e29c0e4e9 100644 --- a/apps/remix-ide/src/app/panels/tab-proxy.js +++ b/apps/remix-ide/src/app/panels/tab-proxy.js @@ -191,13 +191,6 @@ export class TabProxy extends Plugin { } } - switchToActiveTab () { - const active = this.tabsApi.active() - if (active && this._handlers[active]) { - this.switchTab(active) - } - } - renameTab (oldName, newName) { this.addTab(newName, '', () => { this.fileManager.open(newName) @@ -271,10 +264,14 @@ export class TabProxy extends Plugin { removeTab (name) { delete this._handlers[name] - this.switchToActiveTab() - this.loadedTabs = this.loadedTabs.filter(tab => tab.name !== name) + let previous = null + this.loadedTabs = this.loadedTabs.filter((tab, index) => { + if (tab.name === name) previous = this.loadedTabs[index - 1] + return tab.name !== name + }) this.renderComponent() this.updateImgStyles() + if (previous) this.switchTab(previous.name) } addHandler (type, fn) { diff --git a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx index 5efc17aaca..3f37f2e57c 100644 --- a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx +++ b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx @@ -35,10 +35,10 @@ export const TabsUI = (props: TabsUIProps) => { const classNameImg = 'my-1 mr-1 text-dark ' + tab.iconClass const classNameTab = 'nav-item nav-link d-flex justify-content-center align-items-center px-2 py-1 tab' + (index === currentIndexRef.current ? ' active' : '') return ( -
{ tabsRef.current[index] = el }} className={classNameTab} title={tab.tooltip}> +
{ props.onSelect(index); currentIndexRef.current = index; setSelectedIndex(index); }} ref={el => { tabsRef.current[index] = el }} className={classNameTab} title={tab.tooltip}> {tab.icon ? () : ()} {tab.title} - props.onClose(index)}> + { props.onClose(index); event.stopPropagation(); }}>
@@ -71,7 +71,6 @@ export const TabsUI = (props: TabsUIProps) => { { props.onSelect(index); currentIndexRef.current = index; setSelectedIndex(index) }} > {props.tabs.map((tab, i) => {renderTab(tab, i)})} From f7c94e73442284f7755a5e018da1e58b18ad8863 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 3 Nov 2021 12:24:40 +0100 Subject: [PATCH 03/27] add keybinding for the editor --- libs/remix-ui/editor/src/lib/remix-ui-editor.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx index 489391b0be..9db6922e46 100644 --- a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx +++ b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx @@ -213,6 +213,12 @@ export const EditorUI = (props: EditorUIProps) => { (window as any).addRemixBreakpoint(e.target.position) } }) + editor.addCommand(monacoRef.current.KeyMod.CtrlCmd | monacoRef.current.KeyCode.US_EQUAL, () => { + editor.updateOptions({ fontSize: editor.getOption(42).fontSize + 1 }) + }) + editor.addCommand(monacoRef.current.KeyMod.CtrlCmd | monacoRef.current.KeyCode.US_MINUS, () => { + editor.updateOptions({ fontSize: editor.getOption(42).fontSize - 1 }) + }) } function handleEditorWillMount (monaco) { From 358d05de0a2999a6c59a0dab27b8ee8bde51dba8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 3 Nov 2021 12:28:06 +0100 Subject: [PATCH 04/27] update icon --- libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx index 3f37f2e57c..22532562e6 100644 --- a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx +++ b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx @@ -35,10 +35,10 @@ export const TabsUI = (props: TabsUIProps) => { const classNameImg = 'my-1 mr-1 text-dark ' + tab.iconClass const classNameTab = 'nav-item nav-link d-flex justify-content-center align-items-center px-2 py-1 tab' + (index === currentIndexRef.current ? ' active' : '') return ( -
{ props.onSelect(index); currentIndexRef.current = index; setSelectedIndex(index); }} ref={el => { tabsRef.current[index] = el }} className={classNameTab} title={tab.tooltip}> +
{ props.onSelect(index); currentIndexRef.current = index; setSelectedIndex(index) }} ref={el => { tabsRef.current[index] = el }} className={classNameTab} title={tab.tooltip}> {tab.icon ? () : ()} {tab.title} - { props.onClose(index); event.stopPropagation(); }}> + { props.onClose(index); event.stopPropagation() }}>
From b891d235e11d422a3a37e1554371d103d12b62a4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 4 Nov 2021 10:08:11 +0100 Subject: [PATCH 05/27] fix changing the theme --- apps/remix-ide/src/app/editor/editor.js | 2 +- apps/remix-ide/src/app/tabs/theme-module.js | 12 +++-- .../editor/src/lib/remix-ui-editor.tsx | 50 +++++++++++-------- 3 files changed, 39 insertions(+), 25 deletions(-) diff --git a/apps/remix-ide/src/app/editor/editor.js b/apps/remix-ide/src/app/editor/editor.js index e7e072d3f2..3adf7911db 100644 --- a/apps/remix-ide/src/app/editor/editor.js +++ b/apps/remix-ide/src/app/editor/editor.js @@ -108,7 +108,7 @@ class Editor extends Plugin { }) const translateTheme = (theme) => this._themes[theme.name === 'Dark' ? 'remixDark' : theme.quality] - this.on('theme', 'themeChanged', (theme) => { + this.on('theme', 'themeLoaded', (theme) => { this.currentTheme = translateTheme(theme) this.renderComponent() }) diff --git a/apps/remix-ide/src/app/tabs/theme-module.js b/apps/remix-ide/src/app/tabs/theme-module.js index da3f8f9a78..5ea0bf1d30 100644 --- a/apps/remix-ide/src/app/tabs/theme-module.js +++ b/apps/remix-ide/src/app/tabs/theme-module.js @@ -63,10 +63,10 @@ export class ThemeModule extends Plugin { const nextTheme = this.themes[this.active] // Theme document.documentElement.style.setProperty('--theme', nextTheme.quality) const theme = yo`` - theme.addEventListener('load', () => { + document.head.insertBefore(theme, document.head.firstChild) + document.getElementById('theme-link').addEventListener('load', () => { if (callback) callback() }) - document.head.insertBefore(theme, document.head.firstChild) } } @@ -82,7 +82,13 @@ export class ThemeModule extends Plugin { _paq.push(['trackEvent', 'themeModule', 'switchTo', next]) const nextTheme = this.themes[next] // Theme if (!this.forced) this._deps.config.set('settings/theme', next) - document.getElementById('theme-link').setAttribute('href', nextTheme.url) + document.getElementById('theme-link').remove() + const theme = yo`` + theme.addEventListener('load', () => { + this.emit('themeLoaded', nextTheme) + this.events.emit('themeLoaded', nextTheme) + }) + document.head.insertBefore(theme, document.head.firstChild) document.documentElement.style.setProperty('--theme', nextTheme.quality) if (themeName) this.active = themeName // TODO: Only keep `this.emit` (issue#2210) diff --git a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx index 9db6922e46..4bdcff2ef9 100644 --- a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx +++ b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx @@ -77,9 +77,34 @@ export const EditorUI = (props: EditorUIProps) => { const [editorModelsState, dispatch] = useReducer(reducerActions, initialState) + const defineAndSetDarkTheme = (monaco) => { + // see https://microsoft.github.io/monaco-editor/playground.html#customizing-the-appearence-exposed-colors + const lightColor = window.getComputedStyle(document.documentElement).getPropertyValue('--light').trim() + const infoColor = window.getComputedStyle(document.documentElement).getPropertyValue('--info').trim() + const darkColor = window.getComputedStyle(document.documentElement).getPropertyValue('--dark').trim() + const grayColor = window.getComputedStyle(document.documentElement).getPropertyValue('--gray-dark').trim() + monaco.editor.defineTheme('remix-dark', { + base: 'vs-dark', + inherit: true, // can also be false to completely replace the builtin rules + rules: [{ background: darkColor.replace('#', '') }], + colors: { + 'editor.background': darkColor, + 'editorSuggestWidget.background': lightColor, + 'editorSuggestWidget.selectedBackground': lightColor, + 'editorSuggestWidget.highlightForeground': infoColor, + 'editor.lineHighlightBorder': lightColor, + 'editor.lineHighlightBackground': grayColor, + 'editorGutter.background': lightColor + } + }) + monacoRef.current.editor.setTheme('remix-dark') + } + useEffect(() => { if (!monacoRef.current) return - monacoRef.current.editor.setTheme(props.theme) + if (props.theme === 'remix-dark') { + defineAndSetDarkTheme(monacoRef.current) + } else monacoRef.current.editor.setTheme(props.theme) }, [props.theme]) const setAnnotationsbyFile = (uri) => { @@ -205,7 +230,9 @@ export const EditorUI = (props: EditorUIProps) => { function handleEditorDidMount (editor) { editorRef.current = editor - monacoRef.current.editor.setTheme(props.theme) + if (props.theme === 'remix-dark') { + defineAndSetDarkTheme(monacoRef.current) + } else monacoRef.current.editor.setTheme(props.theme) reducerListener(props.plugin, dispatch, monacoRef.current, editorRef.current, props.events) props.events.onEditorMounted() editor.onMouseUp((e) => { @@ -223,25 +250,6 @@ export const EditorUI = (props: EditorUIProps) => { function handleEditorWillMount (monaco) { monacoRef.current = monaco - // see https://microsoft.github.io/monaco-editor/playground.html#customizing-the-appearence-exposed-colors - const lightColor = '#2a2c3f' - const infoColor = '#086CB5' - const darkColor = '#222336' - const grayColor = '#343a40' - monaco.editor.defineTheme('remix-dark', { - base: 'vs-dark', - inherit: true, // can also be false to completely replace the builtin rules - rules: [{ background: darkColor.replace('#', '') }], - colors: { - 'editor.background': darkColor, - 'editorSuggestWidget.background': lightColor, - 'editorSuggestWidget.selectedBackground': lightColor, - 'editorSuggestWidget.highlightForeground': infoColor, - 'editor.lineHighlightBorder': lightColor, - 'editor.lineHighlightBackground': grayColor, - 'editorGutter.background': lightColor - } - }) } return ( From 51eafeda3acfa130ec90c90a6fd593821e84913a Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 4 Nov 2021 10:22:20 +0100 Subject: [PATCH 06/27] linter --- apps/remix-ide/src/app/panels/tab-proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/panels/tab-proxy.js b/apps/remix-ide/src/app/panels/tab-proxy.js index 2e29c0e4e9..139213a764 100644 --- a/apps/remix-ide/src/app/panels/tab-proxy.js +++ b/apps/remix-ide/src/app/panels/tab-proxy.js @@ -271,7 +271,7 @@ export class TabProxy extends Plugin { }) this.renderComponent() this.updateImgStyles() - if (previous) this.switchTab(previous.name) + if (previous) this.switchTab(previous.name) } addHandler (type, fn) { From 67af6e47dfcdc749b79bc0e1fb7d43b9774536f2 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Nov 2021 10:20:59 +0100 Subject: [PATCH 07/27] fix selenium --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index acc9a0ffb8..5b5770fe29 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,11 +76,11 @@ jobs: - run: npx nx build remix-ide --with-deps - run: name: Download Selenium - command: ./node_modules/.bin/selenium-standalone install --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com + command: npm run selenium-install - run: name: Start Selenium - command: ./node_modules/.bin/selenium-standalone start --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com - background: true + command: npm run selenium + background: false - run: ./apps/remix-ide/ci/browser_tests_chrome_1.sh - store_test_results: path: ./reports/tests @@ -110,11 +110,11 @@ jobs: - run: npx nx build remix-ide --with-deps - run: name: Download Selenium - command: ./node_modules/.bin/selenium-standalone install --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com + command: npm run selenium-install - run: name: Start Selenium - command: ./node_modules/.bin/selenium-standalone start --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com - background: true + command: npm run selenium + background: false - run: ./apps/remix-ide/ci/browser_tests_chrome_2.sh - store_test_results: path: ./reports/tests From 02da8538441c4e7dbbbe8ed3acd292ddb0c2f550 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Nov 2021 12:03:45 +0100 Subject: [PATCH 08/27] fix solidity highlighting --- .../editor/src/lib/remix-ui-editor.tsx | 14 +- libs/remix-ui/editor/src/lib/syntax.ts | 1383 +++++++++++++++++ 2 files changed, 1395 insertions(+), 2 deletions(-) create mode 100644 libs/remix-ui/editor/src/lib/syntax.ts diff --git a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx index 4bdcff2ef9..89e4a6eb9d 100644 --- a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx +++ b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx @@ -1,6 +1,7 @@ import React, { useState, useRef, useEffect, useReducer } from 'react' // eslint-disable-line import Editor from '@monaco-editor/react' import { reducerActions, reducerListener, initialState } from './actions/editor' +import { language, conf } from './syntax' import './remix-ui-editor.css' @@ -86,7 +87,10 @@ export const EditorUI = (props: EditorUIProps) => { monaco.editor.defineTheme('remix-dark', { base: 'vs-dark', inherit: true, // can also be false to completely replace the builtin rules - rules: [{ background: darkColor.replace('#', '') }], + rules: [ + { background: darkColor.replace('#', '') }, + { token: 'keyword.external', foreground: infoColor } + ], colors: { 'editor.background': darkColor, 'editorSuggestWidget.background': lightColor, @@ -160,8 +164,10 @@ export const EditorUI = (props: EditorUIProps) => { useEffect(() => { if (!editorRef.current) return currentFileRef.current = props.currentFile - editorRef.current.setModel(editorModelsState[props.currentFile].model) + const file = editorModelsState[props.currentFile] + editorRef.current.setModel(file.model) editorRef.current.updateOptions({ readOnly: editorModelsState[props.currentFile].readOnly }) + if (file.language === 'sol') monacoRef.current.editor.setModelLanguage(file.model, 'remix-solidity') setAnnotationsbyFile(props.currentFile) setMarkerbyFile(props.currentFile) }, [props.currentFile]) @@ -250,6 +256,10 @@ export const EditorUI = (props: EditorUIProps) => { function handleEditorWillMount (monaco) { monacoRef.current = monaco + // Register a new language + monacoRef.current.languages.register({ id: 'remix-solidity' }); + // Register a tokens provider for the language + monacoRef.current.languages.setMonarchTokensProvider('remix-solidity', language) } return ( diff --git a/libs/remix-ui/editor/src/lib/syntax.ts b/libs/remix-ui/editor/src/lib/syntax.ts new file mode 100644 index 0000000000..a2d4503d5d --- /dev/null +++ b/libs/remix-ui/editor/src/lib/syntax.ts @@ -0,0 +1,1383 @@ +export const conf = { + comments: { + lineComment: '//', + blockComment: ['/*', '*/'] + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'], + ['<', '>'] + ], + autoClosingPairs: [ + { open: '"', close: '"', notIn: ['string', 'comment'] }, + { open: '{', close: '}', notIn: ['string', 'comment'] }, + { open: '[', close: ']', notIn: ['string', 'comment'] }, + { open: '(', close: ')', notIn: ['string', 'comment'] } + ] +}; + +export const language = { + defaultToken: '', + tokenPostfix: '.sol', + + brackets: [ + { token: 'delimiter.curly', open: '{', close: '}' }, + { token: 'delimiter.parenthesis', open: '(', close: ')' }, + { token: 'delimiter.square', open: '[', close: ']' }, + { token: 'delimiter.angle', open: '<', close: '>' } + ], + + keywords: [ + // Main keywords + 'pragma', + 'solidity', + 'contract', + 'library', + 'using', + 'struct', + 'function', + 'modifier', + 'constructor', + //Built-in types + 'address', + 'string', + 'bool', + //Other types + 'Int', + 'Uint', + 'Byte', + 'Fixed', + 'Ufixed', + //All int + 'int', + 'int8', + 'int16', + 'int24', + 'int32', + 'int40', + 'int48', + 'int56', + 'int64', + 'int72', + 'int80', + 'int88', + 'int96', + 'int104', + 'int112', + 'int120', + 'int128', + 'int136', + 'int144', + 'int152', + 'int160', + 'int168', + 'int176', + 'int184', + 'int192', + 'int200', + 'int208', + 'int216', + 'int224', + 'int232', + 'int240', + 'int248', + 'int256', + //All uint + 'uint', + 'uint8', + 'uint16', + 'uint24', + 'uint32', + 'uint40', + 'uint48', + 'uint56', + 'uint64', + 'uint72', + 'uint80', + 'uint88', + 'uint96', + 'uint104', + 'uint112', + 'uint120', + 'uint128', + 'uint136', + 'uint144', + 'uint152', + 'uint160', + 'uint168', + 'uint176', + 'uint184', + 'uint192', + 'uint200', + 'uint208', + 'uint216', + 'uint224', + 'uint232', + 'uint240', + 'uint248', + 'uint256', + //All Byte + 'byte', + 'bytes', + 'bytes1', + 'bytes2', + 'bytes3', + 'bytes4', + 'bytes5', + 'bytes6', + 'bytes7', + 'bytes8', + 'bytes9', + 'bytes10', + 'bytes11', + 'bytes12', + 'bytes13', + 'bytes14', + 'bytes15', + 'bytes16', + 'bytes17', + 'bytes18', + 'bytes19', + 'bytes20', + 'bytes21', + 'bytes22', + 'bytes23', + 'bytes24', + 'bytes25', + 'bytes26', + 'bytes27', + 'bytes28', + 'bytes29', + 'bytes30', + 'bytes31', + 'bytes32', + //All fixed + 'fixed', + 'fixed0x8', + 'fixed0x16', + 'fixed0x24', + 'fixed0x32', + 'fixed0x40', + 'fixed0x48', + 'fixed0x56', + 'fixed0x64', + 'fixed0x72', + 'fixed0x80', + 'fixed0x88', + 'fixed0x96', + 'fixed0x104', + 'fixed0x112', + 'fixed0x120', + 'fixed0x128', + 'fixed0x136', + 'fixed0x144', + 'fixed0x152', + 'fixed0x160', + 'fixed0x168', + 'fixed0x176', + 'fixed0x184', + 'fixed0x192', + 'fixed0x200', + 'fixed0x208', + 'fixed0x216', + 'fixed0x224', + 'fixed0x232', + 'fixed0x240', + 'fixed0x248', + 'fixed0x256', + 'fixed8x8', + 'fixed8x16', + 'fixed8x24', + 'fixed8x32', + 'fixed8x40', + 'fixed8x48', + 'fixed8x56', + 'fixed8x64', + 'fixed8x72', + 'fixed8x80', + 'fixed8x88', + 'fixed8x96', + 'fixed8x104', + 'fixed8x112', + 'fixed8x120', + 'fixed8x128', + 'fixed8x136', + 'fixed8x144', + 'fixed8x152', + 'fixed8x160', + 'fixed8x168', + 'fixed8x176', + 'fixed8x184', + 'fixed8x192', + 'fixed8x200', + 'fixed8x208', + 'fixed8x216', + 'fixed8x224', + 'fixed8x232', + 'fixed8x240', + 'fixed8x248', + 'fixed16x8', + 'fixed16x16', + 'fixed16x24', + 'fixed16x32', + 'fixed16x40', + 'fixed16x48', + 'fixed16x56', + 'fixed16x64', + 'fixed16x72', + 'fixed16x80', + 'fixed16x88', + 'fixed16x96', + 'fixed16x104', + 'fixed16x112', + 'fixed16x120', + 'fixed16x128', + 'fixed16x136', + 'fixed16x144', + 'fixed16x152', + 'fixed16x160', + 'fixed16x168', + 'fixed16x176', + 'fixed16x184', + 'fixed16x192', + 'fixed16x200', + 'fixed16x208', + 'fixed16x216', + 'fixed16x224', + 'fixed16x232', + 'fixed16x240', + 'fixed24x8', + 'fixed24x16', + 'fixed24x24', + 'fixed24x32', + 'fixed24x40', + 'fixed24x48', + 'fixed24x56', + 'fixed24x64', + 'fixed24x72', + 'fixed24x80', + 'fixed24x88', + 'fixed24x96', + 'fixed24x104', + 'fixed24x112', + 'fixed24x120', + 'fixed24x128', + 'fixed24x136', + 'fixed24x144', + 'fixed24x152', + 'fixed24x160', + 'fixed24x168', + 'fixed24x176', + 'fixed24x184', + 'fixed24x192', + 'fixed24x200', + 'fixed24x208', + 'fixed24x216', + 'fixed24x224', + 'fixed24x232', + 'fixed32x8', + 'fixed32x16', + 'fixed32x24', + 'fixed32x32', + 'fixed32x40', + 'fixed32x48', + 'fixed32x56', + 'fixed32x64', + 'fixed32x72', + 'fixed32x80', + 'fixed32x88', + 'fixed32x96', + 'fixed32x104', + 'fixed32x112', + 'fixed32x120', + 'fixed32x128', + 'fixed32x136', + 'fixed32x144', + 'fixed32x152', + 'fixed32x160', + 'fixed32x168', + 'fixed32x176', + 'fixed32x184', + 'fixed32x192', + 'fixed32x200', + 'fixed32x208', + 'fixed32x216', + 'fixed32x224', + 'fixed40x8', + 'fixed40x16', + 'fixed40x24', + 'fixed40x32', + 'fixed40x40', + 'fixed40x48', + 'fixed40x56', + 'fixed40x64', + 'fixed40x72', + 'fixed40x80', + 'fixed40x88', + 'fixed40x96', + 'fixed40x104', + 'fixed40x112', + 'fixed40x120', + 'fixed40x128', + 'fixed40x136', + 'fixed40x144', + 'fixed40x152', + 'fixed40x160', + 'fixed40x168', + 'fixed40x176', + 'fixed40x184', + 'fixed40x192', + 'fixed40x200', + 'fixed40x208', + 'fixed40x216', + 'fixed48x8', + 'fixed48x16', + 'fixed48x24', + 'fixed48x32', + 'fixed48x40', + 'fixed48x48', + 'fixed48x56', + 'fixed48x64', + 'fixed48x72', + 'fixed48x80', + 'fixed48x88', + 'fixed48x96', + 'fixed48x104', + 'fixed48x112', + 'fixed48x120', + 'fixed48x128', + 'fixed48x136', + 'fixed48x144', + 'fixed48x152', + 'fixed48x160', + 'fixed48x168', + 'fixed48x176', + 'fixed48x184', + 'fixed48x192', + 'fixed48x200', + 'fixed48x208', + 'fixed56x8', + 'fixed56x16', + 'fixed56x24', + 'fixed56x32', + 'fixed56x40', + 'fixed56x48', + 'fixed56x56', + 'fixed56x64', + 'fixed56x72', + 'fixed56x80', + 'fixed56x88', + 'fixed56x96', + 'fixed56x104', + 'fixed56x112', + 'fixed56x120', + 'fixed56x128', + 'fixed56x136', + 'fixed56x144', + 'fixed56x152', + 'fixed56x160', + 'fixed56x168', + 'fixed56x176', + 'fixed56x184', + 'fixed56x192', + 'fixed56x200', + 'fixed64x8', + 'fixed64x16', + 'fixed64x24', + 'fixed64x32', + 'fixed64x40', + 'fixed64x48', + 'fixed64x56', + 'fixed64x64', + 'fixed64x72', + 'fixed64x80', + 'fixed64x88', + 'fixed64x96', + 'fixed64x104', + 'fixed64x112', + 'fixed64x120', + 'fixed64x128', + 'fixed64x136', + 'fixed64x144', + 'fixed64x152', + 'fixed64x160', + 'fixed64x168', + 'fixed64x176', + 'fixed64x184', + 'fixed64x192', + 'fixed72x8', + 'fixed72x16', + 'fixed72x24', + 'fixed72x32', + 'fixed72x40', + 'fixed72x48', + 'fixed72x56', + 'fixed72x64', + 'fixed72x72', + 'fixed72x80', + 'fixed72x88', + 'fixed72x96', + 'fixed72x104', + 'fixed72x112', + 'fixed72x120', + 'fixed72x128', + 'fixed72x136', + 'fixed72x144', + 'fixed72x152', + 'fixed72x160', + 'fixed72x168', + 'fixed72x176', + 'fixed72x184', + 'fixed80x8', + 'fixed80x16', + 'fixed80x24', + 'fixed80x32', + 'fixed80x40', + 'fixed80x48', + 'fixed80x56', + 'fixed80x64', + 'fixed80x72', + 'fixed80x80', + 'fixed80x88', + 'fixed80x96', + 'fixed80x104', + 'fixed80x112', + 'fixed80x120', + 'fixed80x128', + 'fixed80x136', + 'fixed80x144', + 'fixed80x152', + 'fixed80x160', + 'fixed80x168', + 'fixed80x176', + 'fixed88x8', + 'fixed88x16', + 'fixed88x24', + 'fixed88x32', + 'fixed88x40', + 'fixed88x48', + 'fixed88x56', + 'fixed88x64', + 'fixed88x72', + 'fixed88x80', + 'fixed88x88', + 'fixed88x96', + 'fixed88x104', + 'fixed88x112', + 'fixed88x120', + 'fixed88x128', + 'fixed88x136', + 'fixed88x144', + 'fixed88x152', + 'fixed88x160', + 'fixed88x168', + 'fixed96x8', + 'fixed96x16', + 'fixed96x24', + 'fixed96x32', + 'fixed96x40', + 'fixed96x48', + 'fixed96x56', + 'fixed96x64', + 'fixed96x72', + 'fixed96x80', + 'fixed96x88', + 'fixed96x96', + 'fixed96x104', + 'fixed96x112', + 'fixed96x120', + 'fixed96x128', + 'fixed96x136', + 'fixed96x144', + 'fixed96x152', + 'fixed96x160', + 'fixed104x8', + 'fixed104x16', + 'fixed104x24', + 'fixed104x32', + 'fixed104x40', + 'fixed104x48', + 'fixed104x56', + 'fixed104x64', + 'fixed104x72', + 'fixed104x80', + 'fixed104x88', + 'fixed104x96', + 'fixed104x104', + 'fixed104x112', + 'fixed104x120', + 'fixed104x128', + 'fixed104x136', + 'fixed104x144', + 'fixed104x152', + 'fixed112x8', + 'fixed112x16', + 'fixed112x24', + 'fixed112x32', + 'fixed112x40', + 'fixed112x48', + 'fixed112x56', + 'fixed112x64', + 'fixed112x72', + 'fixed112x80', + 'fixed112x88', + 'fixed112x96', + 'fixed112x104', + 'fixed112x112', + 'fixed112x120', + 'fixed112x128', + 'fixed112x136', + 'fixed112x144', + 'fixed120x8', + 'fixed120x16', + 'fixed120x24', + 'fixed120x32', + 'fixed120x40', + 'fixed120x48', + 'fixed120x56', + 'fixed120x64', + 'fixed120x72', + 'fixed120x80', + 'fixed120x88', + 'fixed120x96', + 'fixed120x104', + 'fixed120x112', + 'fixed120x120', + 'fixed120x128', + 'fixed120x136', + 'fixed128x8', + 'fixed128x16', + 'fixed128x24', + 'fixed128x32', + 'fixed128x40', + 'fixed128x48', + 'fixed128x56', + 'fixed128x64', + 'fixed128x72', + 'fixed128x80', + 'fixed128x88', + 'fixed128x96', + 'fixed128x104', + 'fixed128x112', + 'fixed128x120', + 'fixed128x128', + 'fixed136x8', + 'fixed136x16', + 'fixed136x24', + 'fixed136x32', + 'fixed136x40', + 'fixed136x48', + 'fixed136x56', + 'fixed136x64', + 'fixed136x72', + 'fixed136x80', + 'fixed136x88', + 'fixed136x96', + 'fixed136x104', + 'fixed136x112', + 'fixed136x120', + 'fixed144x8', + 'fixed144x16', + 'fixed144x24', + 'fixed144x32', + 'fixed144x40', + 'fixed144x48', + 'fixed144x56', + 'fixed144x64', + 'fixed144x72', + 'fixed144x80', + 'fixed144x88', + 'fixed144x96', + 'fixed144x104', + 'fixed144x112', + 'fixed152x8', + 'fixed152x16', + 'fixed152x24', + 'fixed152x32', + 'fixed152x40', + 'fixed152x48', + 'fixed152x56', + 'fixed152x64', + 'fixed152x72', + 'fixed152x80', + 'fixed152x88', + 'fixed152x96', + 'fixed152x104', + 'fixed160x8', + 'fixed160x16', + 'fixed160x24', + 'fixed160x32', + 'fixed160x40', + 'fixed160x48', + 'fixed160x56', + 'fixed160x64', + 'fixed160x72', + 'fixed160x80', + 'fixed160x88', + 'fixed160x96', + 'fixed168x8', + 'fixed168x16', + 'fixed168x24', + 'fixed168x32', + 'fixed168x40', + 'fixed168x48', + 'fixed168x56', + 'fixed168x64', + 'fixed168x72', + 'fixed168x80', + 'fixed168x88', + 'fixed176x8', + 'fixed176x16', + 'fixed176x24', + 'fixed176x32', + 'fixed176x40', + 'fixed176x48', + 'fixed176x56', + 'fixed176x64', + 'fixed176x72', + 'fixed176x80', + 'fixed184x8', + 'fixed184x16', + 'fixed184x24', + 'fixed184x32', + 'fixed184x40', + 'fixed184x48', + 'fixed184x56', + 'fixed184x64', + 'fixed184x72', + 'fixed192x8', + 'fixed192x16', + 'fixed192x24', + 'fixed192x32', + 'fixed192x40', + 'fixed192x48', + 'fixed192x56', + 'fixed192x64', + 'fixed200x8', + 'fixed200x16', + 'fixed200x24', + 'fixed200x32', + 'fixed200x40', + 'fixed200x48', + 'fixed200x56', + 'fixed208x8', + 'fixed208x16', + 'fixed208x24', + 'fixed208x32', + 'fixed208x40', + 'fixed208x48', + 'fixed216x8', + 'fixed216x16', + 'fixed216x24', + 'fixed216x32', + 'fixed216x40', + 'fixed224x8', + 'fixed224x16', + 'fixed224x24', + 'fixed224x32', + 'fixed232x8', + 'fixed232x16', + 'fixed232x24', + 'fixed240x8', + 'fixed240x16', + 'fixed248x8', + //All ufixed + 'ufixed', + 'ufixed0x8', + 'ufixed0x16', + 'ufixed0x24', + 'ufixed0x32', + 'ufixed0x40', + 'ufixed0x48', + 'ufixed0x56', + 'ufixed0x64', + 'ufixed0x72', + 'ufixed0x80', + 'ufixed0x88', + 'ufixed0x96', + 'ufixed0x104', + 'ufixed0x112', + 'ufixed0x120', + 'ufixed0x128', + 'ufixed0x136', + 'ufixed0x144', + 'ufixed0x152', + 'ufixed0x160', + 'ufixed0x168', + 'ufixed0x176', + 'ufixed0x184', + 'ufixed0x192', + 'ufixed0x200', + 'ufixed0x208', + 'ufixed0x216', + 'ufixed0x224', + 'ufixed0x232', + 'ufixed0x240', + 'ufixed0x248', + 'ufixed0x256', + 'ufixed8x8', + 'ufixed8x16', + 'ufixed8x24', + 'ufixed8x32', + 'ufixed8x40', + 'ufixed8x48', + 'ufixed8x56', + 'ufixed8x64', + 'ufixed8x72', + 'ufixed8x80', + 'ufixed8x88', + 'ufixed8x96', + 'ufixed8x104', + 'ufixed8x112', + 'ufixed8x120', + 'ufixed8x128', + 'ufixed8x136', + 'ufixed8x144', + 'ufixed8x152', + 'ufixed8x160', + 'ufixed8x168', + 'ufixed8x176', + 'ufixed8x184', + 'ufixed8x192', + 'ufixed8x200', + 'ufixed8x208', + 'ufixed8x216', + 'ufixed8x224', + 'ufixed8x232', + 'ufixed8x240', + 'ufixed8x248', + 'ufixed16x8', + 'ufixed16x16', + 'ufixed16x24', + 'ufixed16x32', + 'ufixed16x40', + 'ufixed16x48', + 'ufixed16x56', + 'ufixed16x64', + 'ufixed16x72', + 'ufixed16x80', + 'ufixed16x88', + 'ufixed16x96', + 'ufixed16x104', + 'ufixed16x112', + 'ufixed16x120', + 'ufixed16x128', + 'ufixed16x136', + 'ufixed16x144', + 'ufixed16x152', + 'ufixed16x160', + 'ufixed16x168', + 'ufixed16x176', + 'ufixed16x184', + 'ufixed16x192', + 'ufixed16x200', + 'ufixed16x208', + 'ufixed16x216', + 'ufixed16x224', + 'ufixed16x232', + 'ufixed16x240', + 'ufixed24x8', + 'ufixed24x16', + 'ufixed24x24', + 'ufixed24x32', + 'ufixed24x40', + 'ufixed24x48', + 'ufixed24x56', + 'ufixed24x64', + 'ufixed24x72', + 'ufixed24x80', + 'ufixed24x88', + 'ufixed24x96', + 'ufixed24x104', + 'ufixed24x112', + 'ufixed24x120', + 'ufixed24x128', + 'ufixed24x136', + 'ufixed24x144', + 'ufixed24x152', + 'ufixed24x160', + 'ufixed24x168', + 'ufixed24x176', + 'ufixed24x184', + 'ufixed24x192', + 'ufixed24x200', + 'ufixed24x208', + 'ufixed24x216', + 'ufixed24x224', + 'ufixed24x232', + 'ufixed32x8', + 'ufixed32x16', + 'ufixed32x24', + 'ufixed32x32', + 'ufixed32x40', + 'ufixed32x48', + 'ufixed32x56', + 'ufixed32x64', + 'ufixed32x72', + 'ufixed32x80', + 'ufixed32x88', + 'ufixed32x96', + 'ufixed32x104', + 'ufixed32x112', + 'ufixed32x120', + 'ufixed32x128', + 'ufixed32x136', + 'ufixed32x144', + 'ufixed32x152', + 'ufixed32x160', + 'ufixed32x168', + 'ufixed32x176', + 'ufixed32x184', + 'ufixed32x192', + 'ufixed32x200', + 'ufixed32x208', + 'ufixed32x216', + 'ufixed32x224', + 'ufixed40x8', + 'ufixed40x16', + 'ufixed40x24', + 'ufixed40x32', + 'ufixed40x40', + 'ufixed40x48', + 'ufixed40x56', + 'ufixed40x64', + 'ufixed40x72', + 'ufixed40x80', + 'ufixed40x88', + 'ufixed40x96', + 'ufixed40x104', + 'ufixed40x112', + 'ufixed40x120', + 'ufixed40x128', + 'ufixed40x136', + 'ufixed40x144', + 'ufixed40x152', + 'ufixed40x160', + 'ufixed40x168', + 'ufixed40x176', + 'ufixed40x184', + 'ufixed40x192', + 'ufixed40x200', + 'ufixed40x208', + 'ufixed40x216', + 'ufixed48x8', + 'ufixed48x16', + 'ufixed48x24', + 'ufixed48x32', + 'ufixed48x40', + 'ufixed48x48', + 'ufixed48x56', + 'ufixed48x64', + 'ufixed48x72', + 'ufixed48x80', + 'ufixed48x88', + 'ufixed48x96', + 'ufixed48x104', + 'ufixed48x112', + 'ufixed48x120', + 'ufixed48x128', + 'ufixed48x136', + 'ufixed48x144', + 'ufixed48x152', + 'ufixed48x160', + 'ufixed48x168', + 'ufixed48x176', + 'ufixed48x184', + 'ufixed48x192', + 'ufixed48x200', + 'ufixed48x208', + 'ufixed56x8', + 'ufixed56x16', + 'ufixed56x24', + 'ufixed56x32', + 'ufixed56x40', + 'ufixed56x48', + 'ufixed56x56', + 'ufixed56x64', + 'ufixed56x72', + 'ufixed56x80', + 'ufixed56x88', + 'ufixed56x96', + 'ufixed56x104', + 'ufixed56x112', + 'ufixed56x120', + 'ufixed56x128', + 'ufixed56x136', + 'ufixed56x144', + 'ufixed56x152', + 'ufixed56x160', + 'ufixed56x168', + 'ufixed56x176', + 'ufixed56x184', + 'ufixed56x192', + 'ufixed56x200', + 'ufixed64x8', + 'ufixed64x16', + 'ufixed64x24', + 'ufixed64x32', + 'ufixed64x40', + 'ufixed64x48', + 'ufixed64x56', + 'ufixed64x64', + 'ufixed64x72', + 'ufixed64x80', + 'ufixed64x88', + 'ufixed64x96', + 'ufixed64x104', + 'ufixed64x112', + 'ufixed64x120', + 'ufixed64x128', + 'ufixed64x136', + 'ufixed64x144', + 'ufixed64x152', + 'ufixed64x160', + 'ufixed64x168', + 'ufixed64x176', + 'ufixed64x184', + 'ufixed64x192', + 'ufixed72x8', + 'ufixed72x16', + 'ufixed72x24', + 'ufixed72x32', + 'ufixed72x40', + 'ufixed72x48', + 'ufixed72x56', + 'ufixed72x64', + 'ufixed72x72', + 'ufixed72x80', + 'ufixed72x88', + 'ufixed72x96', + 'ufixed72x104', + 'ufixed72x112', + 'ufixed72x120', + 'ufixed72x128', + 'ufixed72x136', + 'ufixed72x144', + 'ufixed72x152', + 'ufixed72x160', + 'ufixed72x168', + 'ufixed72x176', + 'ufixed72x184', + 'ufixed80x8', + 'ufixed80x16', + 'ufixed80x24', + 'ufixed80x32', + 'ufixed80x40', + 'ufixed80x48', + 'ufixed80x56', + 'ufixed80x64', + 'ufixed80x72', + 'ufixed80x80', + 'ufixed80x88', + 'ufixed80x96', + 'ufixed80x104', + 'ufixed80x112', + 'ufixed80x120', + 'ufixed80x128', + 'ufixed80x136', + 'ufixed80x144', + 'ufixed80x152', + 'ufixed80x160', + 'ufixed80x168', + 'ufixed80x176', + 'ufixed88x8', + 'ufixed88x16', + 'ufixed88x24', + 'ufixed88x32', + 'ufixed88x40', + 'ufixed88x48', + 'ufixed88x56', + 'ufixed88x64', + 'ufixed88x72', + 'ufixed88x80', + 'ufixed88x88', + 'ufixed88x96', + 'ufixed88x104', + 'ufixed88x112', + 'ufixed88x120', + 'ufixed88x128', + 'ufixed88x136', + 'ufixed88x144', + 'ufixed88x152', + 'ufixed88x160', + 'ufixed88x168', + 'ufixed96x8', + 'ufixed96x16', + 'ufixed96x24', + 'ufixed96x32', + 'ufixed96x40', + 'ufixed96x48', + 'ufixed96x56', + 'ufixed96x64', + 'ufixed96x72', + 'ufixed96x80', + 'ufixed96x88', + 'ufixed96x96', + 'ufixed96x104', + 'ufixed96x112', + 'ufixed96x120', + 'ufixed96x128', + 'ufixed96x136', + 'ufixed96x144', + 'ufixed96x152', + 'ufixed96x160', + 'ufixed104x8', + 'ufixed104x16', + 'ufixed104x24', + 'ufixed104x32', + 'ufixed104x40', + 'ufixed104x48', + 'ufixed104x56', + 'ufixed104x64', + 'ufixed104x72', + 'ufixed104x80', + 'ufixed104x88', + 'ufixed104x96', + 'ufixed104x104', + 'ufixed104x112', + 'ufixed104x120', + 'ufixed104x128', + 'ufixed104x136', + 'ufixed104x144', + 'ufixed104x152', + 'ufixed112x8', + 'ufixed112x16', + 'ufixed112x24', + 'ufixed112x32', + 'ufixed112x40', + 'ufixed112x48', + 'ufixed112x56', + 'ufixed112x64', + 'ufixed112x72', + 'ufixed112x80', + 'ufixed112x88', + 'ufixed112x96', + 'ufixed112x104', + 'ufixed112x112', + 'ufixed112x120', + 'ufixed112x128', + 'ufixed112x136', + 'ufixed112x144', + 'ufixed120x8', + 'ufixed120x16', + 'ufixed120x24', + 'ufixed120x32', + 'ufixed120x40', + 'ufixed120x48', + 'ufixed120x56', + 'ufixed120x64', + 'ufixed120x72', + 'ufixed120x80', + 'ufixed120x88', + 'ufixed120x96', + 'ufixed120x104', + 'ufixed120x112', + 'ufixed120x120', + 'ufixed120x128', + 'ufixed120x136', + 'ufixed128x8', + 'ufixed128x16', + 'ufixed128x24', + 'ufixed128x32', + 'ufixed128x40', + 'ufixed128x48', + 'ufixed128x56', + 'ufixed128x64', + 'ufixed128x72', + 'ufixed128x80', + 'ufixed128x88', + 'ufixed128x96', + 'ufixed128x104', + 'ufixed128x112', + 'ufixed128x120', + 'ufixed128x128', + 'ufixed136x8', + 'ufixed136x16', + 'ufixed136x24', + 'ufixed136x32', + 'ufixed136x40', + 'ufixed136x48', + 'ufixed136x56', + 'ufixed136x64', + 'ufixed136x72', + 'ufixed136x80', + 'ufixed136x88', + 'ufixed136x96', + 'ufixed136x104', + 'ufixed136x112', + 'ufixed136x120', + 'ufixed144x8', + 'ufixed144x16', + 'ufixed144x24', + 'ufixed144x32', + 'ufixed144x40', + 'ufixed144x48', + 'ufixed144x56', + 'ufixed144x64', + 'ufixed144x72', + 'ufixed144x80', + 'ufixed144x88', + 'ufixed144x96', + 'ufixed144x104', + 'ufixed144x112', + 'ufixed152x8', + 'ufixed152x16', + 'ufixed152x24', + 'ufixed152x32', + 'ufixed152x40', + 'ufixed152x48', + 'ufixed152x56', + 'ufixed152x64', + 'ufixed152x72', + 'ufixed152x80', + 'ufixed152x88', + 'ufixed152x96', + 'ufixed152x104', + 'ufixed160x8', + 'ufixed160x16', + 'ufixed160x24', + 'ufixed160x32', + 'ufixed160x40', + 'ufixed160x48', + 'ufixed160x56', + 'ufixed160x64', + 'ufixed160x72', + 'ufixed160x80', + 'ufixed160x88', + 'ufixed160x96', + 'ufixed168x8', + 'ufixed168x16', + 'ufixed168x24', + 'ufixed168x32', + 'ufixed168x40', + 'ufixed168x48', + 'ufixed168x56', + 'ufixed168x64', + 'ufixed168x72', + 'ufixed168x80', + 'ufixed168x88', + 'ufixed176x8', + 'ufixed176x16', + 'ufixed176x24', + 'ufixed176x32', + 'ufixed176x40', + 'ufixed176x48', + 'ufixed176x56', + 'ufixed176x64', + 'ufixed176x72', + 'ufixed176x80', + 'ufixed184x8', + 'ufixed184x16', + 'ufixed184x24', + 'ufixed184x32', + 'ufixed184x40', + 'ufixed184x48', + 'ufixed184x56', + 'ufixed184x64', + 'ufixed184x72', + 'ufixed192x8', + 'ufixed192x16', + 'ufixed192x24', + 'ufixed192x32', + 'ufixed192x40', + 'ufixed192x48', + 'ufixed192x56', + 'ufixed192x64', + 'ufixed200x8', + 'ufixed200x16', + 'ufixed200x24', + 'ufixed200x32', + 'ufixed200x40', + 'ufixed200x48', + 'ufixed200x56', + 'ufixed208x8', + 'ufixed208x16', + 'ufixed208x24', + 'ufixed208x32', + 'ufixed208x40', + 'ufixed208x48', + 'ufixed216x8', + 'ufixed216x16', + 'ufixed216x24', + 'ufixed216x32', + 'ufixed216x40', + 'ufixed224x8', + 'ufixed224x16', + 'ufixed224x24', + 'ufixed224x32', + 'ufixed232x8', + 'ufixed232x16', + 'ufixed232x24', + 'ufixed240x8', + 'ufixed240x16', + 'ufixed248x8', + 'event', + 'enum', + 'let', + 'mapping', + 'private', + 'public', + 'external', + 'view', + 'pure', + 'inherited', + 'payable', + 'true', + 'false', + 'var', + 'import', + 'constant', + 'if', + 'else', + 'for', + 'else', + 'for', + 'while', + 'do', + 'break', + 'continue', + 'throw', + 'returns', + 'return', + 'suicide', + 'new', + 'is', + 'this', + 'super' + ], + + operators: [ + '=', + '>', + '<', + '!', + '~', + '?', + ':', + '==', + '<=', + '>=', + '!=', + '&&', + '||', + '++', + '--', + '+', + '-', + '*', + '/', + '&', + '|', + '^', + '%', + '<<', + '>>', + '>>>', + '+=', + '-=', + '*=', + '/=', + '&=', + '|=', + '^=', + '%=', + '<<=', + '>>=', + '>>>=' + ], + + // we include these common regular expressions + symbols: /[=>](?!@symbols)/, '@brackets'], + [ + /@symbols/, + { + cases: { + '@operators': 'delimiter', + '@default': '' + } + } + ], + + // numbers + [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, 'number.float'], + [/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, 'number.float'], + [/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/, 'number.hex'], + [/0[0-7']*[0-7](@integersuffix)/, 'number.octal'], + [/0[bB][0-1']*[0-1](@integersuffix)/, 'number.binary'], + [/\d[\d']*\d(@integersuffix)/, 'number'], + [/\d(@integersuffix)/, 'number'], + + // delimiter: after number because of .\d floats + [/[;,.]/, 'delimiter'], + + // strings + [/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string + [/"/, 'string', '@string'], + + // characters + [/'[^\\']'/, 'string'], + [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], + [/'/, 'string.invalid'] + ], + + whitespace: [ + [/[ \t\r\n]+/, ''], + [/\/\*\*(?!\/)/, 'comment.doc', '@doccomment'], + [/\/\*/, 'comment', '@comment'], + [/\/\/.*$/, 'comment'] + ], + + comment: [ + [/[^\/*]+/, 'comment'], + [/\*\//, 'comment', '@pop'], + [/[\/*]/, 'comment'] + ], + //Identical copy of comment above, except for the addition of .doc + doccomment: [ + [/[^\/*]+/, 'comment.doc'], + [/\*\//, 'comment.doc', '@pop'], + [/[\/*]/, 'comment.doc'] + ], + + string: [ + [/[^\\"]+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/"/, 'string', '@pop'] + ] + } +}; \ No newline at end of file From a1f19d82d78a2729352ee73f1102f0d96b747525 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Nov 2021 12:07:08 +0100 Subject: [PATCH 09/27] rollback dom inserion order --- apps/remix-ide/src/app/tabs/theme-module.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/theme-module.js b/apps/remix-ide/src/app/tabs/theme-module.js index 5ea0bf1d30..4886a40731 100644 --- a/apps/remix-ide/src/app/tabs/theme-module.js +++ b/apps/remix-ide/src/app/tabs/theme-module.js @@ -63,10 +63,10 @@ export class ThemeModule extends Plugin { const nextTheme = this.themes[this.active] // Theme document.documentElement.style.setProperty('--theme', nextTheme.quality) const theme = yo`` - document.head.insertBefore(theme, document.head.firstChild) - document.getElementById('theme-link').addEventListener('load', () => { + theme.addEventListener('load', () => { if (callback) callback() }) + document.head.insertBefore(theme, document.head.firstChild) } } From d4764ea3d84f961286b6c897e7b21fb59cfcadfd Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Nov 2021 12:29:19 +0100 Subject: [PATCH 10/27] fix loading theme --- apps/remix-ide/src/app/tabs/theme-module.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide/src/app/tabs/theme-module.js b/apps/remix-ide/src/app/tabs/theme-module.js index 4886a40731..118fd2d901 100644 --- a/apps/remix-ide/src/app/tabs/theme-module.js +++ b/apps/remix-ide/src/app/tabs/theme-module.js @@ -79,6 +79,7 @@ export class ThemeModule extends Plugin { throw new Error(`Theme ${themeName} doesn't exist`) } const next = themeName || this.active // Name + if (themeName === this.active) return _paq.push(['trackEvent', 'themeModule', 'switchTo', next]) const nextTheme = this.themes[next] // Theme if (!this.forced) this._deps.config.set('settings/theme', next) From c013c022c2f62cbbc4f8c958345f519827364381 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Nov 2021 12:29:24 +0100 Subject: [PATCH 11/27] linting --- libs/remix-ui/editor/src/lib/syntax.ts | 2726 ++++++++++++------------ 1 file changed, 1363 insertions(+), 1363 deletions(-) diff --git a/libs/remix-ui/editor/src/lib/syntax.ts b/libs/remix-ui/editor/src/lib/syntax.ts index a2d4503d5d..623c57f3bc 100644 --- a/libs/remix-ui/editor/src/lib/syntax.ts +++ b/libs/remix-ui/editor/src/lib/syntax.ts @@ -1,1383 +1,1383 @@ export const conf = { - comments: { - lineComment: '//', - blockComment: ['/*', '*/'] - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'], - ['<', '>'] - ], - autoClosingPairs: [ - { open: '"', close: '"', notIn: ['string', 'comment'] }, - { open: '{', close: '}', notIn: ['string', 'comment'] }, - { open: '[', close: ']', notIn: ['string', 'comment'] }, - { open: '(', close: ')', notIn: ['string', 'comment'] } - ] -}; + comments: { + lineComment: '//', + blockComment: ['/*', '*/'] + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'], + ['<', '>'] + ], + autoClosingPairs: [ + { open: '"', close: '"', notIn: ['string', 'comment'] }, + { open: '{', close: '}', notIn: ['string', 'comment'] }, + { open: '[', close: ']', notIn: ['string', 'comment'] }, + { open: '(', close: ')', notIn: ['string', 'comment'] } + ] +} export const language = { - defaultToken: '', - tokenPostfix: '.sol', + defaultToken: '', + tokenPostfix: '.sol', - brackets: [ - { token: 'delimiter.curly', open: '{', close: '}' }, - { token: 'delimiter.parenthesis', open: '(', close: ')' }, - { token: 'delimiter.square', open: '[', close: ']' }, - { token: 'delimiter.angle', open: '<', close: '>' } - ], + brackets: [ + { token: 'delimiter.curly', open: '{', close: '}' }, + { token: 'delimiter.parenthesis', open: '(', close: ')' }, + { token: 'delimiter.square', open: '[', close: ']' }, + { token: 'delimiter.angle', open: '<', close: '>' } + ], - keywords: [ - // Main keywords - 'pragma', - 'solidity', - 'contract', - 'library', - 'using', - 'struct', - 'function', - 'modifier', - 'constructor', - //Built-in types - 'address', - 'string', - 'bool', - //Other types - 'Int', - 'Uint', - 'Byte', - 'Fixed', - 'Ufixed', - //All int - 'int', - 'int8', - 'int16', - 'int24', - 'int32', - 'int40', - 'int48', - 'int56', - 'int64', - 'int72', - 'int80', - 'int88', - 'int96', - 'int104', - 'int112', - 'int120', - 'int128', - 'int136', - 'int144', - 'int152', - 'int160', - 'int168', - 'int176', - 'int184', - 'int192', - 'int200', - 'int208', - 'int216', - 'int224', - 'int232', - 'int240', - 'int248', - 'int256', - //All uint - 'uint', - 'uint8', - 'uint16', - 'uint24', - 'uint32', - 'uint40', - 'uint48', - 'uint56', - 'uint64', - 'uint72', - 'uint80', - 'uint88', - 'uint96', - 'uint104', - 'uint112', - 'uint120', - 'uint128', - 'uint136', - 'uint144', - 'uint152', - 'uint160', - 'uint168', - 'uint176', - 'uint184', - 'uint192', - 'uint200', - 'uint208', - 'uint216', - 'uint224', - 'uint232', - 'uint240', - 'uint248', - 'uint256', - //All Byte - 'byte', - 'bytes', - 'bytes1', - 'bytes2', - 'bytes3', - 'bytes4', - 'bytes5', - 'bytes6', - 'bytes7', - 'bytes8', - 'bytes9', - 'bytes10', - 'bytes11', - 'bytes12', - 'bytes13', - 'bytes14', - 'bytes15', - 'bytes16', - 'bytes17', - 'bytes18', - 'bytes19', - 'bytes20', - 'bytes21', - 'bytes22', - 'bytes23', - 'bytes24', - 'bytes25', - 'bytes26', - 'bytes27', - 'bytes28', - 'bytes29', - 'bytes30', - 'bytes31', - 'bytes32', - //All fixed - 'fixed', - 'fixed0x8', - 'fixed0x16', - 'fixed0x24', - 'fixed0x32', - 'fixed0x40', - 'fixed0x48', - 'fixed0x56', - 'fixed0x64', - 'fixed0x72', - 'fixed0x80', - 'fixed0x88', - 'fixed0x96', - 'fixed0x104', - 'fixed0x112', - 'fixed0x120', - 'fixed0x128', - 'fixed0x136', - 'fixed0x144', - 'fixed0x152', - 'fixed0x160', - 'fixed0x168', - 'fixed0x176', - 'fixed0x184', - 'fixed0x192', - 'fixed0x200', - 'fixed0x208', - 'fixed0x216', - 'fixed0x224', - 'fixed0x232', - 'fixed0x240', - 'fixed0x248', - 'fixed0x256', - 'fixed8x8', - 'fixed8x16', - 'fixed8x24', - 'fixed8x32', - 'fixed8x40', - 'fixed8x48', - 'fixed8x56', - 'fixed8x64', - 'fixed8x72', - 'fixed8x80', - 'fixed8x88', - 'fixed8x96', - 'fixed8x104', - 'fixed8x112', - 'fixed8x120', - 'fixed8x128', - 'fixed8x136', - 'fixed8x144', - 'fixed8x152', - 'fixed8x160', - 'fixed8x168', - 'fixed8x176', - 'fixed8x184', - 'fixed8x192', - 'fixed8x200', - 'fixed8x208', - 'fixed8x216', - 'fixed8x224', - 'fixed8x232', - 'fixed8x240', - 'fixed8x248', - 'fixed16x8', - 'fixed16x16', - 'fixed16x24', - 'fixed16x32', - 'fixed16x40', - 'fixed16x48', - 'fixed16x56', - 'fixed16x64', - 'fixed16x72', - 'fixed16x80', - 'fixed16x88', - 'fixed16x96', - 'fixed16x104', - 'fixed16x112', - 'fixed16x120', - 'fixed16x128', - 'fixed16x136', - 'fixed16x144', - 'fixed16x152', - 'fixed16x160', - 'fixed16x168', - 'fixed16x176', - 'fixed16x184', - 'fixed16x192', - 'fixed16x200', - 'fixed16x208', - 'fixed16x216', - 'fixed16x224', - 'fixed16x232', - 'fixed16x240', - 'fixed24x8', - 'fixed24x16', - 'fixed24x24', - 'fixed24x32', - 'fixed24x40', - 'fixed24x48', - 'fixed24x56', - 'fixed24x64', - 'fixed24x72', - 'fixed24x80', - 'fixed24x88', - 'fixed24x96', - 'fixed24x104', - 'fixed24x112', - 'fixed24x120', - 'fixed24x128', - 'fixed24x136', - 'fixed24x144', - 'fixed24x152', - 'fixed24x160', - 'fixed24x168', - 'fixed24x176', - 'fixed24x184', - 'fixed24x192', - 'fixed24x200', - 'fixed24x208', - 'fixed24x216', - 'fixed24x224', - 'fixed24x232', - 'fixed32x8', - 'fixed32x16', - 'fixed32x24', - 'fixed32x32', - 'fixed32x40', - 'fixed32x48', - 'fixed32x56', - 'fixed32x64', - 'fixed32x72', - 'fixed32x80', - 'fixed32x88', - 'fixed32x96', - 'fixed32x104', - 'fixed32x112', - 'fixed32x120', - 'fixed32x128', - 'fixed32x136', - 'fixed32x144', - 'fixed32x152', - 'fixed32x160', - 'fixed32x168', - 'fixed32x176', - 'fixed32x184', - 'fixed32x192', - 'fixed32x200', - 'fixed32x208', - 'fixed32x216', - 'fixed32x224', - 'fixed40x8', - 'fixed40x16', - 'fixed40x24', - 'fixed40x32', - 'fixed40x40', - 'fixed40x48', - 'fixed40x56', - 'fixed40x64', - 'fixed40x72', - 'fixed40x80', - 'fixed40x88', - 'fixed40x96', - 'fixed40x104', - 'fixed40x112', - 'fixed40x120', - 'fixed40x128', - 'fixed40x136', - 'fixed40x144', - 'fixed40x152', - 'fixed40x160', - 'fixed40x168', - 'fixed40x176', - 'fixed40x184', - 'fixed40x192', - 'fixed40x200', - 'fixed40x208', - 'fixed40x216', - 'fixed48x8', - 'fixed48x16', - 'fixed48x24', - 'fixed48x32', - 'fixed48x40', - 'fixed48x48', - 'fixed48x56', - 'fixed48x64', - 'fixed48x72', - 'fixed48x80', - 'fixed48x88', - 'fixed48x96', - 'fixed48x104', - 'fixed48x112', - 'fixed48x120', - 'fixed48x128', - 'fixed48x136', - 'fixed48x144', - 'fixed48x152', - 'fixed48x160', - 'fixed48x168', - 'fixed48x176', - 'fixed48x184', - 'fixed48x192', - 'fixed48x200', - 'fixed48x208', - 'fixed56x8', - 'fixed56x16', - 'fixed56x24', - 'fixed56x32', - 'fixed56x40', - 'fixed56x48', - 'fixed56x56', - 'fixed56x64', - 'fixed56x72', - 'fixed56x80', - 'fixed56x88', - 'fixed56x96', - 'fixed56x104', - 'fixed56x112', - 'fixed56x120', - 'fixed56x128', - 'fixed56x136', - 'fixed56x144', - 'fixed56x152', - 'fixed56x160', - 'fixed56x168', - 'fixed56x176', - 'fixed56x184', - 'fixed56x192', - 'fixed56x200', - 'fixed64x8', - 'fixed64x16', - 'fixed64x24', - 'fixed64x32', - 'fixed64x40', - 'fixed64x48', - 'fixed64x56', - 'fixed64x64', - 'fixed64x72', - 'fixed64x80', - 'fixed64x88', - 'fixed64x96', - 'fixed64x104', - 'fixed64x112', - 'fixed64x120', - 'fixed64x128', - 'fixed64x136', - 'fixed64x144', - 'fixed64x152', - 'fixed64x160', - 'fixed64x168', - 'fixed64x176', - 'fixed64x184', - 'fixed64x192', - 'fixed72x8', - 'fixed72x16', - 'fixed72x24', - 'fixed72x32', - 'fixed72x40', - 'fixed72x48', - 'fixed72x56', - 'fixed72x64', - 'fixed72x72', - 'fixed72x80', - 'fixed72x88', - 'fixed72x96', - 'fixed72x104', - 'fixed72x112', - 'fixed72x120', - 'fixed72x128', - 'fixed72x136', - 'fixed72x144', - 'fixed72x152', - 'fixed72x160', - 'fixed72x168', - 'fixed72x176', - 'fixed72x184', - 'fixed80x8', - 'fixed80x16', - 'fixed80x24', - 'fixed80x32', - 'fixed80x40', - 'fixed80x48', - 'fixed80x56', - 'fixed80x64', - 'fixed80x72', - 'fixed80x80', - 'fixed80x88', - 'fixed80x96', - 'fixed80x104', - 'fixed80x112', - 'fixed80x120', - 'fixed80x128', - 'fixed80x136', - 'fixed80x144', - 'fixed80x152', - 'fixed80x160', - 'fixed80x168', - 'fixed80x176', - 'fixed88x8', - 'fixed88x16', - 'fixed88x24', - 'fixed88x32', - 'fixed88x40', - 'fixed88x48', - 'fixed88x56', - 'fixed88x64', - 'fixed88x72', - 'fixed88x80', - 'fixed88x88', - 'fixed88x96', - 'fixed88x104', - 'fixed88x112', - 'fixed88x120', - 'fixed88x128', - 'fixed88x136', - 'fixed88x144', - 'fixed88x152', - 'fixed88x160', - 'fixed88x168', - 'fixed96x8', - 'fixed96x16', - 'fixed96x24', - 'fixed96x32', - 'fixed96x40', - 'fixed96x48', - 'fixed96x56', - 'fixed96x64', - 'fixed96x72', - 'fixed96x80', - 'fixed96x88', - 'fixed96x96', - 'fixed96x104', - 'fixed96x112', - 'fixed96x120', - 'fixed96x128', - 'fixed96x136', - 'fixed96x144', - 'fixed96x152', - 'fixed96x160', - 'fixed104x8', - 'fixed104x16', - 'fixed104x24', - 'fixed104x32', - 'fixed104x40', - 'fixed104x48', - 'fixed104x56', - 'fixed104x64', - 'fixed104x72', - 'fixed104x80', - 'fixed104x88', - 'fixed104x96', - 'fixed104x104', - 'fixed104x112', - 'fixed104x120', - 'fixed104x128', - 'fixed104x136', - 'fixed104x144', - 'fixed104x152', - 'fixed112x8', - 'fixed112x16', - 'fixed112x24', - 'fixed112x32', - 'fixed112x40', - 'fixed112x48', - 'fixed112x56', - 'fixed112x64', - 'fixed112x72', - 'fixed112x80', - 'fixed112x88', - 'fixed112x96', - 'fixed112x104', - 'fixed112x112', - 'fixed112x120', - 'fixed112x128', - 'fixed112x136', - 'fixed112x144', - 'fixed120x8', - 'fixed120x16', - 'fixed120x24', - 'fixed120x32', - 'fixed120x40', - 'fixed120x48', - 'fixed120x56', - 'fixed120x64', - 'fixed120x72', - 'fixed120x80', - 'fixed120x88', - 'fixed120x96', - 'fixed120x104', - 'fixed120x112', - 'fixed120x120', - 'fixed120x128', - 'fixed120x136', - 'fixed128x8', - 'fixed128x16', - 'fixed128x24', - 'fixed128x32', - 'fixed128x40', - 'fixed128x48', - 'fixed128x56', - 'fixed128x64', - 'fixed128x72', - 'fixed128x80', - 'fixed128x88', - 'fixed128x96', - 'fixed128x104', - 'fixed128x112', - 'fixed128x120', - 'fixed128x128', - 'fixed136x8', - 'fixed136x16', - 'fixed136x24', - 'fixed136x32', - 'fixed136x40', - 'fixed136x48', - 'fixed136x56', - 'fixed136x64', - 'fixed136x72', - 'fixed136x80', - 'fixed136x88', - 'fixed136x96', - 'fixed136x104', - 'fixed136x112', - 'fixed136x120', - 'fixed144x8', - 'fixed144x16', - 'fixed144x24', - 'fixed144x32', - 'fixed144x40', - 'fixed144x48', - 'fixed144x56', - 'fixed144x64', - 'fixed144x72', - 'fixed144x80', - 'fixed144x88', - 'fixed144x96', - 'fixed144x104', - 'fixed144x112', - 'fixed152x8', - 'fixed152x16', - 'fixed152x24', - 'fixed152x32', - 'fixed152x40', - 'fixed152x48', - 'fixed152x56', - 'fixed152x64', - 'fixed152x72', - 'fixed152x80', - 'fixed152x88', - 'fixed152x96', - 'fixed152x104', - 'fixed160x8', - 'fixed160x16', - 'fixed160x24', - 'fixed160x32', - 'fixed160x40', - 'fixed160x48', - 'fixed160x56', - 'fixed160x64', - 'fixed160x72', - 'fixed160x80', - 'fixed160x88', - 'fixed160x96', - 'fixed168x8', - 'fixed168x16', - 'fixed168x24', - 'fixed168x32', - 'fixed168x40', - 'fixed168x48', - 'fixed168x56', - 'fixed168x64', - 'fixed168x72', - 'fixed168x80', - 'fixed168x88', - 'fixed176x8', - 'fixed176x16', - 'fixed176x24', - 'fixed176x32', - 'fixed176x40', - 'fixed176x48', - 'fixed176x56', - 'fixed176x64', - 'fixed176x72', - 'fixed176x80', - 'fixed184x8', - 'fixed184x16', - 'fixed184x24', - 'fixed184x32', - 'fixed184x40', - 'fixed184x48', - 'fixed184x56', - 'fixed184x64', - 'fixed184x72', - 'fixed192x8', - 'fixed192x16', - 'fixed192x24', - 'fixed192x32', - 'fixed192x40', - 'fixed192x48', - 'fixed192x56', - 'fixed192x64', - 'fixed200x8', - 'fixed200x16', - 'fixed200x24', - 'fixed200x32', - 'fixed200x40', - 'fixed200x48', - 'fixed200x56', - 'fixed208x8', - 'fixed208x16', - 'fixed208x24', - 'fixed208x32', - 'fixed208x40', - 'fixed208x48', - 'fixed216x8', - 'fixed216x16', - 'fixed216x24', - 'fixed216x32', - 'fixed216x40', - 'fixed224x8', - 'fixed224x16', - 'fixed224x24', - 'fixed224x32', - 'fixed232x8', - 'fixed232x16', - 'fixed232x24', - 'fixed240x8', - 'fixed240x16', - 'fixed248x8', - //All ufixed - 'ufixed', - 'ufixed0x8', - 'ufixed0x16', - 'ufixed0x24', - 'ufixed0x32', - 'ufixed0x40', - 'ufixed0x48', - 'ufixed0x56', - 'ufixed0x64', - 'ufixed0x72', - 'ufixed0x80', - 'ufixed0x88', - 'ufixed0x96', - 'ufixed0x104', - 'ufixed0x112', - 'ufixed0x120', - 'ufixed0x128', - 'ufixed0x136', - 'ufixed0x144', - 'ufixed0x152', - 'ufixed0x160', - 'ufixed0x168', - 'ufixed0x176', - 'ufixed0x184', - 'ufixed0x192', - 'ufixed0x200', - 'ufixed0x208', - 'ufixed0x216', - 'ufixed0x224', - 'ufixed0x232', - 'ufixed0x240', - 'ufixed0x248', - 'ufixed0x256', - 'ufixed8x8', - 'ufixed8x16', - 'ufixed8x24', - 'ufixed8x32', - 'ufixed8x40', - 'ufixed8x48', - 'ufixed8x56', - 'ufixed8x64', - 'ufixed8x72', - 'ufixed8x80', - 'ufixed8x88', - 'ufixed8x96', - 'ufixed8x104', - 'ufixed8x112', - 'ufixed8x120', - 'ufixed8x128', - 'ufixed8x136', - 'ufixed8x144', - 'ufixed8x152', - 'ufixed8x160', - 'ufixed8x168', - 'ufixed8x176', - 'ufixed8x184', - 'ufixed8x192', - 'ufixed8x200', - 'ufixed8x208', - 'ufixed8x216', - 'ufixed8x224', - 'ufixed8x232', - 'ufixed8x240', - 'ufixed8x248', - 'ufixed16x8', - 'ufixed16x16', - 'ufixed16x24', - 'ufixed16x32', - 'ufixed16x40', - 'ufixed16x48', - 'ufixed16x56', - 'ufixed16x64', - 'ufixed16x72', - 'ufixed16x80', - 'ufixed16x88', - 'ufixed16x96', - 'ufixed16x104', - 'ufixed16x112', - 'ufixed16x120', - 'ufixed16x128', - 'ufixed16x136', - 'ufixed16x144', - 'ufixed16x152', - 'ufixed16x160', - 'ufixed16x168', - 'ufixed16x176', - 'ufixed16x184', - 'ufixed16x192', - 'ufixed16x200', - 'ufixed16x208', - 'ufixed16x216', - 'ufixed16x224', - 'ufixed16x232', - 'ufixed16x240', - 'ufixed24x8', - 'ufixed24x16', - 'ufixed24x24', - 'ufixed24x32', - 'ufixed24x40', - 'ufixed24x48', - 'ufixed24x56', - 'ufixed24x64', - 'ufixed24x72', - 'ufixed24x80', - 'ufixed24x88', - 'ufixed24x96', - 'ufixed24x104', - 'ufixed24x112', - 'ufixed24x120', - 'ufixed24x128', - 'ufixed24x136', - 'ufixed24x144', - 'ufixed24x152', - 'ufixed24x160', - 'ufixed24x168', - 'ufixed24x176', - 'ufixed24x184', - 'ufixed24x192', - 'ufixed24x200', - 'ufixed24x208', - 'ufixed24x216', - 'ufixed24x224', - 'ufixed24x232', - 'ufixed32x8', - 'ufixed32x16', - 'ufixed32x24', - 'ufixed32x32', - 'ufixed32x40', - 'ufixed32x48', - 'ufixed32x56', - 'ufixed32x64', - 'ufixed32x72', - 'ufixed32x80', - 'ufixed32x88', - 'ufixed32x96', - 'ufixed32x104', - 'ufixed32x112', - 'ufixed32x120', - 'ufixed32x128', - 'ufixed32x136', - 'ufixed32x144', - 'ufixed32x152', - 'ufixed32x160', - 'ufixed32x168', - 'ufixed32x176', - 'ufixed32x184', - 'ufixed32x192', - 'ufixed32x200', - 'ufixed32x208', - 'ufixed32x216', - 'ufixed32x224', - 'ufixed40x8', - 'ufixed40x16', - 'ufixed40x24', - 'ufixed40x32', - 'ufixed40x40', - 'ufixed40x48', - 'ufixed40x56', - 'ufixed40x64', - 'ufixed40x72', - 'ufixed40x80', - 'ufixed40x88', - 'ufixed40x96', - 'ufixed40x104', - 'ufixed40x112', - 'ufixed40x120', - 'ufixed40x128', - 'ufixed40x136', - 'ufixed40x144', - 'ufixed40x152', - 'ufixed40x160', - 'ufixed40x168', - 'ufixed40x176', - 'ufixed40x184', - 'ufixed40x192', - 'ufixed40x200', - 'ufixed40x208', - 'ufixed40x216', - 'ufixed48x8', - 'ufixed48x16', - 'ufixed48x24', - 'ufixed48x32', - 'ufixed48x40', - 'ufixed48x48', - 'ufixed48x56', - 'ufixed48x64', - 'ufixed48x72', - 'ufixed48x80', - 'ufixed48x88', - 'ufixed48x96', - 'ufixed48x104', - 'ufixed48x112', - 'ufixed48x120', - 'ufixed48x128', - 'ufixed48x136', - 'ufixed48x144', - 'ufixed48x152', - 'ufixed48x160', - 'ufixed48x168', - 'ufixed48x176', - 'ufixed48x184', - 'ufixed48x192', - 'ufixed48x200', - 'ufixed48x208', - 'ufixed56x8', - 'ufixed56x16', - 'ufixed56x24', - 'ufixed56x32', - 'ufixed56x40', - 'ufixed56x48', - 'ufixed56x56', - 'ufixed56x64', - 'ufixed56x72', - 'ufixed56x80', - 'ufixed56x88', - 'ufixed56x96', - 'ufixed56x104', - 'ufixed56x112', - 'ufixed56x120', - 'ufixed56x128', - 'ufixed56x136', - 'ufixed56x144', - 'ufixed56x152', - 'ufixed56x160', - 'ufixed56x168', - 'ufixed56x176', - 'ufixed56x184', - 'ufixed56x192', - 'ufixed56x200', - 'ufixed64x8', - 'ufixed64x16', - 'ufixed64x24', - 'ufixed64x32', - 'ufixed64x40', - 'ufixed64x48', - 'ufixed64x56', - 'ufixed64x64', - 'ufixed64x72', - 'ufixed64x80', - 'ufixed64x88', - 'ufixed64x96', - 'ufixed64x104', - 'ufixed64x112', - 'ufixed64x120', - 'ufixed64x128', - 'ufixed64x136', - 'ufixed64x144', - 'ufixed64x152', - 'ufixed64x160', - 'ufixed64x168', - 'ufixed64x176', - 'ufixed64x184', - 'ufixed64x192', - 'ufixed72x8', - 'ufixed72x16', - 'ufixed72x24', - 'ufixed72x32', - 'ufixed72x40', - 'ufixed72x48', - 'ufixed72x56', - 'ufixed72x64', - 'ufixed72x72', - 'ufixed72x80', - 'ufixed72x88', - 'ufixed72x96', - 'ufixed72x104', - 'ufixed72x112', - 'ufixed72x120', - 'ufixed72x128', - 'ufixed72x136', - 'ufixed72x144', - 'ufixed72x152', - 'ufixed72x160', - 'ufixed72x168', - 'ufixed72x176', - 'ufixed72x184', - 'ufixed80x8', - 'ufixed80x16', - 'ufixed80x24', - 'ufixed80x32', - 'ufixed80x40', - 'ufixed80x48', - 'ufixed80x56', - 'ufixed80x64', - 'ufixed80x72', - 'ufixed80x80', - 'ufixed80x88', - 'ufixed80x96', - 'ufixed80x104', - 'ufixed80x112', - 'ufixed80x120', - 'ufixed80x128', - 'ufixed80x136', - 'ufixed80x144', - 'ufixed80x152', - 'ufixed80x160', - 'ufixed80x168', - 'ufixed80x176', - 'ufixed88x8', - 'ufixed88x16', - 'ufixed88x24', - 'ufixed88x32', - 'ufixed88x40', - 'ufixed88x48', - 'ufixed88x56', - 'ufixed88x64', - 'ufixed88x72', - 'ufixed88x80', - 'ufixed88x88', - 'ufixed88x96', - 'ufixed88x104', - 'ufixed88x112', - 'ufixed88x120', - 'ufixed88x128', - 'ufixed88x136', - 'ufixed88x144', - 'ufixed88x152', - 'ufixed88x160', - 'ufixed88x168', - 'ufixed96x8', - 'ufixed96x16', - 'ufixed96x24', - 'ufixed96x32', - 'ufixed96x40', - 'ufixed96x48', - 'ufixed96x56', - 'ufixed96x64', - 'ufixed96x72', - 'ufixed96x80', - 'ufixed96x88', - 'ufixed96x96', - 'ufixed96x104', - 'ufixed96x112', - 'ufixed96x120', - 'ufixed96x128', - 'ufixed96x136', - 'ufixed96x144', - 'ufixed96x152', - 'ufixed96x160', - 'ufixed104x8', - 'ufixed104x16', - 'ufixed104x24', - 'ufixed104x32', - 'ufixed104x40', - 'ufixed104x48', - 'ufixed104x56', - 'ufixed104x64', - 'ufixed104x72', - 'ufixed104x80', - 'ufixed104x88', - 'ufixed104x96', - 'ufixed104x104', - 'ufixed104x112', - 'ufixed104x120', - 'ufixed104x128', - 'ufixed104x136', - 'ufixed104x144', - 'ufixed104x152', - 'ufixed112x8', - 'ufixed112x16', - 'ufixed112x24', - 'ufixed112x32', - 'ufixed112x40', - 'ufixed112x48', - 'ufixed112x56', - 'ufixed112x64', - 'ufixed112x72', - 'ufixed112x80', - 'ufixed112x88', - 'ufixed112x96', - 'ufixed112x104', - 'ufixed112x112', - 'ufixed112x120', - 'ufixed112x128', - 'ufixed112x136', - 'ufixed112x144', - 'ufixed120x8', - 'ufixed120x16', - 'ufixed120x24', - 'ufixed120x32', - 'ufixed120x40', - 'ufixed120x48', - 'ufixed120x56', - 'ufixed120x64', - 'ufixed120x72', - 'ufixed120x80', - 'ufixed120x88', - 'ufixed120x96', - 'ufixed120x104', - 'ufixed120x112', - 'ufixed120x120', - 'ufixed120x128', - 'ufixed120x136', - 'ufixed128x8', - 'ufixed128x16', - 'ufixed128x24', - 'ufixed128x32', - 'ufixed128x40', - 'ufixed128x48', - 'ufixed128x56', - 'ufixed128x64', - 'ufixed128x72', - 'ufixed128x80', - 'ufixed128x88', - 'ufixed128x96', - 'ufixed128x104', - 'ufixed128x112', - 'ufixed128x120', - 'ufixed128x128', - 'ufixed136x8', - 'ufixed136x16', - 'ufixed136x24', - 'ufixed136x32', - 'ufixed136x40', - 'ufixed136x48', - 'ufixed136x56', - 'ufixed136x64', - 'ufixed136x72', - 'ufixed136x80', - 'ufixed136x88', - 'ufixed136x96', - 'ufixed136x104', - 'ufixed136x112', - 'ufixed136x120', - 'ufixed144x8', - 'ufixed144x16', - 'ufixed144x24', - 'ufixed144x32', - 'ufixed144x40', - 'ufixed144x48', - 'ufixed144x56', - 'ufixed144x64', - 'ufixed144x72', - 'ufixed144x80', - 'ufixed144x88', - 'ufixed144x96', - 'ufixed144x104', - 'ufixed144x112', - 'ufixed152x8', - 'ufixed152x16', - 'ufixed152x24', - 'ufixed152x32', - 'ufixed152x40', - 'ufixed152x48', - 'ufixed152x56', - 'ufixed152x64', - 'ufixed152x72', - 'ufixed152x80', - 'ufixed152x88', - 'ufixed152x96', - 'ufixed152x104', - 'ufixed160x8', - 'ufixed160x16', - 'ufixed160x24', - 'ufixed160x32', - 'ufixed160x40', - 'ufixed160x48', - 'ufixed160x56', - 'ufixed160x64', - 'ufixed160x72', - 'ufixed160x80', - 'ufixed160x88', - 'ufixed160x96', - 'ufixed168x8', - 'ufixed168x16', - 'ufixed168x24', - 'ufixed168x32', - 'ufixed168x40', - 'ufixed168x48', - 'ufixed168x56', - 'ufixed168x64', - 'ufixed168x72', - 'ufixed168x80', - 'ufixed168x88', - 'ufixed176x8', - 'ufixed176x16', - 'ufixed176x24', - 'ufixed176x32', - 'ufixed176x40', - 'ufixed176x48', - 'ufixed176x56', - 'ufixed176x64', - 'ufixed176x72', - 'ufixed176x80', - 'ufixed184x8', - 'ufixed184x16', - 'ufixed184x24', - 'ufixed184x32', - 'ufixed184x40', - 'ufixed184x48', - 'ufixed184x56', - 'ufixed184x64', - 'ufixed184x72', - 'ufixed192x8', - 'ufixed192x16', - 'ufixed192x24', - 'ufixed192x32', - 'ufixed192x40', - 'ufixed192x48', - 'ufixed192x56', - 'ufixed192x64', - 'ufixed200x8', - 'ufixed200x16', - 'ufixed200x24', - 'ufixed200x32', - 'ufixed200x40', - 'ufixed200x48', - 'ufixed200x56', - 'ufixed208x8', - 'ufixed208x16', - 'ufixed208x24', - 'ufixed208x32', - 'ufixed208x40', - 'ufixed208x48', - 'ufixed216x8', - 'ufixed216x16', - 'ufixed216x24', - 'ufixed216x32', - 'ufixed216x40', - 'ufixed224x8', - 'ufixed224x16', - 'ufixed224x24', - 'ufixed224x32', - 'ufixed232x8', - 'ufixed232x16', - 'ufixed232x24', - 'ufixed240x8', - 'ufixed240x16', - 'ufixed248x8', - 'event', - 'enum', - 'let', - 'mapping', - 'private', - 'public', - 'external', - 'view', - 'pure', - 'inherited', - 'payable', - 'true', - 'false', - 'var', - 'import', - 'constant', - 'if', - 'else', - 'for', - 'else', - 'for', - 'while', - 'do', - 'break', - 'continue', - 'throw', - 'returns', - 'return', - 'suicide', - 'new', - 'is', - 'this', - 'super' - ], + keywords: [ + // Main keywords + 'pragma', + 'solidity', + 'contract', + 'library', + 'using', + 'struct', + 'function', + 'modifier', + 'constructor', + // Built-in types + 'address', + 'string', + 'bool', + // Other types + 'Int', + 'Uint', + 'Byte', + 'Fixed', + 'Ufixed', + // All int + 'int', + 'int8', + 'int16', + 'int24', + 'int32', + 'int40', + 'int48', + 'int56', + 'int64', + 'int72', + 'int80', + 'int88', + 'int96', + 'int104', + 'int112', + 'int120', + 'int128', + 'int136', + 'int144', + 'int152', + 'int160', + 'int168', + 'int176', + 'int184', + 'int192', + 'int200', + 'int208', + 'int216', + 'int224', + 'int232', + 'int240', + 'int248', + 'int256', + // All uint + 'uint', + 'uint8', + 'uint16', + 'uint24', + 'uint32', + 'uint40', + 'uint48', + 'uint56', + 'uint64', + 'uint72', + 'uint80', + 'uint88', + 'uint96', + 'uint104', + 'uint112', + 'uint120', + 'uint128', + 'uint136', + 'uint144', + 'uint152', + 'uint160', + 'uint168', + 'uint176', + 'uint184', + 'uint192', + 'uint200', + 'uint208', + 'uint216', + 'uint224', + 'uint232', + 'uint240', + 'uint248', + 'uint256', + // All Byte + 'byte', + 'bytes', + 'bytes1', + 'bytes2', + 'bytes3', + 'bytes4', + 'bytes5', + 'bytes6', + 'bytes7', + 'bytes8', + 'bytes9', + 'bytes10', + 'bytes11', + 'bytes12', + 'bytes13', + 'bytes14', + 'bytes15', + 'bytes16', + 'bytes17', + 'bytes18', + 'bytes19', + 'bytes20', + 'bytes21', + 'bytes22', + 'bytes23', + 'bytes24', + 'bytes25', + 'bytes26', + 'bytes27', + 'bytes28', + 'bytes29', + 'bytes30', + 'bytes31', + 'bytes32', + // All fixed + 'fixed', + 'fixed0x8', + 'fixed0x16', + 'fixed0x24', + 'fixed0x32', + 'fixed0x40', + 'fixed0x48', + 'fixed0x56', + 'fixed0x64', + 'fixed0x72', + 'fixed0x80', + 'fixed0x88', + 'fixed0x96', + 'fixed0x104', + 'fixed0x112', + 'fixed0x120', + 'fixed0x128', + 'fixed0x136', + 'fixed0x144', + 'fixed0x152', + 'fixed0x160', + 'fixed0x168', + 'fixed0x176', + 'fixed0x184', + 'fixed0x192', + 'fixed0x200', + 'fixed0x208', + 'fixed0x216', + 'fixed0x224', + 'fixed0x232', + 'fixed0x240', + 'fixed0x248', + 'fixed0x256', + 'fixed8x8', + 'fixed8x16', + 'fixed8x24', + 'fixed8x32', + 'fixed8x40', + 'fixed8x48', + 'fixed8x56', + 'fixed8x64', + 'fixed8x72', + 'fixed8x80', + 'fixed8x88', + 'fixed8x96', + 'fixed8x104', + 'fixed8x112', + 'fixed8x120', + 'fixed8x128', + 'fixed8x136', + 'fixed8x144', + 'fixed8x152', + 'fixed8x160', + 'fixed8x168', + 'fixed8x176', + 'fixed8x184', + 'fixed8x192', + 'fixed8x200', + 'fixed8x208', + 'fixed8x216', + 'fixed8x224', + 'fixed8x232', + 'fixed8x240', + 'fixed8x248', + 'fixed16x8', + 'fixed16x16', + 'fixed16x24', + 'fixed16x32', + 'fixed16x40', + 'fixed16x48', + 'fixed16x56', + 'fixed16x64', + 'fixed16x72', + 'fixed16x80', + 'fixed16x88', + 'fixed16x96', + 'fixed16x104', + 'fixed16x112', + 'fixed16x120', + 'fixed16x128', + 'fixed16x136', + 'fixed16x144', + 'fixed16x152', + 'fixed16x160', + 'fixed16x168', + 'fixed16x176', + 'fixed16x184', + 'fixed16x192', + 'fixed16x200', + 'fixed16x208', + 'fixed16x216', + 'fixed16x224', + 'fixed16x232', + 'fixed16x240', + 'fixed24x8', + 'fixed24x16', + 'fixed24x24', + 'fixed24x32', + 'fixed24x40', + 'fixed24x48', + 'fixed24x56', + 'fixed24x64', + 'fixed24x72', + 'fixed24x80', + 'fixed24x88', + 'fixed24x96', + 'fixed24x104', + 'fixed24x112', + 'fixed24x120', + 'fixed24x128', + 'fixed24x136', + 'fixed24x144', + 'fixed24x152', + 'fixed24x160', + 'fixed24x168', + 'fixed24x176', + 'fixed24x184', + 'fixed24x192', + 'fixed24x200', + 'fixed24x208', + 'fixed24x216', + 'fixed24x224', + 'fixed24x232', + 'fixed32x8', + 'fixed32x16', + 'fixed32x24', + 'fixed32x32', + 'fixed32x40', + 'fixed32x48', + 'fixed32x56', + 'fixed32x64', + 'fixed32x72', + 'fixed32x80', + 'fixed32x88', + 'fixed32x96', + 'fixed32x104', + 'fixed32x112', + 'fixed32x120', + 'fixed32x128', + 'fixed32x136', + 'fixed32x144', + 'fixed32x152', + 'fixed32x160', + 'fixed32x168', + 'fixed32x176', + 'fixed32x184', + 'fixed32x192', + 'fixed32x200', + 'fixed32x208', + 'fixed32x216', + 'fixed32x224', + 'fixed40x8', + 'fixed40x16', + 'fixed40x24', + 'fixed40x32', + 'fixed40x40', + 'fixed40x48', + 'fixed40x56', + 'fixed40x64', + 'fixed40x72', + 'fixed40x80', + 'fixed40x88', + 'fixed40x96', + 'fixed40x104', + 'fixed40x112', + 'fixed40x120', + 'fixed40x128', + 'fixed40x136', + 'fixed40x144', + 'fixed40x152', + 'fixed40x160', + 'fixed40x168', + 'fixed40x176', + 'fixed40x184', + 'fixed40x192', + 'fixed40x200', + 'fixed40x208', + 'fixed40x216', + 'fixed48x8', + 'fixed48x16', + 'fixed48x24', + 'fixed48x32', + 'fixed48x40', + 'fixed48x48', + 'fixed48x56', + 'fixed48x64', + 'fixed48x72', + 'fixed48x80', + 'fixed48x88', + 'fixed48x96', + 'fixed48x104', + 'fixed48x112', + 'fixed48x120', + 'fixed48x128', + 'fixed48x136', + 'fixed48x144', + 'fixed48x152', + 'fixed48x160', + 'fixed48x168', + 'fixed48x176', + 'fixed48x184', + 'fixed48x192', + 'fixed48x200', + 'fixed48x208', + 'fixed56x8', + 'fixed56x16', + 'fixed56x24', + 'fixed56x32', + 'fixed56x40', + 'fixed56x48', + 'fixed56x56', + 'fixed56x64', + 'fixed56x72', + 'fixed56x80', + 'fixed56x88', + 'fixed56x96', + 'fixed56x104', + 'fixed56x112', + 'fixed56x120', + 'fixed56x128', + 'fixed56x136', + 'fixed56x144', + 'fixed56x152', + 'fixed56x160', + 'fixed56x168', + 'fixed56x176', + 'fixed56x184', + 'fixed56x192', + 'fixed56x200', + 'fixed64x8', + 'fixed64x16', + 'fixed64x24', + 'fixed64x32', + 'fixed64x40', + 'fixed64x48', + 'fixed64x56', + 'fixed64x64', + 'fixed64x72', + 'fixed64x80', + 'fixed64x88', + 'fixed64x96', + 'fixed64x104', + 'fixed64x112', + 'fixed64x120', + 'fixed64x128', + 'fixed64x136', + 'fixed64x144', + 'fixed64x152', + 'fixed64x160', + 'fixed64x168', + 'fixed64x176', + 'fixed64x184', + 'fixed64x192', + 'fixed72x8', + 'fixed72x16', + 'fixed72x24', + 'fixed72x32', + 'fixed72x40', + 'fixed72x48', + 'fixed72x56', + 'fixed72x64', + 'fixed72x72', + 'fixed72x80', + 'fixed72x88', + 'fixed72x96', + 'fixed72x104', + 'fixed72x112', + 'fixed72x120', + 'fixed72x128', + 'fixed72x136', + 'fixed72x144', + 'fixed72x152', + 'fixed72x160', + 'fixed72x168', + 'fixed72x176', + 'fixed72x184', + 'fixed80x8', + 'fixed80x16', + 'fixed80x24', + 'fixed80x32', + 'fixed80x40', + 'fixed80x48', + 'fixed80x56', + 'fixed80x64', + 'fixed80x72', + 'fixed80x80', + 'fixed80x88', + 'fixed80x96', + 'fixed80x104', + 'fixed80x112', + 'fixed80x120', + 'fixed80x128', + 'fixed80x136', + 'fixed80x144', + 'fixed80x152', + 'fixed80x160', + 'fixed80x168', + 'fixed80x176', + 'fixed88x8', + 'fixed88x16', + 'fixed88x24', + 'fixed88x32', + 'fixed88x40', + 'fixed88x48', + 'fixed88x56', + 'fixed88x64', + 'fixed88x72', + 'fixed88x80', + 'fixed88x88', + 'fixed88x96', + 'fixed88x104', + 'fixed88x112', + 'fixed88x120', + 'fixed88x128', + 'fixed88x136', + 'fixed88x144', + 'fixed88x152', + 'fixed88x160', + 'fixed88x168', + 'fixed96x8', + 'fixed96x16', + 'fixed96x24', + 'fixed96x32', + 'fixed96x40', + 'fixed96x48', + 'fixed96x56', + 'fixed96x64', + 'fixed96x72', + 'fixed96x80', + 'fixed96x88', + 'fixed96x96', + 'fixed96x104', + 'fixed96x112', + 'fixed96x120', + 'fixed96x128', + 'fixed96x136', + 'fixed96x144', + 'fixed96x152', + 'fixed96x160', + 'fixed104x8', + 'fixed104x16', + 'fixed104x24', + 'fixed104x32', + 'fixed104x40', + 'fixed104x48', + 'fixed104x56', + 'fixed104x64', + 'fixed104x72', + 'fixed104x80', + 'fixed104x88', + 'fixed104x96', + 'fixed104x104', + 'fixed104x112', + 'fixed104x120', + 'fixed104x128', + 'fixed104x136', + 'fixed104x144', + 'fixed104x152', + 'fixed112x8', + 'fixed112x16', + 'fixed112x24', + 'fixed112x32', + 'fixed112x40', + 'fixed112x48', + 'fixed112x56', + 'fixed112x64', + 'fixed112x72', + 'fixed112x80', + 'fixed112x88', + 'fixed112x96', + 'fixed112x104', + 'fixed112x112', + 'fixed112x120', + 'fixed112x128', + 'fixed112x136', + 'fixed112x144', + 'fixed120x8', + 'fixed120x16', + 'fixed120x24', + 'fixed120x32', + 'fixed120x40', + 'fixed120x48', + 'fixed120x56', + 'fixed120x64', + 'fixed120x72', + 'fixed120x80', + 'fixed120x88', + 'fixed120x96', + 'fixed120x104', + 'fixed120x112', + 'fixed120x120', + 'fixed120x128', + 'fixed120x136', + 'fixed128x8', + 'fixed128x16', + 'fixed128x24', + 'fixed128x32', + 'fixed128x40', + 'fixed128x48', + 'fixed128x56', + 'fixed128x64', + 'fixed128x72', + 'fixed128x80', + 'fixed128x88', + 'fixed128x96', + 'fixed128x104', + 'fixed128x112', + 'fixed128x120', + 'fixed128x128', + 'fixed136x8', + 'fixed136x16', + 'fixed136x24', + 'fixed136x32', + 'fixed136x40', + 'fixed136x48', + 'fixed136x56', + 'fixed136x64', + 'fixed136x72', + 'fixed136x80', + 'fixed136x88', + 'fixed136x96', + 'fixed136x104', + 'fixed136x112', + 'fixed136x120', + 'fixed144x8', + 'fixed144x16', + 'fixed144x24', + 'fixed144x32', + 'fixed144x40', + 'fixed144x48', + 'fixed144x56', + 'fixed144x64', + 'fixed144x72', + 'fixed144x80', + 'fixed144x88', + 'fixed144x96', + 'fixed144x104', + 'fixed144x112', + 'fixed152x8', + 'fixed152x16', + 'fixed152x24', + 'fixed152x32', + 'fixed152x40', + 'fixed152x48', + 'fixed152x56', + 'fixed152x64', + 'fixed152x72', + 'fixed152x80', + 'fixed152x88', + 'fixed152x96', + 'fixed152x104', + 'fixed160x8', + 'fixed160x16', + 'fixed160x24', + 'fixed160x32', + 'fixed160x40', + 'fixed160x48', + 'fixed160x56', + 'fixed160x64', + 'fixed160x72', + 'fixed160x80', + 'fixed160x88', + 'fixed160x96', + 'fixed168x8', + 'fixed168x16', + 'fixed168x24', + 'fixed168x32', + 'fixed168x40', + 'fixed168x48', + 'fixed168x56', + 'fixed168x64', + 'fixed168x72', + 'fixed168x80', + 'fixed168x88', + 'fixed176x8', + 'fixed176x16', + 'fixed176x24', + 'fixed176x32', + 'fixed176x40', + 'fixed176x48', + 'fixed176x56', + 'fixed176x64', + 'fixed176x72', + 'fixed176x80', + 'fixed184x8', + 'fixed184x16', + 'fixed184x24', + 'fixed184x32', + 'fixed184x40', + 'fixed184x48', + 'fixed184x56', + 'fixed184x64', + 'fixed184x72', + 'fixed192x8', + 'fixed192x16', + 'fixed192x24', + 'fixed192x32', + 'fixed192x40', + 'fixed192x48', + 'fixed192x56', + 'fixed192x64', + 'fixed200x8', + 'fixed200x16', + 'fixed200x24', + 'fixed200x32', + 'fixed200x40', + 'fixed200x48', + 'fixed200x56', + 'fixed208x8', + 'fixed208x16', + 'fixed208x24', + 'fixed208x32', + 'fixed208x40', + 'fixed208x48', + 'fixed216x8', + 'fixed216x16', + 'fixed216x24', + 'fixed216x32', + 'fixed216x40', + 'fixed224x8', + 'fixed224x16', + 'fixed224x24', + 'fixed224x32', + 'fixed232x8', + 'fixed232x16', + 'fixed232x24', + 'fixed240x8', + 'fixed240x16', + 'fixed248x8', + // All ufixed + 'ufixed', + 'ufixed0x8', + 'ufixed0x16', + 'ufixed0x24', + 'ufixed0x32', + 'ufixed0x40', + 'ufixed0x48', + 'ufixed0x56', + 'ufixed0x64', + 'ufixed0x72', + 'ufixed0x80', + 'ufixed0x88', + 'ufixed0x96', + 'ufixed0x104', + 'ufixed0x112', + 'ufixed0x120', + 'ufixed0x128', + 'ufixed0x136', + 'ufixed0x144', + 'ufixed0x152', + 'ufixed0x160', + 'ufixed0x168', + 'ufixed0x176', + 'ufixed0x184', + 'ufixed0x192', + 'ufixed0x200', + 'ufixed0x208', + 'ufixed0x216', + 'ufixed0x224', + 'ufixed0x232', + 'ufixed0x240', + 'ufixed0x248', + 'ufixed0x256', + 'ufixed8x8', + 'ufixed8x16', + 'ufixed8x24', + 'ufixed8x32', + 'ufixed8x40', + 'ufixed8x48', + 'ufixed8x56', + 'ufixed8x64', + 'ufixed8x72', + 'ufixed8x80', + 'ufixed8x88', + 'ufixed8x96', + 'ufixed8x104', + 'ufixed8x112', + 'ufixed8x120', + 'ufixed8x128', + 'ufixed8x136', + 'ufixed8x144', + 'ufixed8x152', + 'ufixed8x160', + 'ufixed8x168', + 'ufixed8x176', + 'ufixed8x184', + 'ufixed8x192', + 'ufixed8x200', + 'ufixed8x208', + 'ufixed8x216', + 'ufixed8x224', + 'ufixed8x232', + 'ufixed8x240', + 'ufixed8x248', + 'ufixed16x8', + 'ufixed16x16', + 'ufixed16x24', + 'ufixed16x32', + 'ufixed16x40', + 'ufixed16x48', + 'ufixed16x56', + 'ufixed16x64', + 'ufixed16x72', + 'ufixed16x80', + 'ufixed16x88', + 'ufixed16x96', + 'ufixed16x104', + 'ufixed16x112', + 'ufixed16x120', + 'ufixed16x128', + 'ufixed16x136', + 'ufixed16x144', + 'ufixed16x152', + 'ufixed16x160', + 'ufixed16x168', + 'ufixed16x176', + 'ufixed16x184', + 'ufixed16x192', + 'ufixed16x200', + 'ufixed16x208', + 'ufixed16x216', + 'ufixed16x224', + 'ufixed16x232', + 'ufixed16x240', + 'ufixed24x8', + 'ufixed24x16', + 'ufixed24x24', + 'ufixed24x32', + 'ufixed24x40', + 'ufixed24x48', + 'ufixed24x56', + 'ufixed24x64', + 'ufixed24x72', + 'ufixed24x80', + 'ufixed24x88', + 'ufixed24x96', + 'ufixed24x104', + 'ufixed24x112', + 'ufixed24x120', + 'ufixed24x128', + 'ufixed24x136', + 'ufixed24x144', + 'ufixed24x152', + 'ufixed24x160', + 'ufixed24x168', + 'ufixed24x176', + 'ufixed24x184', + 'ufixed24x192', + 'ufixed24x200', + 'ufixed24x208', + 'ufixed24x216', + 'ufixed24x224', + 'ufixed24x232', + 'ufixed32x8', + 'ufixed32x16', + 'ufixed32x24', + 'ufixed32x32', + 'ufixed32x40', + 'ufixed32x48', + 'ufixed32x56', + 'ufixed32x64', + 'ufixed32x72', + 'ufixed32x80', + 'ufixed32x88', + 'ufixed32x96', + 'ufixed32x104', + 'ufixed32x112', + 'ufixed32x120', + 'ufixed32x128', + 'ufixed32x136', + 'ufixed32x144', + 'ufixed32x152', + 'ufixed32x160', + 'ufixed32x168', + 'ufixed32x176', + 'ufixed32x184', + 'ufixed32x192', + 'ufixed32x200', + 'ufixed32x208', + 'ufixed32x216', + 'ufixed32x224', + 'ufixed40x8', + 'ufixed40x16', + 'ufixed40x24', + 'ufixed40x32', + 'ufixed40x40', + 'ufixed40x48', + 'ufixed40x56', + 'ufixed40x64', + 'ufixed40x72', + 'ufixed40x80', + 'ufixed40x88', + 'ufixed40x96', + 'ufixed40x104', + 'ufixed40x112', + 'ufixed40x120', + 'ufixed40x128', + 'ufixed40x136', + 'ufixed40x144', + 'ufixed40x152', + 'ufixed40x160', + 'ufixed40x168', + 'ufixed40x176', + 'ufixed40x184', + 'ufixed40x192', + 'ufixed40x200', + 'ufixed40x208', + 'ufixed40x216', + 'ufixed48x8', + 'ufixed48x16', + 'ufixed48x24', + 'ufixed48x32', + 'ufixed48x40', + 'ufixed48x48', + 'ufixed48x56', + 'ufixed48x64', + 'ufixed48x72', + 'ufixed48x80', + 'ufixed48x88', + 'ufixed48x96', + 'ufixed48x104', + 'ufixed48x112', + 'ufixed48x120', + 'ufixed48x128', + 'ufixed48x136', + 'ufixed48x144', + 'ufixed48x152', + 'ufixed48x160', + 'ufixed48x168', + 'ufixed48x176', + 'ufixed48x184', + 'ufixed48x192', + 'ufixed48x200', + 'ufixed48x208', + 'ufixed56x8', + 'ufixed56x16', + 'ufixed56x24', + 'ufixed56x32', + 'ufixed56x40', + 'ufixed56x48', + 'ufixed56x56', + 'ufixed56x64', + 'ufixed56x72', + 'ufixed56x80', + 'ufixed56x88', + 'ufixed56x96', + 'ufixed56x104', + 'ufixed56x112', + 'ufixed56x120', + 'ufixed56x128', + 'ufixed56x136', + 'ufixed56x144', + 'ufixed56x152', + 'ufixed56x160', + 'ufixed56x168', + 'ufixed56x176', + 'ufixed56x184', + 'ufixed56x192', + 'ufixed56x200', + 'ufixed64x8', + 'ufixed64x16', + 'ufixed64x24', + 'ufixed64x32', + 'ufixed64x40', + 'ufixed64x48', + 'ufixed64x56', + 'ufixed64x64', + 'ufixed64x72', + 'ufixed64x80', + 'ufixed64x88', + 'ufixed64x96', + 'ufixed64x104', + 'ufixed64x112', + 'ufixed64x120', + 'ufixed64x128', + 'ufixed64x136', + 'ufixed64x144', + 'ufixed64x152', + 'ufixed64x160', + 'ufixed64x168', + 'ufixed64x176', + 'ufixed64x184', + 'ufixed64x192', + 'ufixed72x8', + 'ufixed72x16', + 'ufixed72x24', + 'ufixed72x32', + 'ufixed72x40', + 'ufixed72x48', + 'ufixed72x56', + 'ufixed72x64', + 'ufixed72x72', + 'ufixed72x80', + 'ufixed72x88', + 'ufixed72x96', + 'ufixed72x104', + 'ufixed72x112', + 'ufixed72x120', + 'ufixed72x128', + 'ufixed72x136', + 'ufixed72x144', + 'ufixed72x152', + 'ufixed72x160', + 'ufixed72x168', + 'ufixed72x176', + 'ufixed72x184', + 'ufixed80x8', + 'ufixed80x16', + 'ufixed80x24', + 'ufixed80x32', + 'ufixed80x40', + 'ufixed80x48', + 'ufixed80x56', + 'ufixed80x64', + 'ufixed80x72', + 'ufixed80x80', + 'ufixed80x88', + 'ufixed80x96', + 'ufixed80x104', + 'ufixed80x112', + 'ufixed80x120', + 'ufixed80x128', + 'ufixed80x136', + 'ufixed80x144', + 'ufixed80x152', + 'ufixed80x160', + 'ufixed80x168', + 'ufixed80x176', + 'ufixed88x8', + 'ufixed88x16', + 'ufixed88x24', + 'ufixed88x32', + 'ufixed88x40', + 'ufixed88x48', + 'ufixed88x56', + 'ufixed88x64', + 'ufixed88x72', + 'ufixed88x80', + 'ufixed88x88', + 'ufixed88x96', + 'ufixed88x104', + 'ufixed88x112', + 'ufixed88x120', + 'ufixed88x128', + 'ufixed88x136', + 'ufixed88x144', + 'ufixed88x152', + 'ufixed88x160', + 'ufixed88x168', + 'ufixed96x8', + 'ufixed96x16', + 'ufixed96x24', + 'ufixed96x32', + 'ufixed96x40', + 'ufixed96x48', + 'ufixed96x56', + 'ufixed96x64', + 'ufixed96x72', + 'ufixed96x80', + 'ufixed96x88', + 'ufixed96x96', + 'ufixed96x104', + 'ufixed96x112', + 'ufixed96x120', + 'ufixed96x128', + 'ufixed96x136', + 'ufixed96x144', + 'ufixed96x152', + 'ufixed96x160', + 'ufixed104x8', + 'ufixed104x16', + 'ufixed104x24', + 'ufixed104x32', + 'ufixed104x40', + 'ufixed104x48', + 'ufixed104x56', + 'ufixed104x64', + 'ufixed104x72', + 'ufixed104x80', + 'ufixed104x88', + 'ufixed104x96', + 'ufixed104x104', + 'ufixed104x112', + 'ufixed104x120', + 'ufixed104x128', + 'ufixed104x136', + 'ufixed104x144', + 'ufixed104x152', + 'ufixed112x8', + 'ufixed112x16', + 'ufixed112x24', + 'ufixed112x32', + 'ufixed112x40', + 'ufixed112x48', + 'ufixed112x56', + 'ufixed112x64', + 'ufixed112x72', + 'ufixed112x80', + 'ufixed112x88', + 'ufixed112x96', + 'ufixed112x104', + 'ufixed112x112', + 'ufixed112x120', + 'ufixed112x128', + 'ufixed112x136', + 'ufixed112x144', + 'ufixed120x8', + 'ufixed120x16', + 'ufixed120x24', + 'ufixed120x32', + 'ufixed120x40', + 'ufixed120x48', + 'ufixed120x56', + 'ufixed120x64', + 'ufixed120x72', + 'ufixed120x80', + 'ufixed120x88', + 'ufixed120x96', + 'ufixed120x104', + 'ufixed120x112', + 'ufixed120x120', + 'ufixed120x128', + 'ufixed120x136', + 'ufixed128x8', + 'ufixed128x16', + 'ufixed128x24', + 'ufixed128x32', + 'ufixed128x40', + 'ufixed128x48', + 'ufixed128x56', + 'ufixed128x64', + 'ufixed128x72', + 'ufixed128x80', + 'ufixed128x88', + 'ufixed128x96', + 'ufixed128x104', + 'ufixed128x112', + 'ufixed128x120', + 'ufixed128x128', + 'ufixed136x8', + 'ufixed136x16', + 'ufixed136x24', + 'ufixed136x32', + 'ufixed136x40', + 'ufixed136x48', + 'ufixed136x56', + 'ufixed136x64', + 'ufixed136x72', + 'ufixed136x80', + 'ufixed136x88', + 'ufixed136x96', + 'ufixed136x104', + 'ufixed136x112', + 'ufixed136x120', + 'ufixed144x8', + 'ufixed144x16', + 'ufixed144x24', + 'ufixed144x32', + 'ufixed144x40', + 'ufixed144x48', + 'ufixed144x56', + 'ufixed144x64', + 'ufixed144x72', + 'ufixed144x80', + 'ufixed144x88', + 'ufixed144x96', + 'ufixed144x104', + 'ufixed144x112', + 'ufixed152x8', + 'ufixed152x16', + 'ufixed152x24', + 'ufixed152x32', + 'ufixed152x40', + 'ufixed152x48', + 'ufixed152x56', + 'ufixed152x64', + 'ufixed152x72', + 'ufixed152x80', + 'ufixed152x88', + 'ufixed152x96', + 'ufixed152x104', + 'ufixed160x8', + 'ufixed160x16', + 'ufixed160x24', + 'ufixed160x32', + 'ufixed160x40', + 'ufixed160x48', + 'ufixed160x56', + 'ufixed160x64', + 'ufixed160x72', + 'ufixed160x80', + 'ufixed160x88', + 'ufixed160x96', + 'ufixed168x8', + 'ufixed168x16', + 'ufixed168x24', + 'ufixed168x32', + 'ufixed168x40', + 'ufixed168x48', + 'ufixed168x56', + 'ufixed168x64', + 'ufixed168x72', + 'ufixed168x80', + 'ufixed168x88', + 'ufixed176x8', + 'ufixed176x16', + 'ufixed176x24', + 'ufixed176x32', + 'ufixed176x40', + 'ufixed176x48', + 'ufixed176x56', + 'ufixed176x64', + 'ufixed176x72', + 'ufixed176x80', + 'ufixed184x8', + 'ufixed184x16', + 'ufixed184x24', + 'ufixed184x32', + 'ufixed184x40', + 'ufixed184x48', + 'ufixed184x56', + 'ufixed184x64', + 'ufixed184x72', + 'ufixed192x8', + 'ufixed192x16', + 'ufixed192x24', + 'ufixed192x32', + 'ufixed192x40', + 'ufixed192x48', + 'ufixed192x56', + 'ufixed192x64', + 'ufixed200x8', + 'ufixed200x16', + 'ufixed200x24', + 'ufixed200x32', + 'ufixed200x40', + 'ufixed200x48', + 'ufixed200x56', + 'ufixed208x8', + 'ufixed208x16', + 'ufixed208x24', + 'ufixed208x32', + 'ufixed208x40', + 'ufixed208x48', + 'ufixed216x8', + 'ufixed216x16', + 'ufixed216x24', + 'ufixed216x32', + 'ufixed216x40', + 'ufixed224x8', + 'ufixed224x16', + 'ufixed224x24', + 'ufixed224x32', + 'ufixed232x8', + 'ufixed232x16', + 'ufixed232x24', + 'ufixed240x8', + 'ufixed240x16', + 'ufixed248x8', + 'event', + 'enum', + 'let', + 'mapping', + 'private', + 'public', + 'external', + 'view', + 'pure', + 'inherited', + 'payable', + 'true', + 'false', + 'var', + 'import', + 'constant', + 'if', + 'else', + 'for', + 'else', + 'for', + 'while', + 'do', + 'break', + 'continue', + 'throw', + 'returns', + 'return', + 'suicide', + 'new', + 'is', + 'this', + 'super' + ], - operators: [ - '=', - '>', - '<', - '!', - '~', - '?', - ':', - '==', - '<=', - '>=', - '!=', - '&&', - '||', - '++', - '--', - '+', - '-', - '*', - '/', - '&', - '|', - '^', - '%', - '<<', - '>>', - '>>>', - '+=', - '-=', - '*=', - '/=', - '&=', - '|=', - '^=', - '%=', - '<<=', - '>>=', - '>>>=' - ], + operators: [ + '=', + '>', + '<', + '!', + '~', + '?', + ':', + '==', + '<=', + '>=', + '!=', + '&&', + '||', + '++', + '--', + '+', + '-', + '*', + '/', + '&', + '|', + '^', + '%', + '<<', + '>>', + '>>>', + '+=', + '-=', + '*=', + '/=', + '&=', + '|=', + '^=', + '%=', + '<<=', + '>>=', + '>>>=' + ], - // we include these common regular expressions - symbols: /[=>](?!@symbols)/, '@brackets'], - [ - /@symbols/, - { - cases: { - '@operators': 'delimiter', - '@default': '' - } - } - ], + // delimiters and operators + [/[{}()\[\]]/, '@brackets'], + [/[<>](?!@symbols)/, '@brackets'], + [ + /@symbols/, + { + cases: { + '@operators': 'delimiter', + '@default': '' + } + } + ], - // numbers - [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, 'number.float'], - [/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, 'number.float'], - [/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/, 'number.hex'], - [/0[0-7']*[0-7](@integersuffix)/, 'number.octal'], - [/0[bB][0-1']*[0-1](@integersuffix)/, 'number.binary'], - [/\d[\d']*\d(@integersuffix)/, 'number'], - [/\d(@integersuffix)/, 'number'], + // numbers + [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, 'number.float'], + [/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, 'number.float'], + [/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/, 'number.hex'], + [/0[0-7']*[0-7](@integersuffix)/, 'number.octal'], + [/0[bB][0-1']*[0-1](@integersuffix)/, 'number.binary'], + [/\d[\d']*\d(@integersuffix)/, 'number'], + [/\d(@integersuffix)/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], + // delimiter: after number because of .\d floats + [/[;,.]/, 'delimiter'], - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string - [/"/, 'string', '@string'], + // strings + [/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string + [/"/, 'string', '@string'], - // characters - [/'[^\\']'/, 'string'], - [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], - [/'/, 'string.invalid'] - ], + // characters + [/'[^\\']'/, 'string'], + [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], + [/'/, 'string.invalid'] + ], - whitespace: [ - [/[ \t\r\n]+/, ''], - [/\/\*\*(?!\/)/, 'comment.doc', '@doccomment'], - [/\/\*/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'] - ], + whitespace: [ + [/[ \t\r\n]+/, ''], + [/\/\*\*(?!\/)/, 'comment.doc', '@doccomment'], + [/\/\*/, 'comment', '@comment'], + [/\/\/.*$/, 'comment'] + ], - comment: [ - [/[^\/*]+/, 'comment'], - [/\*\//, 'comment', '@pop'], - [/[\/*]/, 'comment'] - ], - //Identical copy of comment above, except for the addition of .doc - doccomment: [ - [/[^\/*]+/, 'comment.doc'], - [/\*\//, 'comment.doc', '@pop'], - [/[\/*]/, 'comment.doc'] - ], + comment: [ + [/[^\/*]+/, 'comment'], + [/\*\//, 'comment', '@pop'], + [/[\/*]/, 'comment'] + ], + // Identical copy of comment above, except for the addition of .doc + doccomment: [ + [/[^\/*]+/, 'comment.doc'], + [/\*\//, 'comment.doc', '@pop'], + [/[\/*]/, 'comment.doc'] + ], - string: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, 'string', '@pop'] - ] - } -}; \ No newline at end of file + string: [ + [/[^\\"]+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/"/, 'string', '@pop'] + ] + } +} From 2027b429c78d550626171be3a411da7050b6fb0c Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Nov 2021 12:49:05 +0100 Subject: [PATCH 12/27] linting --- libs/remix-ui/editor/src/lib/remix-ui-editor.tsx | 4 ++-- libs/remix-ui/editor/src/lib/syntax.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx index 89e4a6eb9d..a9124bb866 100644 --- a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx +++ b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx @@ -1,7 +1,7 @@ import React, { useState, useRef, useEffect, useReducer } from 'react' // eslint-disable-line import Editor from '@monaco-editor/react' import { reducerActions, reducerListener, initialState } from './actions/editor' -import { language, conf } from './syntax' +import { language } from './syntax' import './remix-ui-editor.css' @@ -257,7 +257,7 @@ export const EditorUI = (props: EditorUIProps) => { function handleEditorWillMount (monaco) { monacoRef.current = monaco // Register a new language - monacoRef.current.languages.register({ id: 'remix-solidity' }); + monacoRef.current.languages.register({ id: 'remix-solidity' }) // Register a tokens provider for the language monacoRef.current.languages.setMonarchTokensProvider('remix-solidity', language) } diff --git a/libs/remix-ui/editor/src/lib/syntax.ts b/libs/remix-ui/editor/src/lib/syntax.ts index 623c57f3bc..ccc53716d6 100644 --- a/libs/remix-ui/editor/src/lib/syntax.ts +++ b/libs/remix-ui/editor/src/lib/syntax.ts @@ -1,3 +1,4 @@ +/* eslint-disable */ export const conf = { comments: { lineComment: '//', From f27360e9a5e9c07af3a0460c61270213a0bafb49 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Nov 2021 13:13:42 +0100 Subject: [PATCH 13/27] rollback circle ci --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5b5770fe29..acc9a0ffb8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,11 +76,11 @@ jobs: - run: npx nx build remix-ide --with-deps - run: name: Download Selenium - command: npm run selenium-install + command: ./node_modules/.bin/selenium-standalone install --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com - run: name: Start Selenium - command: npm run selenium - background: false + command: ./node_modules/.bin/selenium-standalone start --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com + background: true - run: ./apps/remix-ide/ci/browser_tests_chrome_1.sh - store_test_results: path: ./reports/tests @@ -110,11 +110,11 @@ jobs: - run: npx nx build remix-ide --with-deps - run: name: Download Selenium - command: npm run selenium-install + command: ./node_modules/.bin/selenium-standalone install --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com - run: name: Start Selenium - command: npm run selenium - background: false + command: ./node_modules/.bin/selenium-standalone start --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com + background: true - run: ./apps/remix-ide/ci/browser_tests_chrome_2.sh - store_test_results: path: ./reports/tests From ee7709fbe2adb985801f7b3fadd2ca0c04c95549 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Nov 2021 14:09:59 +0100 Subject: [PATCH 14/27] fix loading theme --- apps/remix-ide/src/app/tabs/theme-module.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/tabs/theme-module.js b/apps/remix-ide/src/app/tabs/theme-module.js index 118fd2d901..8558ad4da3 100644 --- a/apps/remix-ide/src/app/tabs/theme-module.js +++ b/apps/remix-ide/src/app/tabs/theme-module.js @@ -79,7 +79,7 @@ export class ThemeModule extends Plugin { throw new Error(`Theme ${themeName} doesn't exist`) } const next = themeName || this.active // Name - if (themeName === this.active) return + if (next === this.active) return _paq.push(['trackEvent', 'themeModule', 'switchTo', next]) const nextTheme = this.themes[next] // Theme if (!this.forced) this._deps.config.set('settings/theme', next) From ead31006ea12de9e01c6ff87459a31a5c60f3191 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 29 Oct 2021 13:10:35 +0200 Subject: [PATCH 15/27] fix logging to terminal --- apps/remix-ide/src/app/panels/terminal.js | 10 ---------- .../terminal/src/lib/remix-ui-terminal.tsx | 19 +++++++++++++++---- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/apps/remix-ide/src/app/panels/terminal.js b/apps/remix-ide/src/app/panels/terminal.js index 0f358b2611..096dcb1ba6 100644 --- a/apps/remix-ide/src/app/panels/terminal.js +++ b/apps/remix-ide/src/app/panels/terminal.js @@ -104,21 +104,11 @@ class Terminal extends Plugin { logHtml (html) { this.logHtmlResponse.push(html.innerText) this.renderComponent() - this.resetLogHtml() - } - - resetLogHtml () { - this.logHtmlResponse = [] } log (message) { this.logResponse.push(message) this.renderComponent() - this.resetLog() - } - - resetLog () { - this.logResponse = [] } render () { diff --git a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx index 8b729f07d4..e6a38e2058 100644 --- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx +++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx @@ -68,6 +68,11 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { commandHistoryIndex: 0 }) + const [logState, setLogState] = useState({ + logIndex: 0, + htmlLogIndex: 0 + }) + const [searchInput, setSearchInput] = useState('') const [showTableHash, setShowTableHash] = useState([]) @@ -84,12 +89,18 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { } useEffect(() => { - scriptRunnerDispatch({ type: 'html', payload: { message: logHtmlResponse } }) - }, [logHtmlResponse]) + if (logHtmlResponse.length > 0) { + scriptRunnerDispatch({ type: 'html', payload: { message: logHtmlResponse.slice(logState.htmlLogIndex) } }) + setLogState(prevState => ({ ...prevState, htmlLogIndex: logHtmlResponse.length })) + } + }, [logHtmlResponse.length]) useEffect(() => { - scriptRunnerDispatch({ type: 'log', payload: { message: logResponse } }) - }, [logResponse]) + if (logResponse.length > 0) { + scriptRunnerDispatch({ type: 'log', payload: { message: logResponse.slice(logState.logIndex) } }) + setLogState(prevState => ({ ...prevState, logIndex: logResponse.length })) + } + }, [logResponse.length]) // events useEffect(() => { From a09646188eddab60222685da6e6861b3d9b37164 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 29 Oct 2021 13:23:53 +0200 Subject: [PATCH 16/27] fix display logs amount in terminal --- libs/remix-ui/terminal/src/lib/components/Context.tsx | 2 +- .../terminal/src/lib/components/RenderKnownTransactions.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/terminal/src/lib/components/Context.tsx b/libs/remix-ui/terminal/src/lib/components/Context.tsx index a354c4cab4..b51d9385e6 100644 --- a/libs/remix-ui/terminal/src/lib/components/Context.tsx +++ b/libs/remix-ui/terminal/src/lib/components/Context.tsx @@ -12,7 +12,7 @@ const Context = ({ opts, blockchain }) => { const val = data.value let hash = data.hash ? helper.shortenHexData(data.hash) : '' const input = data.input ? helper.shortenHexData(data.input) : '' - const logs = data.logs && data.logs.decoded && data.logs.decoded.length ? data.logs.decoded.length : 0 + const logs = opts.logs && opts.logs.decoded && opts.logs.decoded.length ? opts.logs.decoded.length : 0 const block = data.receipt ? data.receipt.blockNumber : data.blockNumber || '' const i = data.receipt ? data.transactionIndex : data.transactionIndex const value = val ? typeConversion.toInt(val) : 0 diff --git a/libs/remix-ui/terminal/src/lib/components/RenderKnownTransactions.tsx b/libs/remix-ui/terminal/src/lib/components/RenderKnownTransactions.tsx index 79e1ba4c8a..c8508a676c 100644 --- a/libs/remix-ui/terminal/src/lib/components/RenderKnownTransactions.tsx +++ b/libs/remix-ui/terminal/src/lib/components/RenderKnownTransactions.tsx @@ -21,7 +21,7 @@ const RenderKnownTransactions = ({ tx, receipt, resolvedData, logs, index, plugi const from = tx.from const to = resolvedData.contractName + '.' + resolvedData.fn const txType = 'knownTx' - const options = { from, to, tx } + const options = { from, to, tx, logs } return (
txDetails(event, tx)}> From 07a15d0fac4d28c2aca99c83c7882293c977c4f1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 29 Oct 2021 14:00:35 +0200 Subject: [PATCH 17/27] fix linting --- libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx index e6a38e2058..7cfe4bd8b1 100644 --- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx +++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx @@ -92,7 +92,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { if (logHtmlResponse.length > 0) { scriptRunnerDispatch({ type: 'html', payload: { message: logHtmlResponse.slice(logState.htmlLogIndex) } }) setLogState(prevState => ({ ...prevState, htmlLogIndex: logHtmlResponse.length })) - } + } }, [logHtmlResponse.length]) useEffect(() => { From 7c94c7ed5f7ebe6c230dfc8fa99dc2d85efa966a Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 29 Oct 2021 16:47:29 +0200 Subject: [PATCH 18/27] make sure call hash are unique --- libs/remix-lib/src/execution/txRunnerVM.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libs/remix-lib/src/execution/txRunnerVM.ts b/libs/remix-lib/src/execution/txRunnerVM.ts index 901652da0d..428f377b39 100644 --- a/libs/remix-lib/src/execution/txRunnerVM.ts +++ b/libs/remix-lib/src/execution/txRunnerVM.ts @@ -15,6 +15,7 @@ export class TxRunnerVM { blocks logsManager commonContext + nextNonceForCall: number getVMObject: () => any constructor (vmaccounts, api, getVMObject) { @@ -31,6 +32,13 @@ export class TxRunnerVM { this.vmaccounts = vmaccounts this.queusTxs = [] this.blocks = [] + /* + txHash is generated using the nonce, + in order to have unique transaction hash, we need to keep using different nonce (in case of a call) + so we increment this value after each call. + For this to function we also need to skip nonce validation, in the vm: `{ skipNonce: true }` + */ + this.nextNonceForCall = 0 } execute (args, confirmationCb, gasEstimationForceSend, promptCb, callback) { @@ -75,7 +83,7 @@ export class TxRunnerVM { let tx if (!EIP1559) { tx = Transaction.fromTxData({ - nonce: new BN(res.nonce), + nonce: useCall ? this.nextNonceForCall : new BN(res.nonce), gasPrice: '0x1', gasLimit: gasLimit, to: to, @@ -84,7 +92,7 @@ export class TxRunnerVM { }, { common: this.commonContext }).sign(account.privateKey) } else { tx = FeeMarketEIP1559Transaction.fromTxData({ - nonce: new BN(res.nonce), + nonce: useCall ? this.nextNonceForCall : new BN(res.nonce), maxPriorityFeePerGas: '0x01', maxFeePerGas: '0x1', gasLimit: gasLimit, @@ -93,6 +101,7 @@ export class TxRunnerVM { data: Buffer.from(data.slice(2), 'hex') }).sign(account.privateKey) } + if (useCall) this.nextNonceForCall++ const coinbases = ['0x0e9281e9c6a0808672eaba6bd1220e144c9bb07a', '0x8945a1288dc78a6d8952a92c77aee6730b414778', '0x94d76e24f818426ae84aa404140e8d5f60e10e7e'] const difficulties = [new BN('69762765929000', 10), new BN('70762765929000', 10), new BN('71762765929000', 10)] @@ -127,7 +136,7 @@ export class TxRunnerVM { } runBlockInVm (tx, block, callback) { - this.getVMObject().vm.runBlock({ block: block, generate: true, skipBlockValidation: true, skipBalance: false }).then((results) => { + this.getVMObject().vm.runBlock({ block: block, generate: true, skipBlockValidation: true, skipBalance: false, skipNonce: true }).then((results) => { const result = results.results[0] if (result) { const status = result.execResult.exceptionError ? 0 : 1 From 503df540e5c479c99e4d9cbd2617b851b68d7056 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 29 Oct 2021 18:01:34 +0200 Subject: [PATCH 19/27] add e2e tests --- .../src/commands/journalChildIncludes.ts | 8 +- apps/remix-ide-e2e/src/tests/terminal.test.ts | 77 +++++++++++++++++++ 2 files changed, 83 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/journalChildIncludes.ts b/apps/remix-ide-e2e/src/commands/journalChildIncludes.ts index af9a061136..5f8e096cd7 100644 --- a/apps/remix-ide-e2e/src/commands/journalChildIncludes.ts +++ b/apps/remix-ide-e2e/src/commands/journalChildIncludes.ts @@ -8,7 +8,7 @@ class JournalChildIncludes extends EventEmitter { command (this: NightwatchBrowser, val: string): NightwatchBrowser { let isTextFound = false const browser = this.api - + let occurence = 0 this.api.elements('css selector', '*[data-id="terminalJournal"]', (res) => { Array.isArray(res.value) && res.value.forEach(function (jsonWebElement) { const jsonWebElementId = jsonWebElement.ELEMENT || jsonWebElement[Object.keys(jsonWebElement)[0]] @@ -16,12 +16,16 @@ class JournalChildIncludes extends EventEmitter { browser.elementIdText(jsonWebElementId, (jsonElement) => { const text = jsonElement.value - if (typeof text === 'string' && text.indexOf(val) !== -1) isTextFound = true + if (typeof text === 'string' && text.indexOf(val) !== -1) { + isTextFound = true + occurence++ + } }) }) }) browser.perform(() => { browser.assert.ok(isTextFound, isTextFound ? `<*[data-id="terminalJournal"]> contains ${val}.` : `${val} not found in <*[data-id="terminalJournal"]> div:last-child>`) + browser.assert.ok(occurence === 1, `${occurence} occurence found of "${val}"`) this.emit('complete') }) return this diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index 7e176b362a..d8e0c7f298 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -128,6 +128,25 @@ module.exports = { .waitForElementContainsText('*[data-id="terminalJournal"]', '0x5B38Da6a701c568545dCfcB03FcB875f56beddC4', 60000) // check that the script is logging the event .waitForElementContainsText('*[data-id="terminalJournal"]', 'newOwner', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '0xd9145CCE52D386f254917e481eB44e9943F39138', 60000) + }, + + 'Should print hardhat logs': function (browser: NightwatchBrowser) { + browser + .click('*[data-id="terminalClearConsole"]') // clear the terminal + .addFile('printHardhatlog.sol', { content: hardhatLog }) + .clickLaunchIcon('solidity') + .testContracts('printHardhatlog.sol', { content: hardhatLog }, ['OwnerTest']) + .clickLaunchIcon('udapp') + .createContract('OwnerSet') + .pause(1000) + .journalChildIncludes('constructor') + .click('*[data-id="terminalClearConsole"]') // clear the terminal + .clickFunction('changeOwner - transact (not payable)', { types: 'address newOwner', values: '0xd9145CCE52D386f254917e481eB44e9943F39138' }) + .pause(1000) + .journalChildIncludes('inside changeOwner') + .clickFunction('getOwner - call') + .pause(1000) + .journalChildIncludes('inside getOwner') .end() } } @@ -238,3 +257,61 @@ const deployWithEthersJs = ` console.log(e.message) } })()` + +const hardhatLog = ` +// SPDX-License-Identifier: GPL-3.0 + +pragma solidity >=0.7.0 <0.9.0; + +import "hardhat/console.sol"; + +/** + * @title Owner + * @dev Set & change owner + */ +contract OwnerTest { + + address private owner; + + // event for EVM logging + event OwnerSet(address indexed oldOwner, address indexed newOwner); + + // modifier to check if caller is owner + modifier isOwner() { + // If the first argument of 'require' evaluates to 'false', execution terminates and all + // changes to the state and to Ether balances are reverted. + // This used to consume all gas in old EVM versions, but not anymore. + // It is often a good idea to use 'require' to check if functions are called correctly. + // As a second argument, you can also provide an explanation about what went wrong. + require(msg.sender == owner, "Caller is not owner"); + _; + } + + /** + * @dev Set contract deployer as owner + */ + constructor() { + console.log("constructor"); + owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor + emit OwnerSet(address(0), owner); + } + + /** + * @dev Change owner + * @param newOwner address of new owner + */ + function changeOwner(address newOwner) public isOwner { + console.log("inside changeOwner"); + emit OwnerSet(owner, newOwner); + owner = newOwner; + } + + /** + * @dev Return owner address + * @return address of owner + */ + function getOwner() external view returns (address) { + console.log("inside getOwner"); + return owner; + } +}` From 88ad43cbb3424cab6cef1d3f4572d225e5ac9c74 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 1 Nov 2021 14:19:17 +0100 Subject: [PATCH 20/27] fix logging to terminal --- apps/remix-ide/src/app/panels/terminal.js | 12 ++++---- .../terminal/src/lib/remix-ui-terminal.tsx | 30 +++++++------------ .../terminal/src/lib/types/terminalTypes.ts | 3 +- package.json | 2 +- 4 files changed, 19 insertions(+), 28 deletions(-) diff --git a/apps/remix-ide/src/app/panels/terminal.js b/apps/remix-ide/src/app/panels/terminal.js index 096dcb1ba6..df0510b150 100644 --- a/apps/remix-ide/src/app/panels/terminal.js +++ b/apps/remix-ide/src/app/panels/terminal.js @@ -86,8 +86,6 @@ class Terminal extends Plugin { this.call('menuicons', 'select', 'debugger') this.call('debugger', 'debug', hash) }) - this.logHtmlResponse = [] - this.logResponse = [] } onActivation () { @@ -102,13 +100,11 @@ class Terminal extends Plugin { } logHtml (html) { - this.logHtmlResponse.push(html.innerText) - this.renderComponent() + this.terminalApi.logHtml(html) } log (message) { - this.logResponse.push(message) - this.renderComponent() + this.terminalApi.log(message) } render () { @@ -116,9 +112,11 @@ class Terminal extends Plugin { } renderComponent () { + const onReady = (api) => { this.terminalApi = api } ReactDOM.render( , this.element ) diff --git a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx index 7cfe4bd8b1..3c13ed625c 100644 --- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx +++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx @@ -24,7 +24,7 @@ export interface ClipboardEvent extends SyntheticEvent { } export const RemixUiTerminal = (props: RemixUiTerminalProps) => { - const { call, _deps, on, config, event, gistHandler, logHtmlResponse, logResponse, version } = props.plugin + const { call, _deps, on, config, event, gistHandler, version } = props.plugin const [toggleDownUp, setToggleDownUp] = useState('fa-angle-double-down') const [_cmdIndex, setCmdIndex] = useState(-1) const [_cmdTemp, setCmdTemp] = useState('') @@ -68,11 +68,6 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { commandHistoryIndex: 0 }) - const [logState, setLogState] = useState({ - logIndex: 0, - htmlLogIndex: 0 - }) - const [searchInput, setSearchInput] = useState('') const [showTableHash, setShowTableHash] = useState([]) @@ -89,18 +84,15 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { } useEffect(() => { - if (logHtmlResponse.length > 0) { - scriptRunnerDispatch({ type: 'html', payload: { message: logHtmlResponse.slice(logState.htmlLogIndex) } }) - setLogState(prevState => ({ ...prevState, htmlLogIndex: logHtmlResponse.length })) - } - }, [logHtmlResponse.length]) - - useEffect(() => { - if (logResponse.length > 0) { - scriptRunnerDispatch({ type: 'log', payload: { message: logResponse.slice(logState.logIndex) } }) - setLogState(prevState => ({ ...prevState, logIndex: logResponse.length })) - } - }, [logResponse.length]) + props.onReady({ + logHtml: (html) => { + scriptRunnerDispatch({ type: 'html', payload: { message: [html.innerText] } }) + }, + log: (message) => { + scriptRunnerDispatch({ type: 'log', payload: { message: [message] } }) + } + }) + }, []) // events useEffect(() => { @@ -126,7 +118,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { useEffect(() => { scrollToBottom() - }, [newstate.journalBlocks.length, logHtmlResponse.length, toaster]) + }, [newstate.journalBlocks.length, toaster]) function execute (file, cb) { function _execute (content, cb) { diff --git a/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts b/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts index 66eea4d655..7a77b11dab 100644 --- a/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts +++ b/libs/remix-ui/terminal/src/lib/types/terminalTypes.ts @@ -24,5 +24,6 @@ export const LISTEN_ON_NETWORK = 'listenOnNetWork' export const CMD_HISTORY = 'cmdHistory' export interface RemixUiTerminalProps { - plugin: any + plugin: any, + onReady: (api: any) => void } diff --git a/package.json b/package.json index 8faaf4c999..b4b82b7c5b 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "nightwatch_local_staticAnalysis": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/staticAnalysis.spec.js --env=chrome", "nightwatch_local_signingMessage": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/signingMessage.test.js --env=chrome", "nightwatch_local_specialFunctions": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/specialFunctions.test.js --env=chrome", - "nightwatch_local_solidityUnitTests": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.js --env=chrome", + "nightwatch_local_solidityUnitTests": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.js --env=firefox", "nightwatch_local_remixd": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/remixd.test.js --env=chrome", "nightwatch_local_terminal": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/terminal.test.js --env=chrome", "nightwatch_local_gist": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/gist.spec.js --env=chrome", From 39b44a4dea8918556b40a8f2fdc0f1a79faea330 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 2 Nov 2021 12:14:46 +0100 Subject: [PATCH 21/27] fix e2e --- apps/remix-ide-e2e/src/tests/terminal.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index d8e0c7f298..d374724aa7 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -4,7 +4,7 @@ import init from '../helpers/init' module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { - init(browser, done, 'http://127.0.0.1:8080?plugins=solidity,udapp', false) + init(browser, done, 'http://127.0.0.1:8080?plugins=solidity,udapp', true) }, 'Should execution a simple console command': function (browser: NightwatchBrowser) { @@ -137,10 +137,13 @@ module.exports = { .clickLaunchIcon('solidity') .testContracts('printHardhatlog.sol', { content: hardhatLog }, ['OwnerTest']) .clickLaunchIcon('udapp') - .createContract('OwnerSet') + .selectContract('OwnerTest') + .createContract('') .pause(1000) .journalChildIncludes('constructor') + .pause(5000) .click('*[data-id="terminalClearConsole"]') // clear the terminal + .clickInstance(0) .clickFunction('changeOwner - transact (not payable)', { types: 'address newOwner', values: '0xd9145CCE52D386f254917e481eB44e9943F39138' }) .pause(1000) .journalChildIncludes('inside changeOwner') From 7ddb95ed491497c0e724a74cdf6ebed3c6476ef1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 2 Nov 2021 13:00:52 +0100 Subject: [PATCH 22/27] add shouldHaveOnlyOneOccurence param in e2e test command --- apps/remix-ide-e2e/src/commands/journalChildIncludes.ts | 4 ++-- apps/remix-ide-e2e/src/tests/terminal.test.ts | 6 +++--- apps/remix-ide-e2e/src/types/index.d.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/journalChildIncludes.ts b/apps/remix-ide-e2e/src/commands/journalChildIncludes.ts index 5f8e096cd7..689be3bf34 100644 --- a/apps/remix-ide-e2e/src/commands/journalChildIncludes.ts +++ b/apps/remix-ide-e2e/src/commands/journalChildIncludes.ts @@ -5,7 +5,7 @@ import EventEmitter from 'events' Checks if any child elements of journal (console) contains a matching value. */ class JournalChildIncludes extends EventEmitter { - command (this: NightwatchBrowser, val: string): NightwatchBrowser { + command (this: NightwatchBrowser, val: string, opts = { shouldHaveOnlyOneOccurence: false }): NightwatchBrowser { let isTextFound = false const browser = this.api let occurence = 0 @@ -25,7 +25,7 @@ class JournalChildIncludes extends EventEmitter { }) browser.perform(() => { browser.assert.ok(isTextFound, isTextFound ? `<*[data-id="terminalJournal"]> contains ${val}.` : `${val} not found in <*[data-id="terminalJournal"]> div:last-child>`) - browser.assert.ok(occurence === 1, `${occurence} occurence found of "${val}"`) + if (opts.shouldHaveOnlyOneOccurence) browser.assert.ok(occurence === 1, `${occurence} occurence found of "${val}"`) this.emit('complete') }) return this diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index d374724aa7..b30bb5e8da 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -140,16 +140,16 @@ module.exports = { .selectContract('OwnerTest') .createContract('') .pause(1000) - .journalChildIncludes('constructor') + .journalChildIncludes('constructor', { shouldHaveOnlyOneOccurence: true }) .pause(5000) .click('*[data-id="terminalClearConsole"]') // clear the terminal .clickInstance(0) .clickFunction('changeOwner - transact (not payable)', { types: 'address newOwner', values: '0xd9145CCE52D386f254917e481eB44e9943F39138' }) .pause(1000) - .journalChildIncludes('inside changeOwner') + .journalChildIncludes('inside changeOwner', { shouldHaveOnlyOneOccurence: true }) .clickFunction('getOwner - call') .pause(1000) - .journalChildIncludes('inside getOwner') + .journalChildIncludes('inside getOwner', { shouldHaveOnlyOneOccurence: true }) .end() } } diff --git a/apps/remix-ide-e2e/src/types/index.d.ts b/apps/remix-ide-e2e/src/types/index.d.ts index 7033bf2057..f5f9287065 100644 --- a/apps/remix-ide-e2e/src/types/index.d.ts +++ b/apps/remix-ide-e2e/src/types/index.d.ts @@ -23,7 +23,7 @@ declare module 'nightwatch' { journalLastChildIncludes(val: string): NightwatchBrowser, executeScript(script: string): NightwatchBrowser, clearEditableContent(cssSelector: string): NightwatchBrowser, - journalChildIncludes(val: string): NightwatchBrowser, + journalChildIncludes(val: string, opts = { shouldHaveOnlyOneOccurence: boolean }): NightwatchBrowser, debugTransaction(index: number): NightwatchBrowser, checkElementStyle(cssSelector: string, styleProperty: string, expectedResult: string): NightwatchBrowser, openFile(name: string): NightwatchBrowser, From 92a68b6259f7f739594ec7c6877ef328de4898f0 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 2 Nov 2021 15:02:04 +0100 Subject: [PATCH 23/27] fix e2E --- apps/remix-ide-e2e/src/tests/terminal.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index b30bb5e8da..a936f4e182 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -4,7 +4,7 @@ import init from '../helpers/init' module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { - init(browser, done, 'http://127.0.0.1:8080?plugins=solidity,udapp', true) + init(browser, done, 'http://127.0.0.1:8080?plugins=solidity,udapp', false) }, 'Should execution a simple console command': function (browser: NightwatchBrowser) { @@ -135,6 +135,8 @@ module.exports = { .click('*[data-id="terminalClearConsole"]') // clear the terminal .addFile('printHardhatlog.sol', { content: hardhatLog }) .clickLaunchIcon('solidity') + .waitForElementVisible('[for="autoCompile"]') + .click('[for="autoCompile"]') .testContracts('printHardhatlog.sol', { content: hardhatLog }, ['OwnerTest']) .clickLaunchIcon('udapp') .selectContract('OwnerTest') From 13c023d48adec0b84b0d24a2a0595e6824c01b74 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Nov 2021 14:00:45 +0100 Subject: [PATCH 24/27] fix terminal tx details --- libs/remix-ui/terminal/src/lib/components/Table.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libs/remix-ui/terminal/src/lib/components/Table.tsx b/libs/remix-ui/terminal/src/lib/components/Table.tsx index 33e9cabf58..90b250fde4 100644 --- a/libs/remix-ui/terminal/src/lib/components/Table.tsx +++ b/libs/remix-ui/terminal/src/lib/components/Table.tsx @@ -37,12 +37,11 @@ const showTable = (opts, showTableHash) => { const val = opts.val != null ? typeConversion.toInt(opts.val) : 0 return ( - - + { opts.status !== undefined ? ( - - {opts.hash ? ( + ) : null } + {opts.hash && !opts.isCall ? (
status {`${opts.status} ${msg}`}
transaction hash {opts.hash} From b562107bd5d3081651abbdada45e787dce8cf8a1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Nov 2021 14:02:43 +0100 Subject: [PATCH 25/27] fix e2e --- apps/remix-ide-e2e/src/tests/terminal.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index a936f4e182..54bfae0cf7 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -139,6 +139,7 @@ module.exports = { .click('[for="autoCompile"]') .testContracts('printHardhatlog.sol', { content: hardhatLog }, ['OwnerTest']) .clickLaunchIcon('udapp') + .click('*[data-id="deployAndRunClearInstances"]') .selectContract('OwnerTest') .createContract('') .pause(1000) From 8c331e4c3f59df04daaa1f7c753efeabd36c590b Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Nov 2021 14:18:07 +0100 Subject: [PATCH 26/27] linting --- .../terminal/src/lib/components/Table.tsx | 287 ++++++++++++------ 1 file changed, 191 insertions(+), 96 deletions(-) diff --git a/libs/remix-ui/terminal/src/lib/components/Table.tsx b/libs/remix-ui/terminal/src/lib/components/Table.tsx index 90b250fde4..948b9b1e59 100644 --- a/libs/remix-ui/terminal/src/lib/components/Table.tsx +++ b/libs/remix-ui/terminal/src/lib/components/Table.tsx @@ -36,124 +36,219 @@ const showTable = (opts, showTableHash) => { } const val = opts.val != null ? typeConversion.toInt(opts.val) : 0 return ( - - { opts.status !== undefined ? ( - - - ) : null } - {opts.hash && !opts.isCall ? ( - - - ) : null } - { - opts.contractAddress ? ( - - - - - ) : null - } - { - opts.from ? ( - - - - - ) : null - } - { - opts.to ? ( - - - - - ) : null - } - { - opts.gas ? ( - - - - - ) : null - } - { - opts.transactionCost ? ( - - - - - ) : null - } - { - opts.executionCost ? ( - - - - - ) : null - } +
status{`${opts.status} ${msg}`}
transaction hash{opts.hash} - -
contract address{opts.contractAddress} - -
from{opts.from} - -
to{toHash} - -
gas{opts.gas} gas - -
transaction cost{opts.transactionCost} gas {callWarning} - -
execution cost{opts.executionCost} gas {callWarning} - -
+ + {opts.status !== undefined ? ( + + + + + ) : null} + {opts.hash && !opts.isCall ? ( + + + + + ) : null} + {opts.contractAddress ? ( + + + + + ) : null} + {opts.from ? ( + + + + + ) : null} + {opts.to ? ( + + + + + ) : null} + {opts.gas ? ( + + + + + ) : null} + {opts.transactionCost ? ( + + + + + ) : null} + {opts.executionCost ? ( + + + + + ) : null} {opts.hash ? ( - - - + + ) : null} {opts.input ? ( - - - + + ) : null} {opts['decoded input'] ? ( - - - + + ) : null} {opts['decoded output'] ? ( - - - + + ) : null} {opts.logs ? ( - - - + + ) : null} {opts.val ? ( - - - + + ) : null} From 261cd8a9b333a199b481543619388a65049216c5 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Nov 2021 14:59:26 +0100 Subject: [PATCH 27/27] rollback e2e browser type --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b4b82b7c5b..8faaf4c999 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "nightwatch_local_staticAnalysis": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/staticAnalysis.spec.js --env=chrome", "nightwatch_local_signingMessage": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/signingMessage.test.js --env=chrome", "nightwatch_local_specialFunctions": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/specialFunctions.test.js --env=chrome", - "nightwatch_local_solidityUnitTests": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.js --env=firefox", + "nightwatch_local_solidityUnitTests": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.js --env=chrome", "nightwatch_local_remixd": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/remixd.test.js --env=chrome", "nightwatch_local_terminal": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/terminal.test.js --env=chrome", "nightwatch_local_gist": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/gist.spec.js --env=chrome",
+ status + {`${opts.status} ${msg}`}
+ transaction hash + + {opts.hash} + +
+ contract address + + {opts.contractAddress} + +
+ from + + {opts.from} + +
+ to + + {toHash} + +
+ gas + + {opts.gas} gas + +
+ transaction cost + + {opts.transactionCost} gas {callWarning} + +
+ execution cost + + {opts.executionCost} gas {callWarning} + +
hash{opts.hash} - +
+ hash + + {opts.hash} +
input{helper.shortenHexData(opts.input)} - +
+ input + + {helper.shortenHexData(opts.input)} +
decoded input{opts['decoded input'].trim()} - +
+ decoded input + + {opts['decoded input'].trim()} +
decoded output{opts['decoded output']} - +
+ decoded output + + {opts['decoded output']} +
logs +
+ logs + {JSON.stringify(stringified, null, '\t')} - - + +
val{val} wei - +
+ val + + {val} wei +