From 5ad402fc417e8512e2c9c2bb98552bf1a2d02e31 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 21 Jul 2022 15:39:04 +0200 Subject: [PATCH 001/179] add test --- apps/remix-ide/src/app/panels/tab-proxy.js | 6 ++ .../src/app/plugins/file-decorator.ts | 60 +++++++++++ libs/remix-ui/file-decorators/.babelrc | 4 + libs/remix-ui/file-decorators/.eslintrc | 19 ++++ libs/remix-ui/file-decorators/src/index.ts | 3 + .../lib/components/file-decoration-icon.tsx | 51 ++++++++++ .../file-decoration-custom-icon.tsx | 13 +++ .../file-decoration-error-icon.tsx | 14 +++ .../file-decoration-tooltip.tsx | 33 +++++++ .../file-decoration-warning-icon.tsx | 11 +++ .../file-decorators/src/lib/helper/index.tsx | 11 +++ .../file-decorators/src/lib/types/index.ts | 29 ++++++ libs/remix-ui/file-decorators/tsconfig.json | 16 +++ .../file-decorators/tsconfig.lib.json | 13 +++ libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx | 99 +++++++++++++++---- libs/remix-ui/workspace/src/index.ts | 1 + .../workspace/src/lib/actions/events.ts | 12 ++- .../workspace/src/lib/actions/payload.ts | 7 ++ .../src/lib/components/file-explorer.tsx | 3 +- .../src/lib/components/file-label.tsx | 21 +++- .../src/lib/components/file-render.tsx | 18 +++- .../workspace/src/lib/reducers/workspace.ts | 31 ++++-- .../workspace/src/lib/remix-ui-workspace.tsx | 2 + .../remix-ui/workspace/src/lib/types/index.ts | 2 + 24 files changed, 444 insertions(+), 35 deletions(-) create mode 100644 apps/remix-ide/src/app/plugins/file-decorator.ts create mode 100644 libs/remix-ui/file-decorators/.babelrc create mode 100644 libs/remix-ui/file-decorators/.eslintrc create mode 100644 libs/remix-ui/file-decorators/src/index.ts create mode 100644 libs/remix-ui/file-decorators/src/lib/components/file-decoration-icon.tsx create mode 100644 libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-custom-icon.tsx create mode 100644 libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-error-icon.tsx create mode 100644 libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-tooltip.tsx create mode 100644 libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-warning-icon.tsx create mode 100644 libs/remix-ui/file-decorators/src/lib/helper/index.tsx create mode 100644 libs/remix-ui/file-decorators/src/lib/types/index.ts create mode 100644 libs/remix-ui/file-decorators/tsconfig.json create mode 100644 libs/remix-ui/file-decorators/tsconfig.lib.json diff --git a/apps/remix-ide/src/app/panels/tab-proxy.js b/apps/remix-ide/src/app/panels/tab-proxy.js index 82758c169f..3821788e18 100644 --- a/apps/remix-ide/src/app/panels/tab-proxy.js +++ b/apps/remix-ide/src/app/panels/tab-proxy.js @@ -169,6 +169,10 @@ export class TabProxy extends Plugin { this.on('manager', 'pluginDeactivated', (profile) => { this.removeTab(profile.name) }) + + this.on('fileDecorator', 'fileDecoratorsChanged', async (items) => { + this.tabsApi.setFileDecorations(items) + }) try { this.themeQuality = (await this.call('theme', 'currentTheme') ).quality @@ -306,6 +310,7 @@ export class TabProxy extends Plugin { updateComponent(state) { return { this.tabsApi = api } this.dispatch({ + plugin: this, loadedTabs: this.loadedTabs, onSelect, onClose, diff --git a/apps/remix-ide/src/app/plugins/file-decorator.ts b/apps/remix-ide/src/app/plugins/file-decorator.ts new file mode 100644 index 0000000000..60a14ef47f --- /dev/null +++ b/apps/remix-ide/src/app/plugins/file-decorator.ts @@ -0,0 +1,60 @@ +'use strict' + +import { default as deepequal } from 'deep-equal' // eslint-disable-line + +import { Plugin } from '@remixproject/engine' +import { fileDecoration } from '@remix-ui/file-decorators' + +const profile = { + name: 'fileDecorator', + desciption: 'Keeps decorators of the files', + methods: ['setFileDecorators', 'clearFileDecorators'], + events: ['fileDecoratorsChanged'], + version: '0.0.1' +} + +export class FileDecorator extends Plugin { + private _fileStates: fileDecoration[] = [] + constructor() { + super(profile) + } + /** + * + * @param fileStates Array of file states + */ + async setFileDecorators(fileStates: fileDecoration[] | fileDecoration) { + const workspace = await this.call('filePanel', 'getCurrentWorkspace') + function sortByPath( a: fileDecoration, b: fileDecoration ) { + if ( a.path < b.path ){ + return -1; + } + if ( a.path > b.path ){ + return 1; + } + return 0; + } + + const fileStatesPayload = Array.isArray(fileStates) ? fileStates : [fileStates] + // clear all file states in the previous state of this owner on the files called + fileStatesPayload.forEach((state) => { + state.workspace = workspace + }) + const filteredState = this._fileStates.filter((state) => { + const index = fileStatesPayload.findIndex((payloadFileState: fileDecoration) => { + return payloadFileState.owner == state.owner && payloadFileState.path == state.path + }) + return index == -1 + }) + const newState = [...filteredState, ...fileStatesPayload].sort(sortByPath) + + if (!deepequal(newState, this._fileStates)) { + this._fileStates = newState + this.emit('fileDecoratorsChanged', this._fileStates) + } + } + + async clearFileDecorators() { + this._fileStates = [] + this.emit('fileDecoratorsChanged', []) + } +} \ No newline at end of file diff --git a/libs/remix-ui/file-decorators/.babelrc b/libs/remix-ui/file-decorators/.babelrc new file mode 100644 index 0000000000..09d67939cc --- /dev/null +++ b/libs/remix-ui/file-decorators/.babelrc @@ -0,0 +1,4 @@ +{ + "presets": ["@nrwl/react/babel"], + "plugins": [] +} diff --git a/libs/remix-ui/file-decorators/.eslintrc b/libs/remix-ui/file-decorators/.eslintrc new file mode 100644 index 0000000000..0d43d424e3 --- /dev/null +++ b/libs/remix-ui/file-decorators/.eslintrc @@ -0,0 +1,19 @@ +{ + "env": { + "browser": true, + "es6": true + }, + "extends": "../../../.eslintrc.json", + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 11, + "sourceType": "module" + }, + "rules": { + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": "error" + } +} diff --git a/libs/remix-ui/file-decorators/src/index.ts b/libs/remix-ui/file-decorators/src/index.ts new file mode 100644 index 0000000000..a116c66cd3 --- /dev/null +++ b/libs/remix-ui/file-decorators/src/index.ts @@ -0,0 +1,3 @@ +export { fileDecoration, fileDecorationType, FileType } from './lib/types/index' +export { FileDecorationIcons } from './lib/components/file-decoration-icon' + diff --git a/libs/remix-ui/file-decorators/src/lib/components/file-decoration-icon.tsx b/libs/remix-ui/file-decorators/src/lib/components/file-decoration-icon.tsx new file mode 100644 index 0000000000..f05cea9f65 --- /dev/null +++ b/libs/remix-ui/file-decorators/src/lib/components/file-decoration-icon.tsx @@ -0,0 +1,51 @@ +// eslint-disable-next-line no-use-before-define +import React, { useEffect, useState } from 'react' + +import { fileDecoration, fileDecorationType, FileType } from '../types' +import FileDecorationCustomIcon from './filedecorationicons/file-decoration-custom-icon' +import FileDecorationErrorIcon from './filedecorationicons/file-decoration-error-icon' +import FileDecorationTooltip from './filedecorationicons/file-decoration-tooltip' +import FileDecorationWarningIcon from './filedecorationicons/file-decoration-warning-icon' + +export type fileDecorationProps = { + file: FileType, + fileDecorations: fileDecoration[] +} + +export const FileDecorationIcons = (props: fileDecorationProps) => { + const [states, setStates] = useState([]) + useEffect(() => { + //console.log(props.file) + //console.log(props.fileState) + setStates(props.fileDecorations.filter((fileDecoration) => fileDecoration.path === props.file.path || `${fileDecoration.workspace.name}/${fileDecoration.path}` === props.file.path)) + }, [props.fileDecorations]) + + + const getTags = function () { + if (states && states.length) { + const elements: JSX.Element[] = [] + + for (const [index, state] of states.entries()) { + switch (state.fileStateType) { + case fileDecorationType.Error: + elements.push(}/>) + break + case fileDecorationType.Warning: + elements.push(}/>) + break + case fileDecorationType.Custom: + elements.push(}/>) + break + } + } + + return elements + } + } + + return <> + {getTags()} + +} + +export default FileDecorationIcons \ No newline at end of file diff --git a/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-custom-icon.tsx b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-custom-icon.tsx new file mode 100644 index 0000000000..c157bc66c0 --- /dev/null +++ b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-custom-icon.tsx @@ -0,0 +1,13 @@ +// eslint-disable-next-line no-use-before-define +import React from 'react' +import { fileDecoration } from '../../types' + +const FileDecorationCustomIcon = (props: { + fileDecoration: fileDecoration +}) => { + return <> + {props.fileDecoration.fileStateIcon} + +} + +export default FileDecorationCustomIcon \ No newline at end of file diff --git a/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-error-icon.tsx b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-error-icon.tsx new file mode 100644 index 0000000000..2bb61fd97f --- /dev/null +++ b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-error-icon.tsx @@ -0,0 +1,14 @@ +// eslint-disable-next-line no-use-before-define +import React from 'react' + +import { fileDecoration } from '../../types' + +const FileDecorationErrorIcon = (props: { + fileDecoration: fileDecoration +}) => { + return <> + {props.fileDecoration.text} + +} + +export default FileDecorationErrorIcon \ No newline at end of file diff --git a/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-tooltip.tsx b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-tooltip.tsx new file mode 100644 index 0000000000..7c9149c14d --- /dev/null +++ b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-tooltip.tsx @@ -0,0 +1,33 @@ +import React from "react"; +import { OverlayTrigger, Tooltip } from "react-bootstrap"; +import { fileDecoration } from "../../types"; + +const FileDecorationTooltip = (props: { + fileDecoration: fileDecoration, + icon: JSX.Element + index: number +}, +) => { + const getComments = function (fileDecoration: fileDecoration) { + if (fileDecoration.commment) { + const commments = Array.isArray(fileDecoration.commment) ? fileDecoration.commment : [fileDecoration.commment] + return commments.map((comment, index) => { + return
{comment}

+ }) + } + } + + return + <>{getComments(props.fileDecoration)} + + } + >
{props.icon}
+ +} + + +export default FileDecorationTooltip; \ No newline at end of file diff --git a/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-warning-icon.tsx b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-warning-icon.tsx new file mode 100644 index 0000000000..1c027c9854 --- /dev/null +++ b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-warning-icon.tsx @@ -0,0 +1,11 @@ +// eslint-disable-next-line no-use-before-define +import React from 'react' +import { fileDecoration } from '../../types' + +const FileDecorationWarningIcon = (props: { + fileDecoration: fileDecoration +}) => { + return <>{props.fileDecoration.text} +} + +export default FileDecorationWarningIcon \ No newline at end of file diff --git a/libs/remix-ui/file-decorators/src/lib/helper/index.tsx b/libs/remix-ui/file-decorators/src/lib/helper/index.tsx new file mode 100644 index 0000000000..1afe91b0cf --- /dev/null +++ b/libs/remix-ui/file-decorators/src/lib/helper/index.tsx @@ -0,0 +1,11 @@ +import React from "react" +import { fileDecoration } from "../types" + +export const getComments = function (fileDecoration: fileDecoration) { + if(fileDecoration.commment){ + const commments = Array.isArray(fileDecoration.commment) ? fileDecoration.commment : [fileDecoration.commment] + return commments.map((comment, index) => { + return
{comment}

+ }) + } +} \ No newline at end of file diff --git a/libs/remix-ui/file-decorators/src/lib/types/index.ts b/libs/remix-ui/file-decorators/src/lib/types/index.ts new file mode 100644 index 0000000000..35178721e0 --- /dev/null +++ b/libs/remix-ui/file-decorators/src/lib/types/index.ts @@ -0,0 +1,29 @@ +export enum fileDecorationType { + Error = 'ERROR', + Warning = 'WARNING', + Custom = 'CUSTOM', + None = 'NONE' + } + + export type fileDecoration = { + path: string, + isDirectory: boolean, + fileStateType: fileDecorationType, + fileStateLabelClass: string, + fileStateIconClass: string, + fileStateIcon: string | HTMLDivElement | JSX.Element, + bubble: boolean, + text?: string, + owner: string, + workspace?: any + tooltip?: string + commment?: string[] | string + } + + export interface FileType { + path: string, + name?: string, + isDirectory?: boolean, + type?: 'folder' | 'file' | 'gist', + child?: File[] + } \ No newline at end of file diff --git a/libs/remix-ui/file-decorators/tsconfig.json b/libs/remix-ui/file-decorators/tsconfig.json new file mode 100644 index 0000000000..d52e31ad74 --- /dev/null +++ b/libs/remix-ui/file-decorators/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "jsx": "react", + "allowJs": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + } + ] +} diff --git a/libs/remix-ui/file-decorators/tsconfig.lib.json b/libs/remix-ui/file-decorators/tsconfig.lib.json new file mode 100644 index 0000000000..b560bc4dec --- /dev/null +++ b/libs/remix-ui/file-decorators/tsconfig.lib.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "types": ["node"] + }, + "files": [ + "../../../node_modules/@nrwl/react/typings/cssmodule.d.ts", + "../../../node_modules/@nrwl/react/typings/image.d.ts" + ], + "exclude": ["**/*.spec.ts", "**/*.spec.tsx"], + "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] +} 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 499d0d1eb1..67c7224c96 100644 --- a/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx +++ b/libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx @@ -1,25 +1,63 @@ + +import { fileDecoration, FileDecorationIcons } from '@remix-ui/file-decorators' +import { Plugin } from '@remixproject/engine' + import React, { useState, useRef, useEffect, useReducer } from 'react' // eslint-disable-line import { Tab, Tabs, TabList, TabPanel } from 'react-tabs' import './remix-ui-tabs.css' /* eslint-disable-next-line */ export interface TabsUIProps { - tabs: Array - onSelect: (index: number) => void - onClose: (index: number) => void - onZoomOut: () => void - onZoomIn: () => void - onReady: (api: any) => void - themeQuality: string + tabs: Array + plugin: Plugin, + onSelect: (index: number) => void + onClose: (index: number) => void + onZoomOut: () => void + onZoomIn: () => void + onReady: (api: any) => void + themeQuality: string } export interface TabsUIApi { - activateTab: (namee: string) => void - active: () => string + activateTab: (namee: string) => void + active: () => string +} + +interface ITabsState { + selectedIndex: number, + fileDecorations: fileDecoration[], +} + +interface ITabsAction { + type: string, + payload: any, +} + + +const initialTabsState: ITabsState = { + selectedIndex: -1, + fileDecorations: [], +} + +const tabsReducer = (state: ITabsState, action: ITabsAction) => { + switch (action.type) { + case 'SELECT_INDEX': + return { + ...state, + selectedIndex: action.payload, + } + case 'SET_FILE_DECORATIONS': + return { + ...state, + fileDecorations: action.payload as fileDecoration[], + } + default: + return state + } } export const TabsUI = (props: TabsUIProps) => { - const [selectedIndex, setSelectedIndex] = useState(-1) + const [tabsState, dispatch] = useReducer(tabsReducer, initialTabsState); const currentIndexRef = useRef(-1) const tabsRef = useRef({}) const tabsElement = useRef(null) @@ -28,10 +66,24 @@ export const TabsUI = (props: TabsUIProps) => { tabs.current = props.tabs // we do this to pass the tabs list to the onReady callbacks useEffect(() => { - if (props.tabs[selectedIndex]) { - tabsRef.current[selectedIndex].scrollIntoView({ behavior: 'smooth', block: 'center' }) + if (props.tabs[tabsState.selectedIndex]) { + tabsRef.current[tabsState.selectedIndex].scrollIntoView({ behavior: 'smooth', block: 'center' }) } - }, [selectedIndex]) + }, [tabsState.selectedIndex]) + + + + const getFileDecorationClasses = (tab: any) => { + const fileDecoration = tabsState.fileDecorations.find((fileDecoration: fileDecoration) => { + if(`${fileDecoration.workspace.name}/${fileDecoration.path}` === tab.name) return true + }) + return fileDecoration && fileDecoration.fileStateLabelClass + } + + const getFileDecorationIcons = (tab: any) => { + return + } + const renderTab = (tab, index) => { const classNameImg = 'my-1 mr-1 text-dark ' + tab.iconClass @@ -40,8 +92,9 @@ export const TabsUI = (props: TabsUIProps) => { return (
{ tabsRef.current[index] = el }} className={classNameTab} data-id={index === currentIndexRef.current ? 'tab-active' : ''} title={tab.tooltip}> - {tab.icon ? () : ()} - {tab.title} + {tab.icon ? () : ()} + {tab.title} + {getFileDecorationIcons(tab)} { props.onClose(index); event.stopPropagation() }}> @@ -56,7 +109,11 @@ export const TabsUI = (props: TabsUIProps) => { const activateTab = (name: string) => { const index = tabs.current.findIndex((tab) => tab.name === name) currentIndexRef.current = index - setSelectedIndex(index) + dispatch({ type: 'SELECT_INDEX', payload: index }) + } + + const setFileDecorations = (fileStates: fileDecoration[]) => { + dispatch({ type: 'SET_FILE_DECORATIONS', payload: fileStates }) } const transformScroll = (event) => { @@ -71,21 +128,23 @@ export const TabsUI = (props: TabsUIProps) => { useEffect(() => { props.onReady({ activateTab, - active + active, + setFileDecorations }) + return () => { tabsElement.current.removeEventListener('wheel', transformScroll) } }, []) return (
-
+
props.onZoomOut()}> props.onZoomIn()}>
{ if (tabsElement.current) return tabsElement.current = domEl @@ -94,7 +153,7 @@ export const TabsUI = (props: TabsUIProps) => { onSelect={(index) => { props.onSelect(index) currentIndexRef.current = index - setSelectedIndex(index) + dispatch({ type: 'SELECT_INDEX', payload: index }) }} > diff --git a/libs/remix-ui/workspace/src/index.ts b/libs/remix-ui/workspace/src/index.ts index 166467d115..c9e5b5355b 100644 --- a/libs/remix-ui/workspace/src/index.ts +++ b/libs/remix-ui/workspace/src/index.ts @@ -1,2 +1,3 @@ export * from './lib/providers/FileSystemProvider' export * from './lib/contexts' +export { FileType } from './lib/types/index' \ No newline at end of file diff --git a/libs/remix-ui/workspace/src/lib/actions/events.ts b/libs/remix-ui/workspace/src/lib/actions/events.ts index a8bde65fd5..62092df30f 100644 --- a/libs/remix-ui/workspace/src/lib/actions/events.ts +++ b/libs/remix-ui/workspace/src/lib/actions/events.ts @@ -1,7 +1,8 @@ +import { fileDecoration } from '@remix-ui/file-decorators' import { extractParentFromKey } from '@remix-ui/helper' import React from 'react' import { action, WorkspaceTemplate } from '../types' -import { displayNotification, displayPopUp, fileAddedSuccess, fileRemovedSuccess, fileRenamedSuccess, folderAddedSuccess, loadLocalhostError, loadLocalhostRequest, loadLocalhostSuccess, removeContextMenuItem, removeFocus, rootFolderChangedSuccess, setContextMenuItem, setMode, setReadOnlyMode } from './payload' +import { displayNotification, displayPopUp, fileAddedSuccess, fileRemovedSuccess, fileRenamedSuccess, folderAddedSuccess, loadLocalhostError, loadLocalhostRequest, loadLocalhostSuccess, removeContextMenuItem, removeFocus, rootFolderChangedSuccess, setContextMenuItem, setMode, setReadOnlyMode, setFileDecorationSuccess } from './payload' import { addInputField, createWorkspace, deleteWorkspace, fetchWorkspaceDirectory, renameWorkspace, switchToWorkspace, uploadFile } from './workspace' const LOCALHOST = ' - connect to localhost - ' @@ -38,6 +39,10 @@ export const listenOnPluginEvents = (filePanelPlugin) => { uploadFile(target, dir, cb) }) + plugin.on('fileDecorator', 'fileDecoratorsChanged', async (items: fileDecoration[]) => { + setFileDecorators(items) + }) + plugin.on('remixd', 'rootFolderChanged', async (path: string) => { rootFolderChanged(path) }) @@ -202,3 +207,8 @@ const fileRenamed = async (oldPath: string) => { const rootFolderChanged = async (path) => { await dispatch(rootFolderChangedSuccess(path)) } + +const setFileDecorators = async (items: fileDecoration[], cb?: (err: Error, result?: string | number | boolean | Record) => void) => { + await dispatch(setFileDecorationSuccess(items)) + cb && cb(null, true) +} diff --git a/libs/remix-ui/workspace/src/lib/actions/payload.ts b/libs/remix-ui/workspace/src/lib/actions/payload.ts index b663f60cfe..8c3fb8fc18 100644 --- a/libs/remix-ui/workspace/src/lib/actions/payload.ts +++ b/libs/remix-ui/workspace/src/lib/actions/payload.ts @@ -1,3 +1,4 @@ +import { fileDecoration } from '@remix-ui/file-decorators' import { action } from '../types' export const setCurrentWorkspace = (workspace: { name: string; isGitRepo: boolean; }) => { @@ -240,6 +241,12 @@ export const fsInitializationCompleted = () => { } } +export const setFileDecorationSuccess = (items: fileDecoration[]) => { + return { + type: 'SET_FILE_DECORATION_SUCCESS', + payload: items + } +} export const cloneRepositoryRequest = () => { return { type: 'CLONE_REPOSITORY_REQUEST' diff --git a/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx b/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx index a0351ea3a1..3ccefdb2db 100644 --- a/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx +++ b/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx @@ -12,7 +12,7 @@ import { checkSpecialChars, extractNameFromKey, extractParentFromKey, joinPath } import { FileRender } from './file-render' export const FileExplorer = (props: FileExplorerProps) => { - const { name, contextMenuItems, removedContextMenuItems, files } = props + const { name, contextMenuItems, removedContextMenuItems, files, fileState } = props const [state, setState] = useState({ ctrlKey: false, newFileName: '', @@ -432,6 +432,7 @@ export const FileExplorer = (props: FileExplorerProps) => { { files[props.name] && Object.keys(files[props.name]).map((key, index) => void } export const FileLabel = (props: FileLabelProps) => { - const { file, focusEdit, editModeOff } = props + const { file, focusEdit, editModeOff, fileDecorations } = props const [isEditable, setIsEditable] = useState(false) + const [fileStateClasses, setFileStateClasses] = useState('') const labelRef = useRef(null) useEffect(() => { @@ -24,6 +27,18 @@ export const FileLabel = (props: FileLabelProps) => { } }, [file.path, focusEdit]) + useEffect(() => { + const state = props.fileDecorations.find((state: fileDecoration) => { + if(state.path === props.file.path) return true + if(state.bubble && props.file.isDirectory && state.path.startsWith(props.file.path)) return true + }) + if (state && state.fileStateLabelClass) { + setFileStateClasses(state.fileStateLabelClass) + } else{ + setFileStateClasses('') + } + }, [fileDecorations]) + useEffect(() => { if (labelRef.current) { setTimeout(() => { @@ -57,10 +72,10 @@ export const FileLabel = (props: FileLabelProps) => { > - { file.name } + {file.name}
) diff --git a/libs/remix-ui/workspace/src/lib/components/file-render.tsx b/libs/remix-ui/workspace/src/lib/components/file-render.tsx index ac0054e96b..164689899b 100644 --- a/libs/remix-ui/workspace/src/lib/components/file-render.tsx +++ b/libs/remix-ui/workspace/src/lib/components/file-render.tsx @@ -6,6 +6,11 @@ import { TreeView, TreeViewItem } from '@remix-ui/tree-view' import { getPathIcon } from '@remix-ui/helper' // eslint-disable-next-line @typescript-eslint/no-unused-vars import { FileLabel } from './file-label' +import { fileDecoration, FileDecorationIcons } from '@remix-ui/file-decorators' + + + + export interface RenderFileProps { file: FileType, @@ -19,6 +24,7 @@ export interface RenderFileProps { handleClickFolder: (path: string, type: string) => void, handleClickFile: (path: string, type: string) => void, handleContextMenu: (pageX: number, pageY: number, path: string, content: string, type: string) => void + fileDecorations: fileDecoration[] } export const FileRender = (props: RenderFileProps) => { @@ -76,7 +82,7 @@ export const FileRender = (props: RenderFileProps) => { iconX='pr-3 fa fa-folder' iconY='pr-3 fa fa-folder-open' key={`${file.path + props.index}`} - label={} + label={} onClick={handleFolderClick} onContextMenu={handleContextMenu} labelClass={labelClass} @@ -89,6 +95,7 @@ export const FileRender = (props: RenderFileProps) => { file.child ? { Object.keys(file.child).map((key, index) => { } + label={ + <> +
+ + +
+ + } onClick={handleFileClick} onContextMenu={handleContextMenu} icon={icon} diff --git a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts index 39f56a202f..0a774e6b03 100644 --- a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts @@ -1,9 +1,10 @@ import { extractNameFromKey } from '@remix-ui/helper' import { action, FileType } from '../types' import * as _ from 'lodash' +import { fileDecoration } from '@remix-ui/file-decorators' interface Action { - type: string - payload: any + type: string + payload: any } export interface BrowserState { browser: { @@ -25,7 +26,8 @@ export interface BrowserState { registeredMenuItems: action[], removedMenuItems: action[], error: string - } + }, + fileState: fileDecoration[] }, localhost: { sharedFolder: string, @@ -40,7 +42,8 @@ export interface BrowserState { registeredMenuItems: action[], removedMenuItems: action[], error: string - } + }, + fileState: [] }, mode: 'browser' | 'localhost', notification: { @@ -75,7 +78,8 @@ export const browserInitialState: BrowserState = { registeredMenuItems: [], removedMenuItems: [], error: null - } + }, + fileState: [] }, localhost: { sharedFolder: '', @@ -90,14 +94,15 @@ export const browserInitialState: BrowserState = { registeredMenuItems: [], removedMenuItems: [], error: null - } + }, + fileState: [] }, mode: 'browser', notification: { title: '', message: '', - actionOk: () => {}, - actionCancel: () => {}, + actionOk: () => { }, + actionCancel: () => { }, labelOk: '', labelCancel: '' }, @@ -650,6 +655,16 @@ export const browserReducer = (state = browserInitialState, action: Action) => { } } + case 'SET_FILE_DECORATION_SUCCESS': { + return { + ...state, + browser: { + ...state.browser, + fileState: action.payload + } + } + } + default: throw new Error() } diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index e25811df68..353e4ccf91 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -307,6 +307,7 @@ export function Workspace () { contextMenuItems={global.fs.browser.contextMenu.registeredMenuItems} removedContextMenuItems={global.fs.browser.contextMenu.removedMenuItems} files={global.fs.browser.files} + fileState={global.fs.browser.fileState} expandPath={global.fs.browser.expandPath} focusEdit={global.fs.focusEdit} focusElement={global.fs.focusElement} @@ -343,6 +344,7 @@ export function Workspace () { contextMenuItems={global.fs.localhost.contextMenu.registeredMenuItems} removedContextMenuItems={global.fs.localhost.contextMenu.removedMenuItems} files={global.fs.localhost.files} + fileState={[]} expandPath={global.fs.localhost.expandPath} focusEdit={global.fs.focusEdit} focusElement={global.fs.focusElement} diff --git a/libs/remix-ui/workspace/src/lib/types/index.ts b/libs/remix-ui/workspace/src/lib/types/index.ts index fb169db5e8..93b6d9f8c9 100644 --- a/libs/remix-ui/workspace/src/lib/types/index.ts +++ b/libs/remix-ui/workspace/src/lib/types/index.ts @@ -1,5 +1,6 @@ import React from 'react' import { customAction } from '@remixproject/plugin-api/lib/file-system/file-panel' +import { fileDecoration } from '@remix-ui/file-decorators'; export type action = { name: string, type?: Array<'folder' | 'gist' | 'file'>, path?: string[], extension?: string[], pattern?: string[], id: string, multiselect: boolean, label: string, sticky?: boolean } export interface JSONStandardInput { @@ -73,6 +74,7 @@ export interface FileExplorerProps { contextMenuItems: MenuItems, removedContextMenuItems: MenuItems, files: { [x: string]: Record }, + fileState: fileDecoration[], expandPath: string[], focusEdit: string, focusElement: { key: string, type: 'file' | 'folder' | 'gist' }[], From 4abdb51b6c9123f918da95590d7b2db2335f50e9 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 21 Jul 2022 15:39:15 +0200 Subject: [PATCH 002/179] add test --- .../src/tests/editorAutoComplete.test.ts | 518 ++++++++++++++++++ 1 file changed, 518 insertions(+) create mode 100644 apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts diff --git a/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts b/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts new file mode 100644 index 0000000000..8dc7bd4440 --- /dev/null +++ b/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts @@ -0,0 +1,518 @@ +'use strict' +import { NightwatchBrowser } from 'nightwatch' +import init from '../helpers/init' +import examples from '../examples/editor-test-contracts' + +const autoCompleteLineElement = (name: string) => { + return `//*[@class='editor-widget suggest-widget visible']//*[@class='contents' and contains(.,'${name}')]` +} + +module.exports = { + '@disabled': true, + before: function (browser: NightwatchBrowser, done: VoidFunction) { + init(browser, done, 'http://127.0.0.1:8080', false) + }, + 'Should add test and base files #group2': function (browser: NightwatchBrowser) { + browser.addFile(examples.testContract.name, examples.testContract) + .addFile(examples.baseContract.name, examples.baseContract) + .addFile(examples.import1Contract.name, examples.import1Contract) + .addFile(examples.baseOfBaseContract.name, examples.baseOfBaseContract) + .addFile(examples.secondimport.name, examples.secondimport) + .addFile(examples.importbase.name, examples.importbase) + .openFile(examples.testContract.name) + }, + 'Should put cursor in the () of the function #group2': function (browser: NightwatchBrowser) { + browser.scrollToLine(36) + const path = "//*[@class='view-line' and contains(.,'myprivatefunction') and contains(.,'private')]//span//span[contains(.,'(')]" + browser.waitForElementVisible('#editorView') + .useXpath() + .click(path).pause(1000) + }, + 'Should complete variable declaration types in a function definition #group2': function (browser: NightwatchBrowser) { + browser + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('uint25') + }) + .waitForElementPresent(autoCompleteLineElement('uint256')) + .click(autoCompleteLineElement('uint256')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' abc') + .sendKeys(this.Keys.ENTER) // we need to split lines for FF texts to pass because the screen is too narrow + .sendKeys(', testb') + }) + .waitForElementPresent(autoCompleteLineElement('"TestBookDefinition"')) + .click(autoCompleteLineElement('"TestBookDefinition"')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' memo') + }) + .waitForElementPresent(autoCompleteLineElement('memory')) + .click(autoCompleteLineElement('memory')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' btextbook') + .sendKeys(this.Keys.ENTER) + .sendKeys(', BaseB') + }) + .waitForElementPresent(autoCompleteLineElement('"BaseBook"')) + .click(autoCompleteLineElement('"BaseBook"')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' stor') + }) + .waitForElementPresent(autoCompleteLineElement('storage')) + .click(autoCompleteLineElement('storage')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' localbbook') + }).pause(3000) + }, + 'Should put cursor at the end of function #group2': function (browser: NightwatchBrowser) { + + const path = "//*[@class='view-line' and contains(.,'localbbook') and contains(.,'private')]//span//span[contains(.,'{')]" + browser + .useXpath() + .click(path).pause(1000) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + // right arrow key + sendKeys(this.Keys.ARROW_RIGHT). + sendKeys(this.Keys.ARROW_RIGHT) + }) + }, + 'Should autcomplete address types': function (browser: NightwatchBrowser) { + browser + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('addre') + }) + .waitForElementPresent(autoCompleteLineElement('address')) + .click(autoCompleteLineElement('address')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' someaddress;') + .sendKeys(this.Keys.ENTER) + }).pause(2000) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('someaddress.') + }) + .waitForElementVisible(autoCompleteLineElement('balance')) + .waitForElementVisible(autoCompleteLineElement('send')) + .waitForElementVisible(autoCompleteLineElement('transfer')) + .waitForElementVisible(autoCompleteLineElement('code')) + .click(autoCompleteLineElement('balance')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys(this.Keys.ENTER) + }) + }, + 'Should autcomplete array types': function (browser: NightwatchBrowser) { + browser + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('uin') + }) + .waitForElementPresent(autoCompleteLineElement('uint')) + .click(autoCompleteLineElement('uint')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('[] mem') + }) + .waitForElementVisible(autoCompleteLineElement('memory')) + .click(autoCompleteLineElement('memory')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' somearray;') + } + ).pause(2000) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys(this.Keys.ENTER) + .sendKeys('somearray.') + }) + .waitForElementVisible(autoCompleteLineElement('push')) + .waitForElementVisible(autoCompleteLineElement('pop')) + .waitForElementVisible(autoCompleteLineElement('length')) + .click(autoCompleteLineElement('length')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys(this.Keys.ENTER) + }) + }, + 'Should see and autocomplete second import because it was imported by the first import #group2': function (browser: NightwatchBrowser) { + browser + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('secondi') + }) + .waitForElementPresent(autoCompleteLineElement('secondimport')) + .click(autoCompleteLineElement('secondimport')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' sec;') + .sendKeys(this.Keys.ENTER) + }).pause(3000) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('sec.') + }) + .waitForElementVisible(autoCompleteLineElement('secondimportstring')) + .click(autoCompleteLineElement('secondimportstring')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + }) + + }, + 'Should see and autocomplete imported local class #group2': function (browser: NightwatchBrowser) { + browser + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('import') + }) + .waitForElementPresent(autoCompleteLineElement('importedcontract')) + .click(autoCompleteLineElement('importedcontract')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('.') + }) + .waitForElementVisible(autoCompleteLineElement('externalimport')) + .waitForElementVisible(autoCompleteLineElement('importbasestring')) + .waitForElementVisible(autoCompleteLineElement('importedbook')) + .waitForElementVisible(autoCompleteLineElement('importpublicstring')) + .waitForElementVisible(autoCompleteLineElement('publicimport')) + // no private + .waitForElementNotPresent(autoCompleteLineElement('importprivatestring')) + .waitForElementNotPresent(autoCompleteLineElement('privateimport')) + // no internal + .waitForElementNotPresent(autoCompleteLineElement('importinternalstring')) + .waitForElementNotPresent(autoCompleteLineElement('internalimport')) + .click(autoCompleteLineElement('importbasestring')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + }) + + }, + 'Should autocomplete derived and local event when not using this. #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('emit base') + }) + .waitForElementVisible(autoCompleteLineElement('BaseEvent')) + .click(autoCompleteLineElement('BaseEvent')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys('msg.sender') + .sendKeys(this.Keys.TAB) + .sendKeys(this.Keys.TAB) // somehow this is needed to get the cursor to the next parameter, only for selenium + .sendKeys('3232') + .sendKeys(this.Keys.TAB) + .sendKeys(this.Keys.ENTER) + }) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('emit MyEv') + }) + .waitForElementVisible(autoCompleteLineElement('MyEvent')) + .click(autoCompleteLineElement('MyEvent')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys('3232') + .sendKeys(this.Keys.TAB) + .sendKeys(this.Keys.ENTER) + }) + }, + + 'Should type and get msg options #group2': function (browser: NightwatchBrowser) { + browser. + perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER). + sendKeys('msg.') + }) + .waitForElementVisible(autoCompleteLineElement('sender')) + .waitForElementVisible(autoCompleteLineElement('data')) + .waitForElementVisible(autoCompleteLineElement('value')) + .waitForElementVisible(autoCompleteLineElement('gas')) + .waitForElementVisible(autoCompleteLineElement('sig')) + .click(autoCompleteLineElement('sender')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('.') + }) + .waitForElementVisible(autoCompleteLineElement('balance')) + .waitForElementVisible(autoCompleteLineElement('code')) + .waitForElementVisible(autoCompleteLineElement('codehash')) + .waitForElementVisible(autoCompleteLineElement('send')) + .waitForElementVisible(autoCompleteLineElement('transfer')) + .click(autoCompleteLineElement('balance')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER) + }) + }, + 'Should bo and get book #group2': function (browser: NightwatchBrowser) { + browser. + perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER). + sendKeys('bo') + }) + .waitForElementVisible(autoCompleteLineElement('book')) + .click(autoCompleteLineElement('book')) + }, + 'Should autcomplete derived struct #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('.') + }) + .waitForElementVisible(autoCompleteLineElement('author')) + .waitForElementVisible(autoCompleteLineElement('book_id')) + .waitForElementVisible(autoCompleteLineElement('title')) + .click(autoCompleteLineElement('title')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + }) + }, + 'Should bo and get basebook #group2': function (browser: NightwatchBrowser) { + browser. + perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER). + sendKeys('base') + }) + .waitForElementVisible(autoCompleteLineElement('basebook')) + .click(autoCompleteLineElement('basebook')) + }, + 'Should autcomplete derived struct from base class #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('.') + }) + .waitForElementVisible(autoCompleteLineElement('author')) + .waitForElementVisible(autoCompleteLineElement('book_id')) + .waitForElementVisible(autoCompleteLineElement('title')) + .click(autoCompleteLineElement('title')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + }) + }, + 'Should block scoped localbbook #group2': function (browser: NightwatchBrowser) { + browser.pause(4000). + perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER). + sendKeys('localb') + }) + .waitForElementVisible(autoCompleteLineElement('localbbook')) + .click(autoCompleteLineElement('localbbook')) + }, + 'Should autcomplete derived struct from block localbbook #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('.') + }) + .waitForElementVisible(autoCompleteLineElement('author')) + .waitForElementVisible(autoCompleteLineElement('book_id')) + .waitForElementVisible(autoCompleteLineElement('title')) + .click(autoCompleteLineElement('title')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + }) + }, + 'Should block scoped btextbook #group2': function (browser: NightwatchBrowser) { + browser. + perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER). + sendKeys('btext') + }) + .waitForElementVisible(autoCompleteLineElement('btextbook')) + .click(autoCompleteLineElement('btextbook')) + }, + 'Should autcomplete derived struct from block btextbook #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('.') + }) + .waitForElementVisible(autoCompleteLineElement('author')) + .waitForElementVisible(autoCompleteLineElement('book_id')) + .waitForElementVisible(autoCompleteLineElement('title')) + .click(autoCompleteLineElement('title')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + }) + }, + 'Should find private and internal local functions #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('my') + }) + .waitForElementVisible(autoCompleteLineElement('myprivatefunction')) + .waitForElementVisible(autoCompleteLineElement('myinternalfunction')) + .waitForElementVisible(autoCompleteLineElement('memory')) + .click(autoCompleteLineElement('myinternalfunction')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER) + }) + }, + 'Should find internal functions and var from base and owner #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('intern') + }) + .waitForElementVisible(autoCompleteLineElement('internalbasefunction')) + .waitForElementVisible(autoCompleteLineElement('internalstring')) + .waitForElementVisible(autoCompleteLineElement('internalbasestring')) + // keyword internal + .waitForElementVisible(autoCompleteLineElement('internal keyword')) + .click(autoCompleteLineElement('internalbasefunction')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys(this.Keys.ENTER) + }) + }, + + 'Should not find external functions without this. #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('extern') + }) + .waitForElementNotPresent(autoCompleteLineElement('externalbasefunction')) + .waitForElementNotPresent(autoCompleteLineElement('myexternalfunction')) + // keyword internal + .waitForElementVisible(autoCompleteLineElement('external keyword')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys(this.Keys.BACK_SPACE) + .sendKeys(this.Keys.BACK_SPACE) + .sendKeys(this.Keys.BACK_SPACE) + .sendKeys(this.Keys.BACK_SPACE) + .sendKeys(this.Keys.BACK_SPACE) + .sendKeys(this.Keys.BACK_SPACE) + .sendKeys(this.Keys.BACK_SPACE) + }) + }, + 'Should find external functions using this. #group2': function (browser: NightwatchBrowser) { + browser. + perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER). + sendKeys('this.') + }) + .waitForElementVisible(autoCompleteLineElement('externalbasefunction')) + .waitForElementVisible(autoCompleteLineElement('myexternalfunction')) + }, + 'Should find public functions and vars using this. but not private & other types of nodes #group2': function (browser: NightwatchBrowser) { + browser + .waitForElementVisible(autoCompleteLineElement('"publicbasefunction"')) + .waitForElementVisible(autoCompleteLineElement('"publicstring"')) + .waitForElementVisible(autoCompleteLineElement('"basebook"')) + .waitForElementVisible(autoCompleteLineElement('"mybook"')) + .waitForElementVisible(autoCompleteLineElement('"testing"')) + // but no private functions or vars or other types of nodes + .waitForElementNotPresent(autoCompleteLineElement('"private"')) + .waitForElementNotPresent(autoCompleteLineElement('"BaseEvent"')) + .waitForElementNotPresent(autoCompleteLineElement('"BaseEnum"')) + .waitForElementNotPresent(autoCompleteLineElement('"TestBookDefinition"')) + .click(autoCompleteLineElement('"publicbasefunction"')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys(this.Keys.ENTER) + }) + }, + 'Should autocomplete local and derived ENUMS #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('BaseEnum.') + }) + .waitForElementVisible(autoCompleteLineElement('SMALL')) + .waitForElementVisible(autoCompleteLineElement('MEDIUM')) + .waitForElementVisible(autoCompleteLineElement('LARGE')) + .click(autoCompleteLineElement('SMALL')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + .sendKeys('MyEnum.') + }) + .waitForElementVisible(autoCompleteLineElement('SMALL')) + .waitForElementVisible(autoCompleteLineElement('MEDIUM')) + .waitForElementVisible(autoCompleteLineElement('LARGE')) + .click(autoCompleteLineElement('SMALL')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + }) + } +} + From 9a6160b6a59ec152e1ed74ff8850448de1b04de3 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 21 Jul 2022 15:39:23 +0200 Subject: [PATCH 003/179] add tests --- .../src/tests/file_decorator.test.ts | 97 +++++++++++++++++++ apps/remix-ide/src/app.js | 7 +- .../src/app/plugins/file-decorator.ts | 42 +++++--- .../file-decoration-custom-icon.tsx | 2 +- .../file-decoration-error-icon.tsx | 2 +- .../file-decoration-warning-icon.tsx | 2 +- nx.json | 3 + tsconfig.base.json | 1 + workspace.json | 15 +++ 9 files changed, 153 insertions(+), 18 deletions(-) create mode 100644 apps/remix-ide-e2e/src/tests/file_decorator.test.ts diff --git a/apps/remix-ide-e2e/src/tests/file_decorator.test.ts b/apps/remix-ide-e2e/src/tests/file_decorator.test.ts new file mode 100644 index 0000000000..40e78991b3 --- /dev/null +++ b/apps/remix-ide-e2e/src/tests/file_decorator.test.ts @@ -0,0 +1,97 @@ + +'use strict' +import { NightwatchBrowser } from 'nightwatch' +import init from '../helpers/init' + +module.exports = { + + before: function (browser: NightwatchBrowser, done: VoidFunction) { + init(browser, done) + }, + + 'Test decorators with script': function (browser: NightwatchBrowser) { + browser + .openFile('contracts') + .openFile('contracts/2_Owner.sol') + .openFile('contracts/1_Storage.sol') + .openFile('contracts/3_Ballot.sol') + .addFile('scripts/decorators.ts', { content: testScript }) + .pause(2000) + .executeScript('remix.exeCurrent()') + .pause(4000) + .useXpath() + .waitForElementContainsText('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-error-contracts/2_Owner.sol"]', '2') + .waitForElementContainsText('//*[@class="mainview"]//*[@data-id="file-decoration-error-contracts/2_Owner.sol"]', '2') + .waitForElementContainsText('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-custom-contracts/2_Owner.sol"]', 'U') + .waitForElementContainsText('//*[@class="mainview"]//*[@data-id="file-decoration-custom-contracts/2_Owner.sol"]', 'U') + .waitForElementContainsText('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-warning-contracts/1_Storage.sol"]', '2') + .waitForElementContainsText('//*[@class="mainview"]//*[@data-id="file-decoration-warning-contracts/1_Storage.sol"]', '2') + .useCss() + .waitForElementNotPresent('[data-id="file-decoration-custom-contracts/3_Ballot.sol"]', 10000) + .useXpath() + .moveToElement('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-error-contracts/2_Owner.sol"]', 0,0) + .waitForElementVisible('//*[@id="error-tooltip-contracts/2_Owner.sol"]') + .waitForElementContainsText('//*[@id="error-tooltip-contracts/2_Owner.sol"]', 'error on owner') + } + +} +const testScript = ` +(async () => { + remix.call('fileDecorator' as any, 'clearFileDecorators') + let decorator: any = { + path: 'contracts/2_Owner.sol', + isDirectory: false, + fileStateType: 'ERROR', + fileStateLabelClass: 'text-danger', + fileStateIconClass: '', + fileStateIcon: '', + text: '2', + owner: 'code-parser', + bubble: true, + commment: 'error on owner', + } + let decorator2: any = { + path: 'contracts/2_Owner.sol', + isDirectory: false, + fileStateType: 'CUSTOM', + fileStateLabelClass: 'text-success', + fileStateIconClass: 'text-success', + fileStateIcon: 'U', + text: '', + owner: 'code-parser', + bubble: true, + commment: 'modified', + } + remix.call('fileDecorator' as any, 'setFileDecorators', [decorator, decorator2]) + + decorator = { + path: 'contracts/1_Storage.sol', + isDirectory: false, + fileStateType: 'WARNING', + fileStateLabelClass: 'text-warning', + fileStateIconClass: '', + fileStateIcon: '', + text: '2', + owner: 'code-parser', + bubble: true, + commment: 'warning on storage', + } + remix.call('fileDecorator' as any, 'setFileDecorators', decorator) + + decorator = { + path: 'contracts/3_Ballot.sol', + isDirectory: false, + fileStateType: 'CUSTOM', + fileStateLabelClass: '', + fileStateIconClass: '', + fileStateIcon: 'customtext', + text: 'w', + owner: 'dgit', + bubble: true, + commment: '', + } + remix.call('fileDecorator' as any, 'setFileDecorators', decorator) + + remix.call('fileDecorator' as any, 'clearFileDecorators', 'dgit') + + })()` \ No newline at end of file diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index d9c93fd4f6..4270ecce92 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -31,6 +31,7 @@ import { FoundryProvider } from './app/tabs/foundry-provider' import { ExternalHttpProvider } from './app/tabs/external-http-provider' import { Injected0ptimismProvider } from './app/tabs/injected-optimism-provider' import { InjectedArbitrumOneProvider } from './app/tabs/injected-arbitrum-one-provider' +import { FileDecorator } from './app/plugins/file-decorator' const isElectron = require('is-electron') @@ -156,6 +157,9 @@ class AppComponent { // ----------------- Storage plugin --------------------------------- const storagePlugin = new StoragePlugin() + // ------- FILE DECORATOR PLUGIN ------------------ + const fileDecorator = new FileDecorator() + //----- search const search = new SearchPlugin() @@ -239,6 +243,7 @@ class AppComponent { fetchAndCompile, dGitProvider, storagePlugin, + fileDecorator, hardhatProvider, ganacheProvider, foundryProvider, @@ -363,7 +368,7 @@ class AppComponent { await this.appManager.activatePlugin(['sidePanel']) // activating host plugin separately await this.appManager.activatePlugin(['home']) await this.appManager.activatePlugin(['settings', 'config']) - await this.appManager.activatePlugin(['hiddenPanel', 'pluginManager', 'contextualListener', 'terminal', 'blockchain', 'fetchAndCompile', 'contentImport', 'gistHandler']) + await this.appManager.activatePlugin(['hiddenPanel', 'pluginManager', 'fileDecorator', 'contextualListener', 'terminal', 'blockchain', 'fetchAndCompile', 'contentImport', 'gistHandler']) await this.appManager.activatePlugin(['settings']) await this.appManager.activatePlugin(['walkthrough','storage', 'search','compileAndRun', 'recorder']) diff --git a/apps/remix-ide/src/app/plugins/file-decorator.ts b/apps/remix-ide/src/app/plugins/file-decorator.ts index 60a14ef47f..5332db1508 100644 --- a/apps/remix-ide/src/app/plugins/file-decorator.ts +++ b/apps/remix-ide/src/app/plugins/file-decorator.ts @@ -18,22 +18,14 @@ export class FileDecorator extends Plugin { constructor() { super(profile) } + + /** * * @param fileStates Array of file states */ async setFileDecorators(fileStates: fileDecoration[] | fileDecoration) { const workspace = await this.call('filePanel', 'getCurrentWorkspace') - function sortByPath( a: fileDecoration, b: fileDecoration ) { - if ( a.path < b.path ){ - return -1; - } - if ( a.path > b.path ){ - return 1; - } - return 0; - } - const fileStatesPayload = Array.isArray(fileStates) ? fileStates : [fileStates] // clear all file states in the previous state of this owner on the files called fileStatesPayload.forEach((state) => { @@ -46,15 +38,37 @@ export class FileDecorator extends Plugin { return index == -1 }) const newState = [...filteredState, ...fileStatesPayload].sort(sortByPath) - + if (!deepequal(newState, this._fileStates)) { this._fileStates = newState this.emit('fileDecoratorsChanged', this._fileStates) } } - async clearFileDecorators() { - this._fileStates = [] - this.emit('fileDecoratorsChanged', []) + async clearFileDecorators(owner? : string) { + if(!owner) { + this._fileStates = [] + this.emit('fileDecoratorsChanged', []) + } else { + const filteredState = this._fileStates.filter((state) => { + return state.owner != owner + }) + const newState = [...filteredState].sort(sortByPath) + + if (!deepequal(newState, this._fileStates)) { + this._fileStates = newState + this.emit('fileDecoratorsChanged', this._fileStates) + } + } + } +} + +const sortByPath = (a: fileDecoration, b: fileDecoration) => { + if (a.path < b.path) { + return -1; + } + if (a.path > b.path) { + return 1; } + return 0; } \ No newline at end of file diff --git a/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-custom-icon.tsx b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-custom-icon.tsx index c157bc66c0..2cfec2ac97 100644 --- a/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-custom-icon.tsx +++ b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-custom-icon.tsx @@ -5,7 +5,7 @@ import { fileDecoration } from '../../types' const FileDecorationCustomIcon = (props: { fileDecoration: fileDecoration }) => { - return <> + return <> {props.fileDecoration.fileStateIcon} } diff --git a/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-error-icon.tsx b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-error-icon.tsx index 2bb61fd97f..5a9c48b555 100644 --- a/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-error-icon.tsx +++ b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-error-icon.tsx @@ -7,7 +7,7 @@ const FileDecorationErrorIcon = (props: { fileDecoration: fileDecoration }) => { return <> - {props.fileDecoration.text} + {props.fileDecoration.text} } diff --git a/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-warning-icon.tsx b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-warning-icon.tsx index 1c027c9854..9bfd368506 100644 --- a/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-warning-icon.tsx +++ b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-warning-icon.tsx @@ -5,7 +5,7 @@ import { fileDecoration } from '../../types' const FileDecorationWarningIcon = (props: { fileDecoration: fileDecoration }) => { - return <>{props.fileDecoration.text} + return <>{props.fileDecoration.text} } export default FileDecorationWarningIcon \ No newline at end of file diff --git a/nx.json b/nx.json index 13cd26c2b2..734bd55a4c 100644 --- a/nx.json +++ b/nx.json @@ -170,6 +170,9 @@ "remix-ui-permission-handler": { "tags": [] }, + "remix-ui-file-decorators": { + "tags": [] + }, "remix-ui-tooltip-popup": { "tags": [] } diff --git a/tsconfig.base.json b/tsconfig.base.json index e97aaf9aff..9174b23427 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -88,6 +88,7 @@ "@remix-ui/permission-handler": [ "libs/remix-ui/permission-handler/src/index.ts" ], + "@remix-ui/file-decorators": ["libs/remix-ui/file-decorators/src/index.ts"], "@remix-ui/tooltip-popup": ["libs/remix-ui/tooltip-popup/src/index.ts"] } }, diff --git a/workspace.json b/workspace.json index b1ec5f63d5..fd0935ee57 100644 --- a/workspace.json +++ b/workspace.json @@ -1270,6 +1270,21 @@ } } } + }, + "remix-ui-file-decorators": { + "root": "libs/remix-ui/file-decorators", + "sourceRoot": "libs/remix-ui/file-decorators/src", + "projectType": "library", + "architect": { + "lint": { + "builder": "@nrwl/linter:lint", + "options": { + "linter": "eslint", + "tsConfig": ["libs/remix-ui/file-decorators/tsconfig.lib.json"], + "exclude": ["**/node_modules/**", "!libs/remix-ui/file-decorators/**/*"] + } + } + } } }, "cli": { From 0cfe5c10f3d8fc1f5201eba914484da586d48275 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 21 Jul 2022 15:40:27 +0200 Subject: [PATCH 004/179] rm test --- .../src/tests/editorAutoComplete.test.ts | 518 ------------------ 1 file changed, 518 deletions(-) delete mode 100644 apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts diff --git a/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts b/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts deleted file mode 100644 index 8dc7bd4440..0000000000 --- a/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts +++ /dev/null @@ -1,518 +0,0 @@ -'use strict' -import { NightwatchBrowser } from 'nightwatch' -import init from '../helpers/init' -import examples from '../examples/editor-test-contracts' - -const autoCompleteLineElement = (name: string) => { - return `//*[@class='editor-widget suggest-widget visible']//*[@class='contents' and contains(.,'${name}')]` -} - -module.exports = { - '@disabled': true, - before: function (browser: NightwatchBrowser, done: VoidFunction) { - init(browser, done, 'http://127.0.0.1:8080', false) - }, - 'Should add test and base files #group2': function (browser: NightwatchBrowser) { - browser.addFile(examples.testContract.name, examples.testContract) - .addFile(examples.baseContract.name, examples.baseContract) - .addFile(examples.import1Contract.name, examples.import1Contract) - .addFile(examples.baseOfBaseContract.name, examples.baseOfBaseContract) - .addFile(examples.secondimport.name, examples.secondimport) - .addFile(examples.importbase.name, examples.importbase) - .openFile(examples.testContract.name) - }, - 'Should put cursor in the () of the function #group2': function (browser: NightwatchBrowser) { - browser.scrollToLine(36) - const path = "//*[@class='view-line' and contains(.,'myprivatefunction') and contains(.,'private')]//span//span[contains(.,'(')]" - browser.waitForElementVisible('#editorView') - .useXpath() - .click(path).pause(1000) - }, - 'Should complete variable declaration types in a function definition #group2': function (browser: NightwatchBrowser) { - browser - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('uint25') - }) - .waitForElementPresent(autoCompleteLineElement('uint256')) - .click(autoCompleteLineElement('uint256')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' abc') - .sendKeys(this.Keys.ENTER) // we need to split lines for FF texts to pass because the screen is too narrow - .sendKeys(', testb') - }) - .waitForElementPresent(autoCompleteLineElement('"TestBookDefinition"')) - .click(autoCompleteLineElement('"TestBookDefinition"')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' memo') - }) - .waitForElementPresent(autoCompleteLineElement('memory')) - .click(autoCompleteLineElement('memory')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' btextbook') - .sendKeys(this.Keys.ENTER) - .sendKeys(', BaseB') - }) - .waitForElementPresent(autoCompleteLineElement('"BaseBook"')) - .click(autoCompleteLineElement('"BaseBook"')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' stor') - }) - .waitForElementPresent(autoCompleteLineElement('storage')) - .click(autoCompleteLineElement('storage')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' localbbook') - }).pause(3000) - }, - 'Should put cursor at the end of function #group2': function (browser: NightwatchBrowser) { - - const path = "//*[@class='view-line' and contains(.,'localbbook') and contains(.,'private')]//span//span[contains(.,'{')]" - browser - .useXpath() - .click(path).pause(1000) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - // right arrow key - sendKeys(this.Keys.ARROW_RIGHT). - sendKeys(this.Keys.ARROW_RIGHT) - }) - }, - 'Should autcomplete address types': function (browser: NightwatchBrowser) { - browser - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('addre') - }) - .waitForElementPresent(autoCompleteLineElement('address')) - .click(autoCompleteLineElement('address')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' someaddress;') - .sendKeys(this.Keys.ENTER) - }).pause(2000) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('someaddress.') - }) - .waitForElementVisible(autoCompleteLineElement('balance')) - .waitForElementVisible(autoCompleteLineElement('send')) - .waitForElementVisible(autoCompleteLineElement('transfer')) - .waitForElementVisible(autoCompleteLineElement('code')) - .click(autoCompleteLineElement('balance')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys(this.Keys.ENTER) - }) - }, - 'Should autcomplete array types': function (browser: NightwatchBrowser) { - browser - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('uin') - }) - .waitForElementPresent(autoCompleteLineElement('uint')) - .click(autoCompleteLineElement('uint')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('[] mem') - }) - .waitForElementVisible(autoCompleteLineElement('memory')) - .click(autoCompleteLineElement('memory')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' somearray;') - } - ).pause(2000) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys(this.Keys.ENTER) - .sendKeys('somearray.') - }) - .waitForElementVisible(autoCompleteLineElement('push')) - .waitForElementVisible(autoCompleteLineElement('pop')) - .waitForElementVisible(autoCompleteLineElement('length')) - .click(autoCompleteLineElement('length')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys(this.Keys.ENTER) - }) - }, - 'Should see and autocomplete second import because it was imported by the first import #group2': function (browser: NightwatchBrowser) { - browser - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('secondi') - }) - .waitForElementPresent(autoCompleteLineElement('secondimport')) - .click(autoCompleteLineElement('secondimport')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' sec;') - .sendKeys(this.Keys.ENTER) - }).pause(3000) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('sec.') - }) - .waitForElementVisible(autoCompleteLineElement('secondimportstring')) - .click(autoCompleteLineElement('secondimportstring')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - }) - - }, - 'Should see and autocomplete imported local class #group2': function (browser: NightwatchBrowser) { - browser - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('import') - }) - .waitForElementPresent(autoCompleteLineElement('importedcontract')) - .click(autoCompleteLineElement('importedcontract')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('.') - }) - .waitForElementVisible(autoCompleteLineElement('externalimport')) - .waitForElementVisible(autoCompleteLineElement('importbasestring')) - .waitForElementVisible(autoCompleteLineElement('importedbook')) - .waitForElementVisible(autoCompleteLineElement('importpublicstring')) - .waitForElementVisible(autoCompleteLineElement('publicimport')) - // no private - .waitForElementNotPresent(autoCompleteLineElement('importprivatestring')) - .waitForElementNotPresent(autoCompleteLineElement('privateimport')) - // no internal - .waitForElementNotPresent(autoCompleteLineElement('importinternalstring')) - .waitForElementNotPresent(autoCompleteLineElement('internalimport')) - .click(autoCompleteLineElement('importbasestring')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - }) - - }, - 'Should autocomplete derived and local event when not using this. #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('emit base') - }) - .waitForElementVisible(autoCompleteLineElement('BaseEvent')) - .click(autoCompleteLineElement('BaseEvent')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys('msg.sender') - .sendKeys(this.Keys.TAB) - .sendKeys(this.Keys.TAB) // somehow this is needed to get the cursor to the next parameter, only for selenium - .sendKeys('3232') - .sendKeys(this.Keys.TAB) - .sendKeys(this.Keys.ENTER) - }) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('emit MyEv') - }) - .waitForElementVisible(autoCompleteLineElement('MyEvent')) - .click(autoCompleteLineElement('MyEvent')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys('3232') - .sendKeys(this.Keys.TAB) - .sendKeys(this.Keys.ENTER) - }) - }, - - 'Should type and get msg options #group2': function (browser: NightwatchBrowser) { - browser. - perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER). - sendKeys('msg.') - }) - .waitForElementVisible(autoCompleteLineElement('sender')) - .waitForElementVisible(autoCompleteLineElement('data')) - .waitForElementVisible(autoCompleteLineElement('value')) - .waitForElementVisible(autoCompleteLineElement('gas')) - .waitForElementVisible(autoCompleteLineElement('sig')) - .click(autoCompleteLineElement('sender')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('.') - }) - .waitForElementVisible(autoCompleteLineElement('balance')) - .waitForElementVisible(autoCompleteLineElement('code')) - .waitForElementVisible(autoCompleteLineElement('codehash')) - .waitForElementVisible(autoCompleteLineElement('send')) - .waitForElementVisible(autoCompleteLineElement('transfer')) - .click(autoCompleteLineElement('balance')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER) - }) - }, - 'Should bo and get book #group2': function (browser: NightwatchBrowser) { - browser. - perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER). - sendKeys('bo') - }) - .waitForElementVisible(autoCompleteLineElement('book')) - .click(autoCompleteLineElement('book')) - }, - 'Should autcomplete derived struct #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('.') - }) - .waitForElementVisible(autoCompleteLineElement('author')) - .waitForElementVisible(autoCompleteLineElement('book_id')) - .waitForElementVisible(autoCompleteLineElement('title')) - .click(autoCompleteLineElement('title')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - }) - }, - 'Should bo and get basebook #group2': function (browser: NightwatchBrowser) { - browser. - perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER). - sendKeys('base') - }) - .waitForElementVisible(autoCompleteLineElement('basebook')) - .click(autoCompleteLineElement('basebook')) - }, - 'Should autcomplete derived struct from base class #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('.') - }) - .waitForElementVisible(autoCompleteLineElement('author')) - .waitForElementVisible(autoCompleteLineElement('book_id')) - .waitForElementVisible(autoCompleteLineElement('title')) - .click(autoCompleteLineElement('title')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - }) - }, - 'Should block scoped localbbook #group2': function (browser: NightwatchBrowser) { - browser.pause(4000). - perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER). - sendKeys('localb') - }) - .waitForElementVisible(autoCompleteLineElement('localbbook')) - .click(autoCompleteLineElement('localbbook')) - }, - 'Should autcomplete derived struct from block localbbook #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('.') - }) - .waitForElementVisible(autoCompleteLineElement('author')) - .waitForElementVisible(autoCompleteLineElement('book_id')) - .waitForElementVisible(autoCompleteLineElement('title')) - .click(autoCompleteLineElement('title')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - }) - }, - 'Should block scoped btextbook #group2': function (browser: NightwatchBrowser) { - browser. - perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER). - sendKeys('btext') - }) - .waitForElementVisible(autoCompleteLineElement('btextbook')) - .click(autoCompleteLineElement('btextbook')) - }, - 'Should autcomplete derived struct from block btextbook #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('.') - }) - .waitForElementVisible(autoCompleteLineElement('author')) - .waitForElementVisible(autoCompleteLineElement('book_id')) - .waitForElementVisible(autoCompleteLineElement('title')) - .click(autoCompleteLineElement('title')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - }) - }, - 'Should find private and internal local functions #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('my') - }) - .waitForElementVisible(autoCompleteLineElement('myprivatefunction')) - .waitForElementVisible(autoCompleteLineElement('myinternalfunction')) - .waitForElementVisible(autoCompleteLineElement('memory')) - .click(autoCompleteLineElement('myinternalfunction')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER) - }) - }, - 'Should find internal functions and var from base and owner #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('intern') - }) - .waitForElementVisible(autoCompleteLineElement('internalbasefunction')) - .waitForElementVisible(autoCompleteLineElement('internalstring')) - .waitForElementVisible(autoCompleteLineElement('internalbasestring')) - // keyword internal - .waitForElementVisible(autoCompleteLineElement('internal keyword')) - .click(autoCompleteLineElement('internalbasefunction')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys(this.Keys.ENTER) - }) - }, - - 'Should not find external functions without this. #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('extern') - }) - .waitForElementNotPresent(autoCompleteLineElement('externalbasefunction')) - .waitForElementNotPresent(autoCompleteLineElement('myexternalfunction')) - // keyword internal - .waitForElementVisible(autoCompleteLineElement('external keyword')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys(this.Keys.BACK_SPACE) - .sendKeys(this.Keys.BACK_SPACE) - .sendKeys(this.Keys.BACK_SPACE) - .sendKeys(this.Keys.BACK_SPACE) - .sendKeys(this.Keys.BACK_SPACE) - .sendKeys(this.Keys.BACK_SPACE) - .sendKeys(this.Keys.BACK_SPACE) - }) - }, - 'Should find external functions using this. #group2': function (browser: NightwatchBrowser) { - browser. - perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER). - sendKeys('this.') - }) - .waitForElementVisible(autoCompleteLineElement('externalbasefunction')) - .waitForElementVisible(autoCompleteLineElement('myexternalfunction')) - }, - 'Should find public functions and vars using this. but not private & other types of nodes #group2': function (browser: NightwatchBrowser) { - browser - .waitForElementVisible(autoCompleteLineElement('"publicbasefunction"')) - .waitForElementVisible(autoCompleteLineElement('"publicstring"')) - .waitForElementVisible(autoCompleteLineElement('"basebook"')) - .waitForElementVisible(autoCompleteLineElement('"mybook"')) - .waitForElementVisible(autoCompleteLineElement('"testing"')) - // but no private functions or vars or other types of nodes - .waitForElementNotPresent(autoCompleteLineElement('"private"')) - .waitForElementNotPresent(autoCompleteLineElement('"BaseEvent"')) - .waitForElementNotPresent(autoCompleteLineElement('"BaseEnum"')) - .waitForElementNotPresent(autoCompleteLineElement('"TestBookDefinition"')) - .click(autoCompleteLineElement('"publicbasefunction"')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys(this.Keys.ENTER) - }) - }, - 'Should autocomplete local and derived ENUMS #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('BaseEnum.') - }) - .waitForElementVisible(autoCompleteLineElement('SMALL')) - .waitForElementVisible(autoCompleteLineElement('MEDIUM')) - .waitForElementVisible(autoCompleteLineElement('LARGE')) - .click(autoCompleteLineElement('SMALL')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - .sendKeys('MyEnum.') - }) - .waitForElementVisible(autoCompleteLineElement('SMALL')) - .waitForElementVisible(autoCompleteLineElement('MEDIUM')) - .waitForElementVisible(autoCompleteLineElement('LARGE')) - .click(autoCompleteLineElement('SMALL')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - }) - } -} - From 4007753dbe87517eeeb1919242425534403ef180 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 21 Jul 2022 15:49:43 +0200 Subject: [PATCH 005/179] typo fix --- apps/remix-ide-e2e/src/tests/file_decorator.test.ts | 8 ++++---- .../filedecorationicons/file-decoration-tooltip.tsx | 6 +++--- libs/remix-ui/file-decorators/src/lib/helper/index.tsx | 6 +++--- libs/remix-ui/file-decorators/src/lib/types/index.ts | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/file_decorator.test.ts b/apps/remix-ide-e2e/src/tests/file_decorator.test.ts index 40e78991b3..2aa226397c 100644 --- a/apps/remix-ide-e2e/src/tests/file_decorator.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_decorator.test.ts @@ -48,7 +48,7 @@ const testScript = ` text: '2', owner: 'code-parser', bubble: true, - commment: 'error on owner', + comment: 'error on owner', } let decorator2: any = { path: 'contracts/2_Owner.sol', @@ -60,7 +60,7 @@ const testScript = ` text: '', owner: 'code-parser', bubble: true, - commment: 'modified', + comment: 'modified', } remix.call('fileDecorator' as any, 'setFileDecorators', [decorator, decorator2]) @@ -74,7 +74,7 @@ const testScript = ` text: '2', owner: 'code-parser', bubble: true, - commment: 'warning on storage', + comment: 'warning on storage', } remix.call('fileDecorator' as any, 'setFileDecorators', decorator) @@ -88,7 +88,7 @@ const testScript = ` text: 'w', owner: 'dgit', bubble: true, - commment: '', + comment: '', } remix.call('fileDecorator' as any, 'setFileDecorators', decorator) diff --git a/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-tooltip.tsx b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-tooltip.tsx index 7c9149c14d..1d87846192 100644 --- a/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-tooltip.tsx +++ b/libs/remix-ui/file-decorators/src/lib/components/filedecorationicons/file-decoration-tooltip.tsx @@ -9,9 +9,9 @@ const FileDecorationTooltip = (props: { }, ) => { const getComments = function (fileDecoration: fileDecoration) { - if (fileDecoration.commment) { - const commments = Array.isArray(fileDecoration.commment) ? fileDecoration.commment : [fileDecoration.commment] - return commments.map((comment, index) => { + if (fileDecoration.comment) { + const comments = Array.isArray(fileDecoration.comment) ? fileDecoration.comment : [fileDecoration.comment] + return comments.map((comment, index) => { return
{comment}

}) } diff --git a/libs/remix-ui/file-decorators/src/lib/helper/index.tsx b/libs/remix-ui/file-decorators/src/lib/helper/index.tsx index 1afe91b0cf..10bad7d3fc 100644 --- a/libs/remix-ui/file-decorators/src/lib/helper/index.tsx +++ b/libs/remix-ui/file-decorators/src/lib/helper/index.tsx @@ -2,9 +2,9 @@ import React from "react" import { fileDecoration } from "../types" export const getComments = function (fileDecoration: fileDecoration) { - if(fileDecoration.commment){ - const commments = Array.isArray(fileDecoration.commment) ? fileDecoration.commment : [fileDecoration.commment] - return commments.map((comment, index) => { + if(fileDecoration.comment){ + const comments = Array.isArray(fileDecoration.comment) ? fileDecoration.comment : [fileDecoration.comment] + return comments.map((comment, index) => { return
{comment}

}) } diff --git a/libs/remix-ui/file-decorators/src/lib/types/index.ts b/libs/remix-ui/file-decorators/src/lib/types/index.ts index 35178721e0..ef6620434a 100644 --- a/libs/remix-ui/file-decorators/src/lib/types/index.ts +++ b/libs/remix-ui/file-decorators/src/lib/types/index.ts @@ -17,7 +17,7 @@ export enum fileDecorationType { owner: string, workspace?: any tooltip?: string - commment?: string[] | string + comment?: string[] | string } export interface FileType { From 01290d390b494d150308b36386c95b021bbbe40f Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 22 Jul 2022 11:53:33 +0200 Subject: [PATCH 006/179] updates --- .../src/tests/file_decorator.test.ts | 96 ++++++++++++------- .../src/app/plugins/file-decorator.ts | 39 ++++---- .../file-decorators/src/lib/types/index.ts | 2 +- 3 files changed, 86 insertions(+), 51 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/file_decorator.test.ts b/apps/remix-ide-e2e/src/tests/file_decorator.test.ts index 2aa226397c..9b47bbc61f 100644 --- a/apps/remix-ide-e2e/src/tests/file_decorator.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_decorator.test.ts @@ -11,31 +11,50 @@ module.exports = { 'Test decorators with script': function (browser: NightwatchBrowser) { browser - .openFile('contracts') - .openFile('contracts/2_Owner.sol') - .openFile('contracts/1_Storage.sol') - .openFile('contracts/3_Ballot.sol') - .addFile('scripts/decorators.ts', { content: testScript }) - .pause(2000) - .executeScript('remix.exeCurrent()') - .pause(4000) - .useXpath() - .waitForElementContainsText('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-error-contracts/2_Owner.sol"]', '2') - .waitForElementContainsText('//*[@class="mainview"]//*[@data-id="file-decoration-error-contracts/2_Owner.sol"]', '2') - .waitForElementContainsText('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-custom-contracts/2_Owner.sol"]', 'U') - .waitForElementContainsText('//*[@class="mainview"]//*[@data-id="file-decoration-custom-contracts/2_Owner.sol"]', 'U') - .waitForElementContainsText('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-warning-contracts/1_Storage.sol"]', '2') - .waitForElementContainsText('//*[@class="mainview"]//*[@data-id="file-decoration-warning-contracts/1_Storage.sol"]', '2') - .useCss() - .waitForElementNotPresent('[data-id="file-decoration-custom-contracts/3_Ballot.sol"]', 10000) - .useXpath() - .moveToElement('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-error-contracts/2_Owner.sol"]', 0,0) - .waitForElementVisible('//*[@id="error-tooltip-contracts/2_Owner.sol"]') - .waitForElementContainsText('//*[@id="error-tooltip-contracts/2_Owner.sol"]', 'error on owner') + .openFile('contracts') + .openFile('contracts/2_Owner.sol') + .openFile('contracts/1_Storage.sol') + .openFile('contracts/3_Ballot.sol') + .addFile('scripts/decorators.ts', { content: testScriptSet }) + .pause(2000) + .executeScript('remix.exeCurrent()') + .pause(4000) + .useXpath() + .waitForElementContainsText('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-error-contracts/2_Owner.sol"]', '2') + .waitForElementContainsText('//*[@class="mainview"]//*[@data-id="file-decoration-error-contracts/2_Owner.sol"]', '2') + .waitForElementContainsText('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-custom-contracts/2_Owner.sol"]', 'U') + .waitForElementContainsText('//*[@class="mainview"]//*[@data-id="file-decoration-custom-contracts/2_Owner.sol"]', 'U') + .waitForElementContainsText('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-warning-contracts/1_Storage.sol"]', '2') + .waitForElementContainsText('//*[@class="mainview"]//*[@data-id="file-decoration-warning-contracts/1_Storage.sol"]', '2') + .waitForElementContainsText('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-custom-contracts/3_Ballot.sol"]', 'customtext') + .waitForElementContainsText('//*[@class="mainview"]//*[@data-id="file-decoration-custom-contracts/3_Ballot.sol"]', 'customtext') + .moveToElement('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-error-contracts/2_Owner.sol"]', 0, 0) + .waitForElementVisible('//*[@id="error-tooltip-contracts/2_Owner.sol"]') + .waitForElementContainsText('//*[@id="error-tooltip-contracts/2_Owner.sol"]', 'error on owner') + }, + + 'clear ballot decorator': function (browser: NightwatchBrowser) { + browser + .useCss() + .addFile('scripts/clearballot.ts', { content: testScriptClearBallot }) + .pause(2000) + .executeScript('remix.exeCurrent()') + .pause(4000) + .waitForElementNotPresent('[data-id="file-decoration-custom-contracts/3_Ballot.sol"]', 10000) + }, + 'clear all decorators': function (browser: NightwatchBrowser) { + browser + .addFile('scripts/clearall.ts', { content: testScriptClear }) + .pause(2000) + .executeScript('remix.exeCurrent()') + .pause(4000) + .waitForElementNotPresent('[data-id="file-decoration-error-contracts/2_Owner.sol"]', 10000) + .waitForElementNotPresent('[data-id="file-decoration-warning-contracts/1_Storage.sol"]', 10000) } + } -const testScript = ` +const testScriptSet = ` (async () => { remix.call('fileDecorator' as any, 'clearFileDecorators') let decorator: any = { @@ -46,7 +65,6 @@ const testScript = ` fileStateIconClass: '', fileStateIcon: '', text: '2', - owner: 'code-parser', bubble: true, comment: 'error on owner', } @@ -58,11 +76,10 @@ const testScript = ` fileStateIconClass: 'text-success', fileStateIcon: 'U', text: '', - owner: 'code-parser', bubble: true, comment: 'modified', } - remix.call('fileDecorator' as any, 'setFileDecorators', [decorator, decorator2]) + await remix.call('fileDecorator' as any, 'setFileDecorators', [decorator, decorator2]) decorator = { path: 'contracts/1_Storage.sol', @@ -72,11 +89,10 @@ const testScript = ` fileStateIconClass: '', fileStateIcon: '', text: '2', - owner: 'code-parser', bubble: true, comment: 'warning on storage', } - remix.call('fileDecorator' as any, 'setFileDecorators', decorator) + await remix.call('fileDecorator' as any, 'setFileDecorators', decorator) decorator = { path: 'contracts/3_Ballot.sol', @@ -85,13 +101,25 @@ const testScript = ` fileStateLabelClass: '', fileStateIconClass: '', fileStateIcon: 'customtext', - text: 'w', - owner: 'dgit', + text: 'with text', bubble: true, - comment: '', + comment: 'custom comment', } - remix.call('fileDecorator' as any, 'setFileDecorators', decorator) - - remix.call('fileDecorator' as any, 'clearFileDecorators', 'dgit') + await remix.call('fileDecorator' as any, 'setFileDecorators', decorator) - })()` \ No newline at end of file + })()` + + +const testScriptClearBallot = ` + (async () => { + + await remix.call('fileDecorator' as any, 'clearFileDecorators', 'contracts/3_Ballot.sol') + + })()` + +const testScriptClear = ` + (async () => { + await remix.call('fileDecorator' as any, 'clearAllFileDecorators') + + + })()` \ No newline at end of file diff --git a/apps/remix-ide/src/app/plugins/file-decorator.ts b/apps/remix-ide/src/app/plugins/file-decorator.ts index 5332db1508..5fc495bcf1 100644 --- a/apps/remix-ide/src/app/plugins/file-decorator.ts +++ b/apps/remix-ide/src/app/plugins/file-decorator.ts @@ -8,7 +8,7 @@ import { fileDecoration } from '@remix-ui/file-decorators' const profile = { name: 'fileDecorator', desciption: 'Keeps decorators of the files', - methods: ['setFileDecorators', 'clearFileDecorators'], + methods: ['setFileDecorators', 'clearFileDecorators', 'clearAllFileDecorators'], events: ['fileDecoratorsChanged'], version: '0.0.1' } @@ -25,15 +25,17 @@ export class FileDecorator extends Plugin { * @param fileStates Array of file states */ async setFileDecorators(fileStates: fileDecoration[] | fileDecoration) { + const { from } = this.currentRequest const workspace = await this.call('filePanel', 'getCurrentWorkspace') const fileStatesPayload = Array.isArray(fileStates) ? fileStates : [fileStates] // clear all file states in the previous state of this owner on the files called fileStatesPayload.forEach((state) => { state.workspace = workspace + state.owner = from }) const filteredState = this._fileStates.filter((state) => { const index = fileStatesPayload.findIndex((payloadFileState: fileDecoration) => { - return payloadFileState.owner == state.owner && payloadFileState.path == state.path + return from == state.owner && payloadFileState.path == state.path }) return index == -1 }) @@ -45,21 +47,26 @@ export class FileDecorator extends Plugin { } } - async clearFileDecorators(owner? : string) { - if(!owner) { - this._fileStates = [] - this.emit('fileDecoratorsChanged', []) - } else { - const filteredState = this._fileStates.filter((state) => { - return state.owner != owner - }) - const newState = [...filteredState].sort(sortByPath) - - if (!deepequal(newState, this._fileStates)) { - this._fileStates = newState - this.emit('fileDecoratorsChanged', this._fileStates) - } + async clearFileDecorators(path?: string) { + const { from } = this.currentRequest + if (!from) return + + const filteredState = this._fileStates.filter((state) => { + if(state.owner != from) return true + if(path && state.path != path) return true + }) + const newState = [...filteredState].sort(sortByPath) + + if (!deepequal(newState, this._fileStates)) { + this._fileStates = newState + this.emit('fileDecoratorsChanged', this._fileStates) } + + } + + async clearAllFileDecorators() { + this._fileStates = [] + this.emit('fileDecoratorsChanged', []) } } diff --git a/libs/remix-ui/file-decorators/src/lib/types/index.ts b/libs/remix-ui/file-decorators/src/lib/types/index.ts index ef6620434a..fa783ec6e5 100644 --- a/libs/remix-ui/file-decorators/src/lib/types/index.ts +++ b/libs/remix-ui/file-decorators/src/lib/types/index.ts @@ -14,7 +14,7 @@ export enum fileDecorationType { fileStateIcon: string | HTMLDivElement | JSX.Element, bubble: boolean, text?: string, - owner: string, + owner?: string, workspace?: any tooltip?: string comment?: string[] | string From 6b89a38fe8bcad4ee7786840dbd8931a8f71fb14 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 22 Jul 2022 11:57:25 +0200 Subject: [PATCH 007/179] clear on workspace change --- apps/remix-ide/src/app/plugins/file-decorator.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/remix-ide/src/app/plugins/file-decorator.ts b/apps/remix-ide/src/app/plugins/file-decorator.ts index 5fc495bcf1..c81c1894ff 100644 --- a/apps/remix-ide/src/app/plugins/file-decorator.ts +++ b/apps/remix-ide/src/app/plugins/file-decorator.ts @@ -19,6 +19,11 @@ export class FileDecorator extends Plugin { super(profile) } + onActivation(): void { + this.on('filePanel', 'setWorkspace', async () => { + await this.clearAllFileDecorators() + }) + } /** * From ccba9a8d168ec26d502078e94866c186f876be4b Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 22 Jul 2022 12:06:42 +0200 Subject: [PATCH 008/179] cherry pick editor --- apps/remix-ide/src/app/editor/editor.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide/src/app/editor/editor.js b/apps/remix-ide/src/app/editor/editor.js index 97dc63f988..7725387688 100644 --- a/apps/remix-ide/src/app/editor/editor.js +++ b/apps/remix-ide/src/app/editor/editor.js @@ -13,7 +13,7 @@ const profile = { name: 'editor', description: 'service - editor', version: packageJson.version, - methods: ['highlight', 'discardHighlight', 'clearAnnotations', 'addAnnotation', 'gotoLine', 'revealRange', 'getCursorPosition'] + methods: ['highlight', 'discardHighlight', 'clearAnnotations', 'addLineText', 'discardLineTexts', 'addAnnotation', 'gotoLine', 'revealRange', 'getCursorPosition', 'open'] } class Editor extends Plugin { @@ -26,8 +26,8 @@ class Editor extends Plugin { remixDark: 'remix-dark' } - this.registeredDecorations = { sourceAnnotationsPerFile: {}, markerPerFile: {} } - this.currentDecorations = { sourceAnnotationsPerFile: {}, markerPerFile: {} } + this.registeredDecorations = { sourceAnnotationsPerFile: {}, markerPerFile: {}, lineTextPerFile: {} } + this.currentDecorations = { sourceAnnotationsPerFile: {}, markerPerFile: {}, lineTextPerFile: {} } // Init this.event = new EventManager() @@ -567,6 +567,18 @@ class Editor extends Plugin { this.clearDecorationsByPlugin(session, from, 'markerPerFile', this.registeredDecorations, this.currentDecorations) } } + + async addLineText (lineText, filePath) { + filePath = filePath || this.currentFile + await this.addDecoration(lineText, filePath, 'lineTextPerFile') + } + + discardLineTexts() { + const { from } = this.currentRequest + for (const session in this.sessions) { + this.clearDecorationsByPlugin(session, from, 'lineTextPerFile', this.registeredDecorations, this.currentDecorations) + } + } } module.exports = Editor From 4772a2fdb58a68d8255e8a0ffb0df50d71cc50bd Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 22 Jul 2022 12:33:37 +0200 Subject: [PATCH 009/179] types --- .../editor/src/lib/remix-ui-editor.tsx | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) 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 46a5e76d9b..59637a2438 100644 --- a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx +++ b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx @@ -4,6 +4,7 @@ import Editor, { loader } from '@monaco-editor/react' import { reducerActions, reducerListener, initialState } from './actions/editor' import { language, conf } from './syntax' import { cairoLang, cairoConf } from './cairoSyntax' +import { IMarkdownString } from 'monaco-editor' import './remix-ui-editor.css' import { loadTypes } from './web-types' @@ -39,6 +40,25 @@ type sourceMarker = { hide: boolean } +export type lineText = { + position: { + start: { + line: number + column: number + }, + end: { + line: number + column: number + } + }, + from?: string // plugin name + content: string + className: string + afterContentClassName: string + hide: boolean, + hoverMessage: IMarkdownString | IMarkdownString[] +} + loader.config({ paths: { vs: 'assets/js/monaco-editor/dev/vs' } }) export type DecorationsReturn = { @@ -259,7 +279,7 @@ export const EditorUI = (props: EditorUIProps) => { } }, [props.currentFile]) - const convertToMonacoDecoration = (decoration: sourceAnnotation | sourceMarker, typeOfDecoration: string) => { + const convertToMonacoDecoration = (decoration: lineText | sourceAnnotation | sourceMarker, typeOfDecoration: string) => { if (typeOfDecoration === 'sourceAnnotationsPerFile') { decoration = decoration as sourceAnnotation return { @@ -289,6 +309,19 @@ export const EditorUI = (props: EditorUIProps) => { } } } + if (typeOfDecoration === 'lineTextPerFile') { + const lineTextDecoration = decoration as lineText + return { + type: typeOfDecoration, + range: new monacoRef.current.Range(lineTextDecoration.position.start.line + 1, lineTextDecoration.position.start.column + 1, lineTextDecoration.position.start.line + 1, 1024), + options: { + after: { content: ` ${lineTextDecoration.content}`, inlineClassName: `${lineTextDecoration.className}` }, + afterContentClassName: `${lineTextDecoration.afterContentClassName}`, + hoverMessage : lineTextDecoration.hoverMessage + }, + + } + } } props.editorAPI.clearDecorationsByPlugin = (filePath: string, plugin: string, typeOfDecoration: string, registeredDecorations: any, currentDecorations: any) => { From 36211af9f8c072789cb8c521c740e9f506802389 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 22 Jul 2022 12:34:23 +0200 Subject: [PATCH 010/179] rm open call --- apps/remix-ide/src/app/editor/editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/editor/editor.js b/apps/remix-ide/src/app/editor/editor.js index 7725387688..34b9c172e5 100644 --- a/apps/remix-ide/src/app/editor/editor.js +++ b/apps/remix-ide/src/app/editor/editor.js @@ -13,7 +13,7 @@ const profile = { name: 'editor', description: 'service - editor', version: packageJson.version, - methods: ['highlight', 'discardHighlight', 'clearAnnotations', 'addLineText', 'discardLineTexts', 'addAnnotation', 'gotoLine', 'revealRange', 'getCursorPosition', 'open'] + methods: ['highlight', 'discardHighlight', 'clearAnnotations', 'addLineText', 'discardLineTexts', 'addAnnotation', 'gotoLine', 'revealRange', 'getCursorPosition'] } class Editor extends Plugin { From c11dd9e0452a5b156f504db4d44971e0cf196da4 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 22 Jul 2022 13:28:22 +0200 Subject: [PATCH 011/179] add tests --- .../src/tests/editor_line_text.test.ts | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 apps/remix-ide-e2e/src/tests/editor_line_text.test.ts diff --git a/apps/remix-ide-e2e/src/tests/editor_line_text.test.ts b/apps/remix-ide-e2e/src/tests/editor_line_text.test.ts new file mode 100644 index 0000000000..d0d079cf68 --- /dev/null +++ b/apps/remix-ide-e2e/src/tests/editor_line_text.test.ts @@ -0,0 +1,69 @@ +'use strict' + +import { NightwatchBrowser } from 'nightwatch' +import init from '../helpers/init' + +module.exports = { + + before: function (browser: NightwatchBrowser, done: VoidFunction) { + init(browser, done, 'http://127.0.0.1:8080', true) + }, + 'Should add line texts': function (browser: NightwatchBrowser) { + browser + .openFile('contracts') + .openFile('contracts/1_Storage.sol') + .addFile('scripts/addlinetext.ts', {content: addLineText}) + .pause(2000) + .executeScript('remix.exeCurrent()') + .pause(4000) + .openFile('contracts/1_Storage.sol') + .useXpath() + .waitForElementVisible("//*[@class='view-line' and contains(.,'contract')]//span//span[contains(.,'mylinetext1')]") + .waitForElementVisible("//*[@class='view-line' and contains(.,'function')]//span//span[contains(.,'mylinetext2')]") + } +} + +const addLineText = ` +(async () => { + + await remix.call('editor', 'discardLineTexts' as any) + let linetext = { + content: 'mylinetext1', + position: { + start: { + line: 9, + column: 1, + } + }, + hide: false, + className: 'text-muted small', + afterContentClassName: 'text-muted small fas fa-gas-pump pl-4', + hoverMessage: [{ + value: 'hovering1', + }, + ], + } + + await remix.call('editor', 'addLineText' as any, linetext, 'contracts/1_Storage.sol') + + + linetext = { + content: 'mylinetext2', + position: { + start: { + line: 17, + column: 1, + } + }, + hide: false, + className: 'text-muted small', + afterContentClassName: 'text-muted small fas fa-gas-pump pl-4', + hoverMessage: [{ + value: 'hovering2', + }, + ], + } + + await remix.call('editor', 'addLineText' as any, linetext, 'contracts/1_Storage.sol') + +})()` \ No newline at end of file From 854895a1006c81a6d1830c633f9689c59075c100 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Thu, 28 Jul 2022 19:34:34 +0530 Subject: [PATCH 012/179] handle various compiler version from URL --- .../solidity-compiler/src/lib/compiler-container.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 34613067a2..527a83b54b 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -309,7 +309,14 @@ export const CompilerContainer = (props: CompilerContainerProps) => { allVersions = [...allVersions, ...versions] selectedVersion = state.defaultVersion - if (api.getCompilerParameters().version) selectedVersion = api.getCompilerParameters().version + if (api.getCompilerParameters().version) { + const versionFromURL = api.getCompilerParameters().version + // URL version can be like 0.8.7+commit.e28d00a7, 0.8.7 or soljson-v0.8.7+commit.e28d00a7.js + const selectedVersionArr = versions.filter(obj => obj.path === versionFromURL || obj.longVersion === versionFromURL || obj.version === versionFromURL) + // for version like 0.8.15, there will be more than one elements in the array + // In that case too, index 0 will have non-nightly version object + if (selectedVersionArr.length) selectedVersion = selectedVersionArr[0].path + } // Check if version is a URL and corresponding filename starts with 'soljson' if (selectedVersion.startsWith('https://')) { const urlArr = selectedVersion.split('/') From b5a417e0266e451800704f35f95d456f7257933e Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Fri, 29 Jul 2022 10:33:29 +0530 Subject: [PATCH 013/179] handle compiler link --- .../src/lib/compiler-container.tsx | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 527a83b54b..d0c5e90025 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -311,17 +311,20 @@ export const CompilerContainer = (props: CompilerContainerProps) => { selectedVersion = state.defaultVersion if (api.getCompilerParameters().version) { const versionFromURL = api.getCompilerParameters().version - // URL version can be like 0.8.7+commit.e28d00a7, 0.8.7 or soljson-v0.8.7+commit.e28d00a7.js - const selectedVersionArr = versions.filter(obj => obj.path === versionFromURL || obj.longVersion === versionFromURL || obj.version === versionFromURL) - // for version like 0.8.15, there will be more than one elements in the array - // In that case too, index 0 will have non-nightly version object - if (selectedVersionArr.length) selectedVersion = selectedVersionArr[0].path - } - // Check if version is a URL and corresponding filename starts with 'soljson' - if (selectedVersion.startsWith('https://')) { - const urlArr = selectedVersion.split('/') - - if (urlArr[urlArr.length - 1].startsWith('soljson')) isURL = true + // Check if version is a URL and corresponding filename starts with 'soljson' + if (versionFromURL.startsWith('https://')) { + const urlArr = versionFromURL.split('/') + if (urlArr[urlArr.length - 1].startsWith('soljson')) { + isURL = true + selectedVersion = versionFromURL + } + } else { + // URL version can be like 0.8.7+commit.e28d00a7, 0.8.7 or soljson-v0.8.7+commit.e28d00a7.js + const selectedVersionArr = versions.filter(obj => obj.path === versionFromURL || obj.longVersion === versionFromURL || obj.version === versionFromURL) + // for version like 0.8.15, there will be more than one elements in the array + // In that case too, index 0 will have non-nightly version object + if (selectedVersionArr.length) selectedVersion = selectedVersionArr[0].path + } } if (wasmRes.event.type !== 'error') { allVersionsWasm = JSON.parse(wasmRes.json).builds.slice().reverse() From 3034b71b796e8a1b1b73018582c8446e032ca4d2 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Fri, 29 Jul 2022 10:43:04 +0530 Subject: [PATCH 014/179] added e2e --- apps/remix-ide-e2e/src/tests/url.test.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index 91139619e8..b85b2caa1e 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -159,7 +159,7 @@ module.exports = { .expect.element('[data-id="contractGUIUpgradeImplementation"]').to.be.selected }, - 'Should load using URL compiler params': function (browser: NightwatchBrowser) { + 'Should load using various URL compiler params': function (browser: NightwatchBrowser) { browser .pause(5000) .url('http://127.0.0.1:8080/#optimize=true&runs=300&autoCompile=true&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js&language=Yul') @@ -173,6 +173,16 @@ module.exports = { .verify.elementPresent('#optimize:checked') .verify.elementPresent('#autoCompile:checked') .verify.attributeEquals('#runs', 'value', '300') + .url('http://127.0.0.1:8080/#version=0.8.7') + .refresh() + .pause(5000) + .clickLaunchIcon('solidity') + .assert.containsText('#versionSelector option[data-id="selected"]', '0.8.7+commit.e28d00a7') + .url('http://127.0.0.1:8080/#version=0.8.15+commit.e14f2714') + .refresh() + .pause(5000) + .clickLaunchIcon('solidity') + .assert.containsText('#versionSelector option[data-id="selected"]', '0.8.15+commit.e14f2714') }, 'Should load using compiler from link passed in remix URL': function (browser: NightwatchBrowser) { From e176e36a70cabb03af799b2a6c31f688ff06db7f Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 1 Aug 2022 08:43:25 +0200 Subject: [PATCH 015/179] disbaled --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 84cc44a09b..8692c7c4ba 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ To do this you need to: browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') ``` -- add '@disable': true to the test file you want to split: +- add '@disabled': true to the test file you want to split: ``` module.exports = { From 8dcb642611536f36849b493bde71dff1205c6c31 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 27 Jul 2022 14:27:19 +0200 Subject: [PATCH 016/179] flaky hardhat logs --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/terminal.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 988b8940ea..5449860cc0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: false + default: true orbs: browser-tools: circleci/browser-tools@1.2.3 jobs: diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index 7cc5268933..19472f0730 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -161,7 +161,7 @@ module.exports = { .waitForElementContainsText('*[data-id="terminalJournal"]', 'Message: expected \'14\' to equal \'34\'') .waitForElementContainsText('*[data-id="terminalJournal"]', '0 passing, 1 failing') }, - 'Should print hardhat logs #group4': function (browser: NightwatchBrowser) { + 'Should print hardhat logs #group4 #flaky': function (browser: NightwatchBrowser) { browser .click('*[data-id="terminalClearConsole"]') // clear the terminal .addFile('printHardhatlog.sol', { content: hardhatLog }) From d0b621a9a8cbff01218a3938497569e31243da25 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 27 Jul 2022 14:45:29 +0200 Subject: [PATCH 017/179] add pause --- 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 19472f0730..aea1727cc2 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -164,7 +164,9 @@ module.exports = { 'Should print hardhat logs #group4 #flaky': function (browser: NightwatchBrowser) { browser .click('*[data-id="terminalClearConsole"]') // clear the terminal - .addFile('printHardhatlog.sol', { content: hardhatLog }) + .addFile('printHardhatlog.sol', { content: hardhatLog }).pause(2000) + .saveScreenshot('./reports/screenshots/hardhatLog.png') + .openFile('printHardhatlog.sol') .clickLaunchIcon('solidity') .waitForElementVisible('[for="autoCompile"]') .click('[for="autoCompile"]') From ba7178030becdea746fad8cfec346178a3cc76a4 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 16:07:32 +0200 Subject: [PATCH 018/179] pauses --- apps/remix-ide-e2e/src/tests/terminal.test.ts | 5 +++-- 1 file changed, 3 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 aea1727cc2..199e4858a1 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -164,9 +164,10 @@ module.exports = { 'Should print hardhat logs #group4 #flaky': function (browser: NightwatchBrowser) { browser .click('*[data-id="terminalClearConsole"]') // clear the terminal - .addFile('printHardhatlog.sol', { content: hardhatLog }).pause(2000) + .addFile('printHardhatlog.sol', { content: hardhatLog }).pause(4000) .saveScreenshot('./reports/screenshots/hardhatLog.png') - .openFile('printHardhatlog.sol') + .openFile('printHardhatlog.sol').pause(4000) + .saveScreenshot('./reports/screenshots/hardhatLog_2.png') .clickLaunchIcon('solidity') .waitForElementVisible('[for="autoCompile"]') .click('[for="autoCompile"]') From a255bda83ddfb8c1d9a6ed4bd25acf26c819644c Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 16:22:13 +0200 Subject: [PATCH 019/179] record video --- apps/remix-ide-e2e/nightwatch.ts | 11 +++++++++++ apps/remix-ide-e2e/src/tests/terminal.test.ts | 6 ++++++ package.json | 1 + 3 files changed, 18 insertions(+) diff --git a/apps/remix-ide-e2e/nightwatch.ts b/apps/remix-ide-e2e/nightwatch.ts index 7ca74fd2a7..29309ecf97 100644 --- a/apps/remix-ide-e2e/nightwatch.ts +++ b/apps/remix-ide-e2e/nightwatch.ts @@ -20,6 +20,17 @@ module.exports = { on_failure: true, on_error: true }, + videos: { + enabled: true, // Enable video recordings + delete_on_pass: true, // Delete video when tests pass + dir: "./reports/videos", // Video directory + ext: ".mp4", // Video file extension + "resolution": "1440x900", // Display resolution + fps: 15, // Frames per second + hostname: "localhost", // X11 server hostname + display: "0", // X11 server display + pixelFormat: "yuv420p" // Output pixel format + }, exclude: ['dist/apps/remix-ide-e2e/src/tests/runAndDeploy.test.js', 'dist/apps/remix-ide-e2e/src/tests/pluginManager.test.ts'] }, diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index 199e4858a1..d218929b9d 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -7,6 +7,12 @@ module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done, 'http://127.0.0.1:8080?plugins=solidity,udapp', false) }, + beforeEach: function (browser, done) { + require('nightwatch-video-recorder').start(browser, done) + }, + afterEach: function (browser, done) { + require('nightwatch-video-recorder').stop(browser, done) + }, 'Should execution a simple console command #group1 #group999': function (browser: NightwatchBrowser) { browser diff --git a/package.json b/package.json index 6faf18ebd2..a0ba3fe46a 100644 --- a/package.json +++ b/package.json @@ -192,6 +192,7 @@ "latest-version": "^5.1.0", "merge": "^2.1.1", "monaco-editor": "^0.30.1", + "nightwatch-video-recorder": "^3.0.0", "npm-install-version": "^6.0.2", "raw-loader": "^4.0.2", "react": "^17.0.2", From 692fbc398000ae056ec6b24ed0aceed28a8c7521 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 16:36:43 +0200 Subject: [PATCH 020/179] install ffmpeg --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5449860cc0..27e479a420 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -162,6 +162,7 @@ jobs: command: | google-chrome --version chromedriver --version + apt install -y ffmpeg java -jar /usr/local/bin/selenium.jar --version name: Check install - checkout @@ -205,6 +206,7 @@ jobs: command: | firefox --version geckodriver --version + apt install -y ffmpeg java -jar /usr/local/bin/selenium.jar --version name: Check install - checkout From 4d69bfd251c174408b5ffcc71d66c7dba3b7ae4a Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 16:58:22 +0200 Subject: [PATCH 021/179] sudo --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 27e479a420..5a38801394 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -162,7 +162,7 @@ jobs: command: | google-chrome --version chromedriver --version - apt install -y ffmpeg + sudo apt install -y ffmpeg java -jar /usr/local/bin/selenium.jar --version name: Check install - checkout @@ -206,7 +206,7 @@ jobs: command: | firefox --version geckodriver --version - apt install -y ffmpeg + sudo apt install -y ffmpeg java -jar /usr/local/bin/selenium.jar --version name: Check install - checkout From c7a85fddfc724a3fdbfdb31ff1726bdf4df8cdaa Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 17:03:59 +0200 Subject: [PATCH 022/179] update apt --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5a38801394..fe1ffddafb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -162,6 +162,7 @@ jobs: command: | google-chrome --version chromedriver --version + sudo apt-get update -y sudo apt install -y ffmpeg java -jar /usr/local/bin/selenium.jar --version name: Check install From d5e5ce02f06300b3e820dfc96d26137fc9db120d Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 17:19:26 +0200 Subject: [PATCH 023/179] rm video --- .circleci/config.yml | 3 --- apps/remix-ide-e2e/src/tests/terminal.test.ts | 7 ------- package.json | 1 - 3 files changed, 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe1ffddafb..5449860cc0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -162,8 +162,6 @@ jobs: command: | google-chrome --version chromedriver --version - sudo apt-get update -y - sudo apt install -y ffmpeg java -jar /usr/local/bin/selenium.jar --version name: Check install - checkout @@ -207,7 +205,6 @@ jobs: command: | firefox --version geckodriver --version - sudo apt install -y ffmpeg java -jar /usr/local/bin/selenium.jar --version name: Check install - checkout diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index d218929b9d..d9ec15f970 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -7,13 +7,6 @@ module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done, 'http://127.0.0.1:8080?plugins=solidity,udapp', false) }, - beforeEach: function (browser, done) { - require('nightwatch-video-recorder').start(browser, done) - }, - afterEach: function (browser, done) { - require('nightwatch-video-recorder').stop(browser, done) - }, - 'Should execution a simple console command #group1 #group999': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[data-id="terminalCli"]', 10000) diff --git a/package.json b/package.json index a0ba3fe46a..6faf18ebd2 100644 --- a/package.json +++ b/package.json @@ -192,7 +192,6 @@ "latest-version": "^5.1.0", "merge": "^2.1.1", "monaco-editor": "^0.30.1", - "nightwatch-video-recorder": "^3.0.0", "npm-install-version": "^6.0.2", "raw-loader": "^4.0.2", "react": "^17.0.2", From b2b749ec94ba17ea8c2965c01140aaa7bd952a47 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 17:20:50 +0200 Subject: [PATCH 024/179] more screens --- apps/remix-ide-e2e/src/tests/terminal.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index d9ec15f970..bf26eee335 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -174,7 +174,9 @@ module.exports = { .clickLaunchIcon('udapp') .click('*[data-id="deployAndRunClearInstances"]') .selectContract('OwnerTest') + .saveScreenshot('./reports/screenshots/hardhatLog_3.png') .createContract('') + .saveScreenshot('./reports/screenshots/hardhatLog_4.png') .pause(1000) .journalChildIncludes('constructor', { shouldHaveOnlyOneOccurence: true }) .pause(5000) From cc18b17efc153319c0a089b9a2da15e9b50fc3c9 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 17:31:43 +0200 Subject: [PATCH 025/179] screens --- 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 bf26eee335..bf283b5cc0 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -173,6 +173,7 @@ module.exports = { .testContracts('printHardhatlog.sol', { content: hardhatLog }, ['OwnerTest']) .clickLaunchIcon('udapp') .click('*[data-id="deployAndRunClearInstances"]') + .saveScreenshot('./reports/screenshots/hardhatLog_2.5.png') .selectContract('OwnerTest') .saveScreenshot('./reports/screenshots/hardhatLog_3.png') .createContract('') From 156e1d58a6b7cdaebc07ad1821fb06f668db3b5e Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 17:45:32 +0200 Subject: [PATCH 026/179] screens --- 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 bf283b5cc0..a4e5025bf8 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -170,10 +170,12 @@ module.exports = { .clickLaunchIcon('solidity') .waitForElementVisible('[for="autoCompile"]') .click('[for="autoCompile"]') + .saveScreenshot('./reports/screenshots/hardhatLog_2.5.png') .testContracts('printHardhatlog.sol', { content: hardhatLog }, ['OwnerTest']) + .saveScreenshot('./reports/screenshots/hardhatLog_2.8.png') .clickLaunchIcon('udapp') .click('*[data-id="deployAndRunClearInstances"]') - .saveScreenshot('./reports/screenshots/hardhatLog_2.5.png') + .selectContract('OwnerTest') .saveScreenshot('./reports/screenshots/hardhatLog_3.png') .createContract('') From 9fa9d132df6969ed14ac11cfe62f8600ca425c30 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 1 Aug 2022 07:55:51 +0200 Subject: [PATCH 027/179] rm unneeded adding file --- apps/remix-ide-e2e/src/tests/terminal.test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index a4e5025bf8..7f22a4581e 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -163,13 +163,14 @@ module.exports = { 'Should print hardhat logs #group4 #flaky': function (browser: NightwatchBrowser) { browser .click('*[data-id="terminalClearConsole"]') // clear the terminal - .addFile('printHardhatlog.sol', { content: hardhatLog }).pause(4000) - .saveScreenshot('./reports/screenshots/hardhatLog.png') - .openFile('printHardhatlog.sol').pause(4000) - .saveScreenshot('./reports/screenshots/hardhatLog_2.png') + //.addFile('printHardhatlog.sol', { content: hardhatLog }).pause(4000) + //.saveScreenshot('./reports/screenshots/hardhatLog.png') + //.openFile('printHardhatlog.sol').pause(4000) + //.saveScreenshot('./reports/screenshots/hardhatLog_2.png') .clickLaunchIcon('solidity') .waitForElementVisible('[for="autoCompile"]') .click('[for="autoCompile"]') + .clickLaunchIcon('udapp') .saveScreenshot('./reports/screenshots/hardhatLog_2.5.png') .testContracts('printHardhatlog.sol', { content: hardhatLog }, ['OwnerTest']) .saveScreenshot('./reports/screenshots/hardhatLog_2.8.png') From 2a38069c975642426a06dad17d976cf20edbd98c Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 1 Aug 2022 08:04:20 +0200 Subject: [PATCH 028/179] dont click sol --- apps/remix-ide-e2e/src/tests/terminal.test.ts | 2 +- 1 file changed, 1 insertion(+), 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 7f22a4581e..b706f9ec55 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -167,7 +167,7 @@ module.exports = { //.saveScreenshot('./reports/screenshots/hardhatLog.png') //.openFile('printHardhatlog.sol').pause(4000) //.saveScreenshot('./reports/screenshots/hardhatLog_2.png') - .clickLaunchIcon('solidity') + //.clickLaunchIcon('solidity') .waitForElementVisible('[for="autoCompile"]') .click('[for="autoCompile"]') .clickLaunchIcon('udapp') From 0c401f0238f5e13a9d3578809677ca3e99070db8 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 1 Aug 2022 08:12:28 +0200 Subject: [PATCH 029/179] rm screens --- apps/remix-ide-e2e/nightwatch.ts | 11 ----------- apps/remix-ide-e2e/src/tests/terminal.test.ts | 11 +---------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/apps/remix-ide-e2e/nightwatch.ts b/apps/remix-ide-e2e/nightwatch.ts index 29309ecf97..7ca74fd2a7 100644 --- a/apps/remix-ide-e2e/nightwatch.ts +++ b/apps/remix-ide-e2e/nightwatch.ts @@ -20,17 +20,6 @@ module.exports = { on_failure: true, on_error: true }, - videos: { - enabled: true, // Enable video recordings - delete_on_pass: true, // Delete video when tests pass - dir: "./reports/videos", // Video directory - ext: ".mp4", // Video file extension - "resolution": "1440x900", // Display resolution - fps: 15, // Frames per second - hostname: "localhost", // X11 server hostname - display: "0", // X11 server display - pixelFormat: "yuv420p" // Output pixel format - }, exclude: ['dist/apps/remix-ide-e2e/src/tests/runAndDeploy.test.js', 'dist/apps/remix-ide-e2e/src/tests/pluginManager.test.ts'] }, diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index b706f9ec55..021d02c124 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -163,24 +163,15 @@ module.exports = { 'Should print hardhat logs #group4 #flaky': function (browser: NightwatchBrowser) { browser .click('*[data-id="terminalClearConsole"]') // clear the terminal - //.addFile('printHardhatlog.sol', { content: hardhatLog }).pause(4000) - //.saveScreenshot('./reports/screenshots/hardhatLog.png') - //.openFile('printHardhatlog.sol').pause(4000) - //.saveScreenshot('./reports/screenshots/hardhatLog_2.png') - //.clickLaunchIcon('solidity') .waitForElementVisible('[for="autoCompile"]') .click('[for="autoCompile"]') .clickLaunchIcon('udapp') - .saveScreenshot('./reports/screenshots/hardhatLog_2.5.png') .testContracts('printHardhatlog.sol', { content: hardhatLog }, ['OwnerTest']) - .saveScreenshot('./reports/screenshots/hardhatLog_2.8.png') .clickLaunchIcon('udapp') .click('*[data-id="deployAndRunClearInstances"]') - .selectContract('OwnerTest') - .saveScreenshot('./reports/screenshots/hardhatLog_3.png') + .createContract('') - .saveScreenshot('./reports/screenshots/hardhatLog_4.png') .pause(1000) .journalChildIncludes('constructor', { shouldHaveOnlyOneOccurence: true }) .pause(5000) From 1fa874bab154e40518a98972b1b285b5bdf2458a Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 1 Aug 2022 08:30:32 +0200 Subject: [PATCH 030/179] turn off flaky --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/terminal.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5449860cc0..988b8940ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: true + default: false orbs: browser-tools: circleci/browser-tools@1.2.3 jobs: diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index 021d02c124..6424566e3f 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -160,7 +160,7 @@ module.exports = { .waitForElementContainsText('*[data-id="terminalJournal"]', 'Message: expected \'14\' to equal \'34\'') .waitForElementContainsText('*[data-id="terminalJournal"]', '0 passing, 1 failing') }, - 'Should print hardhat logs #group4 #flaky': function (browser: NightwatchBrowser) { + 'Should print hardhat logs #group4': function (browser: NightwatchBrowser) { browser .click('*[data-id="terminalClearConsole"]') // clear the terminal .waitForElementVisible('[for="autoCompile"]') From 061b02add82c7458e53e8b4c70caa6892be7e8bf Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 1 Aug 2022 08:33:41 +0200 Subject: [PATCH 031/179] rm space --- apps/remix-ide-e2e/src/tests/terminal.test.ts | 3 +-- 1 file changed, 1 insertion(+), 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 6424566e3f..d50cbd77f2 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -160,7 +160,7 @@ module.exports = { .waitForElementContainsText('*[data-id="terminalJournal"]', 'Message: expected \'14\' to equal \'34\'') .waitForElementContainsText('*[data-id="terminalJournal"]', '0 passing, 1 failing') }, - 'Should print hardhat logs #group4': function (browser: NightwatchBrowser) { + 'Should print hardhat logs #group4 #flaky': function (browser: NightwatchBrowser) { browser .click('*[data-id="terminalClearConsole"]') // clear the terminal .waitForElementVisible('[for="autoCompile"]') @@ -170,7 +170,6 @@ module.exports = { .clickLaunchIcon('udapp') .click('*[data-id="deployAndRunClearInstances"]') .selectContract('OwnerTest') - .createContract('') .pause(1000) .journalChildIncludes('constructor', { shouldHaveOnlyOneOccurence: true }) From 078d40ead995628a445d6b1bb00bb3309ae3e57c Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 1 Aug 2022 08:34:15 +0200 Subject: [PATCH 032/179] rm flaky --- apps/remix-ide-e2e/src/tests/terminal.test.ts | 2 +- 1 file changed, 1 insertion(+), 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 d50cbd77f2..79305cd22d 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -160,7 +160,7 @@ module.exports = { .waitForElementContainsText('*[data-id="terminalJournal"]', 'Message: expected \'14\' to equal \'34\'') .waitForElementContainsText('*[data-id="terminalJournal"]', '0 passing, 1 failing') }, - 'Should print hardhat logs #group4 #flaky': function (browser: NightwatchBrowser) { + 'Should print hardhat logs #group4': function (browser: NightwatchBrowser) { browser .click('*[data-id="terminalClearConsole"]') // clear the terminal .waitForElementVisible('[for="autoCompile"]') From 1f438add33b40e91e2332ca1aac3e09ab79afa2f Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 27 Jul 2022 13:53:04 +0200 Subject: [PATCH 033/179] flaky test search --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/search.test.ts | 25 +++++++++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 988b8940ea..5449860cc0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: false + default: true orbs: browser-tools: circleci/browser-tools@1.2.3 jobs: diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index 9791bae4c5..c56664d5be 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -4,10 +4,11 @@ import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' module.exports = { + '@disbled': true, before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done, 'http://127.0.0.1:8080', true) }, - 'Should find text': function (browser: NightwatchBrowser) { + 'Should find text #group1': function (browser: NightwatchBrowser) { browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') .click('*[plugin="search"]').waitForElementVisible('*[id="search_input"]') .waitForElementVisible('*[id="search_include"]') @@ -26,7 +27,7 @@ module.exports = { Array.isArray(res.value) && browser.assert.equal(res.value.length, 6) }) }, - 'Should find text with exclude': function (browser: NightwatchBrowser) { + 'Should find text with exclude #group1': function (browser: NightwatchBrowser) { browser .clearValue('*[id="search_input"]') .setValue('*[id="search_input"]', 'contract').pause(1000) @@ -42,7 +43,7 @@ module.exports = { .clearValue('*[id="search_include"]').setValue('*[id="search_include"]', '*.sol, *.js, *.txt') .clearValue('*[id="search_exclude"]').setValue('*[id="search_exclude"]', '.*/**/*') }, - 'Should find regex': function (browser: NightwatchBrowser) { + 'Should find regex #group1': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[id="search_input"]') .clearValue('*[id="search_input"]').pause(2000) @@ -57,7 +58,7 @@ module.exports = { Array.isArray(res.value) && browser.assert.equal(res.value.length, 4) }) }, - 'Should find matchcase': function (browser: NightwatchBrowser) { + 'Should find matchcase #group1': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[data-id="search_use_regex"]').click('*[data-id="search_use_regex"]') .waitForElementVisible('*[data-id="search_case_sensitive"]').click('*[data-id="search_case_sensitive"]').pause(4000) @@ -71,7 +72,7 @@ module.exports = { }) .waitForElementContainsText('*[data-id="search_results"]', 'STORAGE.TEST.JS', 60000) }, - 'Should find matchword': function (browser: NightwatchBrowser) { + 'Should find matchword #group1': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[data-id="search_case_sensitive"]').click('*[data-id="search_case_sensitive"]') .waitForElementVisible('*[data-id="search_whole_word"]').click('*[data-id="search_whole_word"]').pause(2000) @@ -81,7 +82,7 @@ module.exports = { Array.isArray(res.value) && browser.assert.equal(res.value.length, 15) }) }, - 'Should replace text': function (browser: NightwatchBrowser) { + 'Should replace text #group1': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[data-id="toggle_replace"]').click('*[data-id="toggle_replace"]') .waitForElementVisible('*[id="search_replace"]') @@ -95,7 +96,7 @@ module.exports = { browser.assert.ok(content.includes('replacing deployer for a constructor'), 'should replace text ok') }) }, - 'Should replace text without confirmation': function (browser: NightwatchBrowser) { + 'Should replace text without confirmation #group1': function (browser: NightwatchBrowser) { browser.click('*[data-id="confirm_replace_label"]').pause(500) .clearValue('*[id="search_input"]') .setValue('*[id="search_input"]', 'replacing').sendKeys('*[id="search_input"]', browser.Keys.ENTER).pause(1000) @@ -108,7 +109,7 @@ module.exports = { browser.assert.ok(content.includes('replacing2 deployer for a constructor'), 'should replace text ok') }) }, - 'Should replace all & undo': function (browser: NightwatchBrowser) { + 'Should replace all & undo #group1': function (browser: NightwatchBrowser) { browser .clearValue('*[id="search_input"]') .setValue('*[id="search_input"]', 'storage').sendKeys('*[id="search_input"]', browser.Keys.ENTER) @@ -127,7 +128,7 @@ module.exports = { browser.assert.ok(content.includes('title Storage'), 'should undo text ok') }) }, - 'Should replace all & undo & switch between files': function (browser: NightwatchBrowser) { + 'Should replace all & undo & switch between files #group1': function (browser: NightwatchBrowser) { browser.waitForElementVisible('*[id="search_input"]') .clearValue('*[id="search_input"]') .setValue('*[id="search_input"]', 'storage').sendKeys('*[id="search_input"]', browser.Keys.ENTER) @@ -163,7 +164,7 @@ module.exports = { browser.assert.ok(content.includes("Storage' contract"), 'should replace text ok') }) }, - 'Should hide button when edited content is the same': function (browser: NightwatchBrowser) { + 'Should hide button when edited content is the same #group2 #flaky': function (browser: NightwatchBrowser) { browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') .addFile('test.sol', { content: '123' }) .click('*[plugin="search"]').waitForElementVisible('*[id="search_input"]') @@ -184,7 +185,7 @@ module.exports = { ).pause(1000) .waitForElementNotPresent('*[data-id="undo-replace-test.sol"]') }, - 'Should disable/enable button when edited content changed': function (browser: NightwatchBrowser) { + 'Should disable/enable button when edited content changed #group1': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[id="search_input"]') .clearValue('*[id="search_input"]') @@ -222,7 +223,7 @@ module.exports = { .waitForElementNotPresent('*[data-id="undo-replace-test.sol"]') }, - 'should clear search': function (browser: NightwatchBrowser) { + 'should clear search #group1': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[id="search_input"]') .setValue('*[id="search_input"]', 'nodata').sendKeys('*[id="search_input"]', browser.Keys.ENTER).pause(1000) From 4779ea9a836567d5cdc27c9add20b961f1a7d573 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 27 Jul 2022 13:58:48 +0200 Subject: [PATCH 034/179] toggle replace --- apps/remix-ide-e2e/src/tests/search.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index c56664d5be..cd6a831116 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -170,6 +170,7 @@ module.exports = { .click('*[plugin="search"]').waitForElementVisible('*[id="search_input"]') .clearValue('*[id="search_input"]') .setValue('*[id="search_input"]', '123').sendKeys('*[id="search_input"]', browser.Keys.ENTER) + .waitForElementVisible('*[data-id="toggle_replace"]').click('*[data-id="toggle_replace"]') .clearValue('*[id="search_replace"]') .setValue('*[id="search_replace"]', '456').pause(1000) .waitForElementVisible('*[data-id="replace-all-test.sol"]') From 19938b905f41c6ad337e4e833ce261d549488cfc Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 27 Jul 2022 14:05:57 +0200 Subject: [PATCH 035/179] confirm replace --- apps/remix-ide-e2e/src/tests/search.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index cd6a831116..ebab8abc4a 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -173,6 +173,7 @@ module.exports = { .waitForElementVisible('*[data-id="toggle_replace"]').click('*[data-id="toggle_replace"]') .clearValue('*[id="search_replace"]') .setValue('*[id="search_replace"]', '456').pause(1000) + .click('*[data-id="confirm_replace_label"]').pause(500) .waitForElementVisible('*[data-id="replace-all-test.sol"]') .click('*[data-id="replace-all-test.sol"]').pause(2000) .getEditorValue((content) => { From adcee9e2164c30088ff1d991bc68aa4c20c630bb Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 27 Jul 2022 14:11:49 +0200 Subject: [PATCH 036/179] add rest of the test --- apps/remix-ide-e2e/src/tests/search.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index ebab8abc4a..38830d84e6 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -187,7 +187,7 @@ module.exports = { ).pause(1000) .waitForElementNotPresent('*[data-id="undo-replace-test.sol"]') }, - 'Should disable/enable button when edited content changed #group1': function (browser: NightwatchBrowser) { + 'Should disable/enable button when edited content changed #group2': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[id="search_input"]') .clearValue('*[id="search_input"]') @@ -225,7 +225,7 @@ module.exports = { .waitForElementNotPresent('*[data-id="undo-replace-test.sol"]') }, - 'should clear search #group1': function (browser: NightwatchBrowser) { + 'should clear search #group2': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[id="search_input"]') .setValue('*[id="search_input"]', 'nodata').sendKeys('*[id="search_input"]', browser.Keys.ENTER).pause(1000) From 61f09d020ab86ffd2033b249aa0150d9e8bc57f6 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 27 Jul 2022 14:24:30 +0200 Subject: [PATCH 037/179] clear twice --- apps/remix-ide-e2e/src/tests/search.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index 38830d84e6..8914288a10 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -191,6 +191,7 @@ module.exports = { browser .waitForElementVisible('*[id="search_input"]') .clearValue('*[id="search_input"]') + .clearValue('*[id="search_input"]') .setValue('*[id="search_input"]', '123').sendKeys('*[id="search_input"]', browser.Keys.ENTER) .clearValue('*[id="search_replace"]') .setValue('*[id="search_replace"]', 'replaced').pause(1000) From bc5b6685e5fe79721fdcc074c444dfd9a30e1e5b Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 27 Jul 2022 14:36:55 +0200 Subject: [PATCH 038/179] turn off flaky --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/search.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5449860cc0..988b8940ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: true + default: false orbs: browser-tools: circleci/browser-tools@1.2.3 jobs: diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index 8914288a10..da0674ee44 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -164,7 +164,7 @@ module.exports = { browser.assert.ok(content.includes("Storage' contract"), 'should replace text ok') }) }, - 'Should hide button when edited content is the same #group2 #flaky': function (browser: NightwatchBrowser) { + 'Should hide button when edited content is the same #group2': function (browser: NightwatchBrowser) { browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') .addFile('test.sol', { content: '123' }) .click('*[plugin="search"]').waitForElementVisible('*[id="search_input"]') From f748adf623901f2bb1e98ae68cf7084d97775ae1 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 27 Jul 2022 14:51:34 +0200 Subject: [PATCH 039/179] turn on flaky --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/search.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 988b8940ea..5449860cc0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: false + default: true orbs: browser-tools: circleci/browser-tools@1.2.3 jobs: diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index da0674ee44..c75f782406 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -164,13 +164,13 @@ module.exports = { browser.assert.ok(content.includes("Storage' contract"), 'should replace text ok') }) }, - 'Should hide button when edited content is the same #group2': function (browser: NightwatchBrowser) { + 'Should hide button when edited content is the same #group2 #flaky': function (browser: NightwatchBrowser) { browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') .addFile('test.sol', { content: '123' }) .click('*[plugin="search"]').waitForElementVisible('*[id="search_input"]') + .waitForElementVisible('*[data-id="toggle_replace"]').click('*[data-id="toggle_replace"]') .clearValue('*[id="search_input"]') .setValue('*[id="search_input"]', '123').sendKeys('*[id="search_input"]', browser.Keys.ENTER) - .waitForElementVisible('*[data-id="toggle_replace"]').click('*[data-id="toggle_replace"]') .clearValue('*[id="search_replace"]') .setValue('*[id="search_replace"]', '456').pause(1000) .click('*[data-id="confirm_replace_label"]').pause(500) From f6652a8ec3195618e6a49caaa9859c6c8e301848 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 13:15:08 +0200 Subject: [PATCH 040/179] longer pauze --- apps/remix-ide-e2e/src/tests/search.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index c75f782406..9b187372e3 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -205,7 +205,7 @@ module.exports = { .getEditorValue((content) => { browser.assert.ok(content.includes('changed'), 'should have text ok') } - ).pause(1000) + ).pause(4000) .waitForElementVisible('*[data-id="undo-replace-test.sol"]') .getAttribute('[data-id="undo-replace-test.sol"]', 'disabled', (result) => { browser.assert.equal(result.value, 'true', 'should be disabled') From 6a30bc214b01509a20a02bbaf447ae360ba2e19f Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 13:15:20 +0200 Subject: [PATCH 041/179] long pause --- apps/remix-ide-e2e/src/tests/search.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index 9b187372e3..c82851ce7c 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -205,7 +205,7 @@ module.exports = { .getEditorValue((content) => { browser.assert.ok(content.includes('changed'), 'should have text ok') } - ).pause(4000) + ).pause(5000) .waitForElementVisible('*[data-id="undo-replace-test.sol"]') .getAttribute('[data-id="undo-replace-test.sol"]', 'disabled', (result) => { browser.assert.equal(result.value, 'true', 'should be disabled') From 9c9dc31704a62d18f8f8563e06c43b871936e7c5 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 13:21:14 +0200 Subject: [PATCH 042/179] double flaky --- apps/remix-ide-e2e/src/tests/search.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index c82851ce7c..1f02d1f6f0 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -8,7 +8,7 @@ module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done, 'http://127.0.0.1:8080', true) }, - 'Should find text #group1': function (browser: NightwatchBrowser) { + 'Should find text #group1 #flaky': function (browser: NightwatchBrowser) { browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') .click('*[plugin="search"]').waitForElementVisible('*[id="search_input"]') .waitForElementVisible('*[id="search_include"]') From ee8d2209150d0b5e59f2ace256eb1b6f17b318a2 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 13:28:26 +0200 Subject: [PATCH 043/179] turn off --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5449860cc0..988b8940ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: true + default: false orbs: browser-tools: circleci/browser-tools@1.2.3 jobs: From 69d8f509d94cf30a62c987c4b05f09931deadabe Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 13:36:41 +0200 Subject: [PATCH 044/179] pause --- apps/remix-ide-e2e/src/tests/search.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index 1f02d1f6f0..74ed40a065 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -184,7 +184,7 @@ module.exports = { .getEditorValue((content) => { browser.assert.ok(content.includes('123'), 'should have text ok') } - ).pause(1000) + ).pause(5000) .waitForElementNotPresent('*[data-id="undo-replace-test.sol"]') }, 'Should disable/enable button when edited content changed #group2': function (browser: NightwatchBrowser) { From 167f6a4c98de11c9d16b8ff1af526c4e12a7ba23 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 13:48:15 +0200 Subject: [PATCH 045/179] wait --- apps/remix-ide-e2e/src/tests/search.test.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index 74ed40a065..e11aaf5ce5 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -167,10 +167,14 @@ module.exports = { 'Should hide button when edited content is the same #group2 #flaky': function (browser: NightwatchBrowser) { browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') .addFile('test.sol', { content: '123' }) - .click('*[plugin="search"]').waitForElementVisible('*[id="search_input"]') - .waitForElementVisible('*[data-id="toggle_replace"]').click('*[data-id="toggle_replace"]') + .click('*[plugin="search"]') + .waitForElementVisible('*[id="search_input"]') + .waitForElementVisible('*[data-id="toggle_replace"]') + .click('*[data-id="toggle_replace"]') .clearValue('*[id="search_input"]') - .setValue('*[id="search_input"]', '123').sendKeys('*[id="search_input"]', browser.Keys.ENTER) + .setValue('*[id="search_input"]', '123') + .sendKeys('*[id="search_input"]', browser.Keys.ENTER) + .waitForElementVisible('*[id="search_replace"]') .clearValue('*[id="search_replace"]') .setValue('*[id="search_replace"]', '456').pause(1000) .click('*[data-id="confirm_replace_label"]').pause(500) From 26b43735b65da5fe6c0654f0233bbb4f879f7102 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 13:51:55 +0200 Subject: [PATCH 046/179] screenshorts --- apps/remix-ide-e2e/src/tests/search.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index e11aaf5ce5..41b1fd347e 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -169,12 +169,15 @@ module.exports = { .addFile('test.sol', { content: '123' }) .click('*[plugin="search"]') .waitForElementVisible('*[id="search_input"]') + .saveScreenshot('./reports/screenshots/search_replace_test.png') .waitForElementVisible('*[data-id="toggle_replace"]') .click('*[data-id="toggle_replace"]') + .saveScreenshot('./reports/screenshots/search_replace_test_2.png') .clearValue('*[id="search_input"]') .setValue('*[id="search_input"]', '123') .sendKeys('*[id="search_input"]', browser.Keys.ENTER) .waitForElementVisible('*[id="search_replace"]') + .saveScreenshot('./reports/screenshots/search_replace_test_3.png') .clearValue('*[id="search_replace"]') .setValue('*[id="search_replace"]', '456').pause(1000) .click('*[data-id="confirm_replace_label"]').pause(500) From 9f585dc7182157df21712cc8c4fbccbf5a362e05 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 13:57:23 +0200 Subject: [PATCH 047/179] screenshot --- apps/remix-ide-e2e/src/tests/search.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index 41b1fd347e..55709a384b 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -166,6 +166,7 @@ module.exports = { }, 'Should hide button when edited content is the same #group2 #flaky': function (browser: NightwatchBrowser) { browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') + .saveScreenshot('./reports/screenshots/search_replace_test_0.png') .addFile('test.sol', { content: '123' }) .click('*[plugin="search"]') .waitForElementVisible('*[id="search_input"]') From ef56b5c63b493531e4ed4c4509d1cb42ea285c6c Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 14:08:19 +0200 Subject: [PATCH 048/179] typo --- apps/remix-ide-e2e/src/tests/search.test.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index 55709a384b..e64f3594e8 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -4,7 +4,7 @@ import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' module.exports = { - '@disbled': true, + '@disabled': true, before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done, 'http://127.0.0.1:8080', true) }, @@ -166,19 +166,15 @@ module.exports = { }, 'Should hide button when edited content is the same #group2 #flaky': function (browser: NightwatchBrowser) { browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') - .saveScreenshot('./reports/screenshots/search_replace_test_0.png') .addFile('test.sol', { content: '123' }) .click('*[plugin="search"]') .waitForElementVisible('*[id="search_input"]') - .saveScreenshot('./reports/screenshots/search_replace_test.png') .waitForElementVisible('*[data-id="toggle_replace"]') .click('*[data-id="toggle_replace"]') - .saveScreenshot('./reports/screenshots/search_replace_test_2.png') .clearValue('*[id="search_input"]') .setValue('*[id="search_input"]', '123') .sendKeys('*[id="search_input"]', browser.Keys.ENTER) .waitForElementVisible('*[id="search_replace"]') - .saveScreenshot('./reports/screenshots/search_replace_test_3.png') .clearValue('*[id="search_replace"]') .setValue('*[id="search_replace"]', '456').pause(1000) .click('*[data-id="confirm_replace_label"]').pause(500) From deeac12e9651d2535188fccbe3d27c44695e0fef Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 30 Jul 2022 16:02:20 +0200 Subject: [PATCH 049/179] Update search.test.ts --- apps/remix-ide-e2e/src/tests/search.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index e64f3594e8..c8f90c5978 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -8,7 +8,7 @@ module.exports = { before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done, 'http://127.0.0.1:8080', true) }, - 'Should find text #group1 #flaky': function (browser: NightwatchBrowser) { + 'Should find text #group1': function (browser: NightwatchBrowser) { browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') .click('*[plugin="search"]').waitForElementVisible('*[id="search_input"]') .waitForElementVisible('*[id="search_include"]') @@ -164,7 +164,7 @@ module.exports = { browser.assert.ok(content.includes("Storage' contract"), 'should replace text ok') }) }, - 'Should hide button when edited content is the same #group2 #flaky': function (browser: NightwatchBrowser) { + 'Should hide button when edited content is the same #group2': function (browser: NightwatchBrowser) { browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') .addFile('test.sol', { content: '123' }) .click('*[plugin="search"]') @@ -238,4 +238,4 @@ module.exports = { Array.isArray(res.value) && browser.assert.equal(res.value.length, 0) }) } -} \ No newline at end of file +} From 48a6ba634ed868121d83de0b609929ddadf75937 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Thu, 28 Jul 2022 18:29:03 +0530 Subject: [PATCH 050/179] show contract from compiled file selected in dropdowns --- libs/remix-ui/run-tab/src/lib/actions/events.ts | 9 +++++++-- .../solidity-compiler/src/lib/contract-selection.tsx | 10 ++++++++-- .../solidity-compiler/src/lib/solidity-compiler.tsx | 2 +- libs/remix-ui/solidity-compiler/src/lib/types/index.ts | 1 + 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/actions/events.ts b/libs/remix-ui/run-tab/src/lib/actions/events.ts index e47724aef0..46af1dba0d 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/events.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/events.ts @@ -101,8 +101,13 @@ const broadcastCompilationResult = async (plugin: RunTab, dispatch: React.Dispat const contracts = getCompiledContracts(compiler).map((contract) => { return { name: languageVersion, alias: contract.name, file: contract.file, compiler } }) - const index = contracts.findIndex(contract => contract.alias === plugin.REACT_API.contracts.currentContract) - if ((index < 0) && (contracts.length > 0)) dispatch(setCurrentContract(contracts[0].alias)) + if ((contracts.length > 0)) { + const contractsInCompiledFile = contracts.filter(obj => obj.file === file) + let currentContract + if (contractsInCompiledFile.length) currentContract = contractsInCompiledFile[0].alias + else currentContract = contracts[0].alias + dispatch(setCurrentContract(currentContract)) + } const isUpgradeable = await plugin.call('openzeppelin-proxy', 'isConcerned', data.sources && data.sources[file] ? data.sources[file].ast : {}) if (isUpgradeable) { diff --git a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx index 21dde7afc9..7eb240c7a9 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx @@ -7,12 +7,18 @@ import { CopyToClipboard } from '@remix-ui/clipboard' // eslint-disable-line import './css/style.css' export const ContractSelection = (props: ContractSelectionProps) => { - const { api, contractsDetails, contractList, modal } = props + const { api, compiledFileName, contractsDetails, contractList, modal } = props const [selectedContract, setSelectedContract] = useState('') const [storage, setStorage] = useState(null) useEffect(() => { - if (contractList.length) setSelectedContract(contractList[0].name) + if (contractList.length) { + const compiledPathArr = compiledFileName.split('/') + const compiledFile = compiledPathArr[compiledPathArr.length - 1] + const contractsInCompiledFile = contractList.filter(obj => obj.file === compiledFile) + if (contractsInCompiledFile.length) setSelectedContract(contractsInCompiledFile[0].name) + else setSelectedContract(contractList[0].name) + } }, [contractList]) const resetStorage = () => { diff --git a/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx b/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx index 3a9ce290e8..0f52e2c16e 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx @@ -183,7 +183,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => { configFilePath={state.configFilePath} setConfigFilePath={setConfigFilePath} /> - { contractsFile[currentFile] && contractsFile[currentFile].contractsDetails && } + { contractsFile[currentFile] && contractsFile[currentFile].contractsDetails && } { compileErrors[currentFile] &&
diff --git a/libs/remix-ui/solidity-compiler/src/lib/types/index.ts b/libs/remix-ui/solidity-compiler/src/lib/types/index.ts index 4fd80bcf7d..096cc1d277 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/types/index.ts +++ b/libs/remix-ui/solidity-compiler/src/lib/types/index.ts @@ -23,6 +23,7 @@ export interface CompilerContainerProps { } export interface ContractSelectionProps { api: ICompilerApi, + compiledFileName: string, contractList: { file: string, name: string }[], modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, contractsDetails: Record From 0756bb94fde87bd2bf8806d3a4323a2335478306 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 27 Jul 2022 11:49:41 +0200 Subject: [PATCH 051/179] added zoomin and zoomout to context menu of editor --- .../editor/src/lib/remix-ui-editor.tsx | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) 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 46a5e76d9b..0b5b950180 100644 --- a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx +++ b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx @@ -245,7 +245,6 @@ export const EditorUI = (props: EditorUIProps) => { defineAndSetTheme(monacoRef.current) }) - useEffect(() => { if (!editorRef.current || !props.currentFile) return currentFileRef.current = props.currentFile @@ -410,6 +409,8 @@ export const EditorUI = (props: EditorUIProps) => { (window as any).addRemixBreakpoint(e.target.position) } }) + + // zoomin zoomout editor.addCommand(monacoRef.current.KeyMod.CtrlCmd | monacoRef.current.KeyCode.US_EQUAL, () => { editor.updateOptions({ fontSize: editor.getOption(43).fontSize + 1 }) }) @@ -417,6 +418,32 @@ export const EditorUI = (props: EditorUIProps) => { editor.updateOptions({ fontSize: editor.getOption(43).fontSize - 1 }) }) + // add context menu items + const zoominAction = { + id: "zoomIn", + label: "Zoom In", + contextMenuOrder: 0, // choose the order + contextMenuGroupId: "zooming", // create a new grouping + keybindings: [ + // eslint-disable-next-line no-bitwise + monacoRef.current.KeyMod.CtrlCmd | monacoRef.current.KeyCode.Equal, + ], + run: () => { editor.updateOptions({ fontSize: editor.getOption(43).fontSize + 1 }) }, + } + const zoomOutAction = { + id: "zoomOut", + label: "Zoom Out", + contextMenuOrder: 0, // choose the order + contextMenuGroupId: "zooming", // create a new grouping + keybindings: [ + // eslint-disable-next-line no-bitwise + monacoRef.current.KeyMod.CtrlCmd | monacoRef.current.KeyCode.Minus, + ], + run: () => { editor.updateOptions({ fontSize: editor.getOption(43).fontSize - 1 }) }, + } + editor.addAction(zoomOutAction) + editor.addAction(zoominAction) + const editorService = editor._codeEditorService; const openEditorBase = editorService.openCodeEditor.bind(editorService); editorService.openCodeEditor = async (input, source) => { From 503509a24654610ebbf2fafb22efc57cdc040692 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 27 Jul 2022 11:58:42 +0200 Subject: [PATCH 052/179] new placeholder for solidity path input --- libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index d0c5e90025..069377d045 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -823,7 +823,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { Date: Tue, 2 Aug 2022 12:54:12 +0530 Subject: [PATCH 053/179] resolver for remix-tests CLI --- libs/remix-tests/package.json | 1 + libs/remix-tests/src/compiler.ts | 26 +++++++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index c4a02aef60..7aab939286 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -42,6 +42,7 @@ "@remix-project/remix-lib": "^0.5.15", "@remix-project/remix-simulator": "^0.2.15", "@remix-project/remix-solidity": "^0.5.1", + "@remix-project/remix-url-resolver": "^0.0.36", "ansi-gray": "^0.1.1", "async": "^2.6.0", "axios": ">=0.21.1", diff --git a/libs/remix-tests/src/compiler.ts b/libs/remix-tests/src/compiler.ts index f16c925edc..0f31e6dcb7 100644 --- a/libs/remix-tests/src/compiler.ts +++ b/libs/remix-tests/src/compiler.ts @@ -4,6 +4,7 @@ import path from 'path' import deepequal from 'deep-equal' import Log from './logger' import { Compiler as RemixCompiler } from '@remix-project/remix-solidity' +import { RemixURLResolver } from '@remix-project/remix-url-resolver' import { SrcIfc, CompilerConfiguration, CompilationErrors } from './types' const logger = new Log() const log = logger.logger @@ -85,6 +86,23 @@ export function compileFileOrFiles (filename: string, isDirectory: boolean, opts 'remix_accounts.sol': { content: writeTestAccountsContract(accounts) } } const filepath: string = (isDirectory ? filename : path.dirname(filename)) + const importsCallback = (url, cb) => { + try { + console.log('inside importsCallback----url--->', url) + if(fs.existsSync(url)) cb(null, fs.readFileSync(url, 'utf-8')) + else { + console.log('inside else------->') + const urlResolver = new RemixURLResolver() + urlResolver.resolve(url).then((result) => { + console.log('result------->', result) + cb(null, result.content) + }) + .catch((error) => cb(error.message)) + } + } catch (e) { + cb(e.message) + } + } try { if (!isDirectory && fs.existsSync(filename)) { if (filename.split('.').pop() === 'sol') { @@ -114,13 +132,7 @@ export function compileFileOrFiles (filename: string, isDirectory: boolean, opts } finally { async.waterfall([ function loadCompiler (next) { - compiler = new RemixCompiler((url, cb) => { - try { - cb(null, fs.readFileSync(url, 'utf-8')) - } catch (e) { - cb(e.message) - } - }) + compiler = new RemixCompiler(importsCallback) if (compilerConfig) { const { currentCompilerUrl, evmVersion, optimize, runs } = compilerConfig if (evmVersion) compiler.set('evmVersion', evmVersion) From 79a00485026d1aa2cea4db97531f735cfb8e49f0 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 2 Aug 2022 13:17:14 +0530 Subject: [PATCH 054/179] update unit tests --- libs/remix-tests/src/compiler.ts | 8 +- .../tests/examples_0/assert_ok_test.sol | 2 +- .../assert_ok_without_console_test.sol | 12 - .../tests/examples_0/hardhat/console.sol | 1532 ----------------- libs/remix-tests/tests/testRunner.cli.spec.ts | 16 +- libs/remix-tests/tests/testRunner.spec.ts | 2 +- 6 files changed, 11 insertions(+), 1561 deletions(-) delete mode 100644 libs/remix-tests/tests/examples_0/assert_ok_without_console_test.sol delete mode 100644 libs/remix-tests/tests/examples_0/hardhat/console.sol diff --git a/libs/remix-tests/src/compiler.ts b/libs/remix-tests/src/compiler.ts index 0f31e6dcb7..b399f7376e 100644 --- a/libs/remix-tests/src/compiler.ts +++ b/libs/remix-tests/src/compiler.ts @@ -88,16 +88,10 @@ export function compileFileOrFiles (filename: string, isDirectory: boolean, opts const filepath: string = (isDirectory ? filename : path.dirname(filename)) const importsCallback = (url, cb) => { try { - console.log('inside importsCallback----url--->', url) if(fs.existsSync(url)) cb(null, fs.readFileSync(url, 'utf-8')) else { - console.log('inside else------->') const urlResolver = new RemixURLResolver() - urlResolver.resolve(url).then((result) => { - console.log('result------->', result) - cb(null, result.content) - }) - .catch((error) => cb(error.message)) + urlResolver.resolve(url).then((result) => cb(null, result.content)).catch((error) => cb(error.message)) } } catch (e) { cb(e.message) diff --git a/libs/remix-tests/tests/examples_0/assert_ok_test.sol b/libs/remix-tests/tests/examples_0/assert_ok_test.sol index 04af584e63..52d0088e6a 100644 --- a/libs/remix-tests/tests/examples_0/assert_ok_test.sol +++ b/libs/remix-tests/tests/examples_0/assert_ok_test.sol @@ -1,7 +1,7 @@ import "remix_tests.sol"; // this import is automatically injected by Remix. -import "./hardhat/console.sol"; +import "hardhat/console.sol"; contract AssertOkTest { diff --git a/libs/remix-tests/tests/examples_0/assert_ok_without_console_test.sol b/libs/remix-tests/tests/examples_0/assert_ok_without_console_test.sol deleted file mode 100644 index 030552b16a..0000000000 --- a/libs/remix-tests/tests/examples_0/assert_ok_without_console_test.sol +++ /dev/null @@ -1,12 +0,0 @@ -import "remix_tests.sol"; // this import is automatically injected by Remix. - -contract AssertOkTest { - - function okPassTest() public { - Assert.ok(true, "okPassTest passes"); - } - - function okFailTest() public { - Assert.ok(false, "okFailTest fails"); - } -} \ No newline at end of file diff --git a/libs/remix-tests/tests/examples_0/hardhat/console.sol b/libs/remix-tests/tests/examples_0/hardhat/console.sol deleted file mode 100644 index d65e3b412e..0000000000 --- a/libs/remix-tests/tests/examples_0/hardhat/console.sol +++ /dev/null @@ -1,1532 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >= 0.4.22 <0.9.0; - -library console { - address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); - - function _sendLogPayload(bytes memory payload) private view { - uint256 payloadLength = payload.length; - address consoleAddress = CONSOLE_ADDRESS; - assembly { - let payloadStart := add(payload, 32) - let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0) - } - } - - function log() internal view { - _sendLogPayload(abi.encodeWithSignature("log()")); - } - - function logInt(int p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(int)", p0)); - } - - function logUint(uint p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); - } - - function logString(string memory p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); - } - - function logBool(bool p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); - } - - function logAddress(address p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); - } - - function logBytes(bytes memory p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes)", p0)); - } - - function logBytes1(bytes1 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0)); - } - - function logBytes2(bytes2 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0)); - } - - function logBytes3(bytes3 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0)); - } - - function logBytes4(bytes4 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0)); - } - - function logBytes5(bytes5 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0)); - } - - function logBytes6(bytes6 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0)); - } - - function logBytes7(bytes7 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0)); - } - - function logBytes8(bytes8 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0)); - } - - function logBytes9(bytes9 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0)); - } - - function logBytes10(bytes10 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0)); - } - - function logBytes11(bytes11 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0)); - } - - function logBytes12(bytes12 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0)); - } - - function logBytes13(bytes13 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0)); - } - - function logBytes14(bytes14 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0)); - } - - function logBytes15(bytes15 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0)); - } - - function logBytes16(bytes16 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0)); - } - - function logBytes17(bytes17 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0)); - } - - function logBytes18(bytes18 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0)); - } - - function logBytes19(bytes19 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0)); - } - - function logBytes20(bytes20 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0)); - } - - function logBytes21(bytes21 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0)); - } - - function logBytes22(bytes22 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0)); - } - - function logBytes23(bytes23 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0)); - } - - function logBytes24(bytes24 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0)); - } - - function logBytes25(bytes25 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0)); - } - - function logBytes26(bytes26 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0)); - } - - function logBytes27(bytes27 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0)); - } - - function logBytes28(bytes28 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0)); - } - - function logBytes29(bytes29 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0)); - } - - function logBytes30(bytes30 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0)); - } - - function logBytes31(bytes31 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0)); - } - - function logBytes32(bytes32 p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0)); - } - - function log(uint p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); - } - - function log(string memory p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); - } - - function log(bool p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); - } - - function log(address p0) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); - } - - function log(uint p0, uint p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint)", p0, p1)); - } - - function log(uint p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string)", p0, p1)); - } - - function log(uint p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool)", p0, p1)); - } - - function log(uint p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address)", p0, p1)); - } - - function log(string memory p0, uint p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint)", p0, p1)); - } - - function log(string memory p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); - } - - function log(string memory p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1)); - } - - function log(string memory p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1)); - } - - function log(bool p0, uint p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint)", p0, p1)); - } - - function log(bool p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1)); - } - - function log(bool p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1)); - } - - function log(bool p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1)); - } - - function log(address p0, uint p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint)", p0, p1)); - } - - function log(address p0, string memory p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1)); - } - - function log(address p0, bool p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1)); - } - - function log(address p0, address p1) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1)); - } - - function log(uint p0, uint p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint)", p0, p1, p2)); - } - - function log(uint p0, uint p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string)", p0, p1, p2)); - } - - function log(uint p0, uint p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool)", p0, p1, p2)); - } - - function log(uint p0, uint p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address)", p0, p1, p2)); - } - - function log(uint p0, string memory p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint)", p0, p1, p2)); - } - - function log(uint p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,string)", p0, p1, p2)); - } - - function log(uint p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool)", p0, p1, p2)); - } - - function log(uint p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,address)", p0, p1, p2)); - } - - function log(uint p0, bool p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint)", p0, p1, p2)); - } - - function log(uint p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string)", p0, p1, p2)); - } - - function log(uint p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool)", p0, p1, p2)); - } - - function log(uint p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address)", p0, p1, p2)); - } - - function log(uint p0, address p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint)", p0, p1, p2)); - } - - function log(uint p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,string)", p0, p1, p2)); - } - - function log(uint p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool)", p0, p1, p2)); - } - - function log(uint p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,address)", p0, p1, p2)); - } - - function log(string memory p0, uint p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint)", p0, p1, p2)); - } - - function log(string memory p0, uint p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,string)", p0, p1, p2)); - } - - function log(string memory p0, uint p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool)", p0, p1, p2)); - } - - function log(string memory p0, uint p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,address)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2)); - } - - function log(string memory p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2)); - } - - function log(string memory p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2)); - } - - function log(string memory p0, address p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint)", p0, p1, p2)); - } - - function log(string memory p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2)); - } - - function log(string memory p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2)); - } - - function log(string memory p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2)); - } - - function log(bool p0, uint p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint)", p0, p1, p2)); - } - - function log(bool p0, uint p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string)", p0, p1, p2)); - } - - function log(bool p0, uint p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool)", p0, p1, p2)); - } - - function log(bool p0, uint p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2)); - } - - function log(bool p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2)); - } - - function log(bool p0, bool p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint)", p0, p1, p2)); - } - - function log(bool p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2)); - } - - function log(bool p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2)); - } - - function log(bool p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2)); - } - - function log(bool p0, address p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint)", p0, p1, p2)); - } - - function log(bool p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2)); - } - - function log(bool p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2)); - } - - function log(bool p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2)); - } - - function log(address p0, uint p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint)", p0, p1, p2)); - } - - function log(address p0, uint p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,string)", p0, p1, p2)); - } - - function log(address p0, uint p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool)", p0, p1, p2)); - } - - function log(address p0, uint p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,address)", p0, p1, p2)); - } - - function log(address p0, string memory p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint)", p0, p1, p2)); - } - - function log(address p0, string memory p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2)); - } - - function log(address p0, string memory p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2)); - } - - function log(address p0, string memory p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2)); - } - - function log(address p0, bool p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint)", p0, p1, p2)); - } - - function log(address p0, bool p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2)); - } - - function log(address p0, bool p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2)); - } - - function log(address p0, bool p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2)); - } - - function log(address p0, address p1, uint p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint)", p0, p1, p2)); - } - - function log(address p0, address p1, string memory p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2)); - } - - function log(address p0, address p1, bool p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2)); - } - - function log(address p0, address p1, address p2) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2)); - } - - function log(uint p0, uint p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,string)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,address)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,string)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,address)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,string)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,address)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,string)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, uint p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,address)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,string)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,address)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,string)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,address)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,string)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,address)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,string)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,address)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,string)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,address)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,string)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,address)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,string)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,address)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,string)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,address)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,string)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,address)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,string)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,address)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,uint)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,string)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,bool)", p0, p1, p2, p3)); - } - - function log(uint p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, uint p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3)); - } - - function log(string memory p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, uint p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3)); - } - - function log(bool p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,uint)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,uint)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,uint)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,uint)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, uint p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,uint)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, string memory p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,uint)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, bool p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,uint)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, uint p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, string memory p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, bool p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, uint p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, string memory p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, bool p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3)); - } - - function log(address p0, address p1, address p2, address p3) internal view { - _sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3)); - } - -} diff --git a/libs/remix-tests/tests/testRunner.cli.spec.ts b/libs/remix-tests/tests/testRunner.cli.spec.ts index 65bea514da..6f412dcc40 100644 --- a/libs/remix-tests/tests/testRunner.cli.spec.ts +++ b/libs/remix-tests/tests/testRunner.cli.spec.ts @@ -42,7 +42,7 @@ Commands: }) test('remix-tests running a test file', () => { - const res = spawnSync(executablePath, [resolve(__dirname + '/examples_0/assert_ok_without_console_test.sol')]) + const res = spawnSync(executablePath, [resolve(__dirname + '/examples_0/assert_ok_test.sol')]) // match initial lines expect(res.stdout.toString().trim()).toMatch(/:: Running remix-tests - Unit testing for solidity ::/) expect(res.stdout.toString().trim()).toMatch(/creation of library remix_tests.sol:Assert pending.../) @@ -57,7 +57,7 @@ Commands: }) test('remix-tests running a test file with custom compiler version', () => { - const res = spawnSync(executablePath, ['--compiler', '0.7.4', resolve(__dirname + '/examples_0/assert_ok_without_console_test.sol')]) + const res = spawnSync(executablePath, ['--compiler', '0.7.4', resolve(__dirname + '/examples_0/assert_ok_test.sol')]) // match initial lines expect(res.stdout.toString().trim().includes('Compiler version set to 0.7.4. Latest version is')).toBeTruthy() expect(res.stdout.toString().trim().includes('Loading remote solc version v0.7.4+commit.3f05b770 ...')).toBeTruthy() @@ -71,13 +71,13 @@ Commands: }) test('remix-tests running a test file with unavailable custom compiler version (should fail)', () => { - const res = spawnSync(executablePath, ['--compiler', '1.10.4', resolve(__dirname + '/examples_0/assert_ok_without_console_test.sol')]) + const res = spawnSync(executablePath, ['--compiler', '1.10.4', resolve(__dirname + '/examples_0/assert_ok_test.sol')]) // match initial lines expect(res.stdout.toString().trim().includes('No compiler found in releases with version 1.10.4')).toBeTruthy() }) test('remix-tests running a test file with custom EVM', () => { - const res = spawnSync(executablePath, ['--evm', 'petersburg', resolve(__dirname + '/examples_0/assert_ok_without_console_test.sol')]) + const res = spawnSync(executablePath, ['--evm', 'petersburg', resolve(__dirname + '/examples_0/assert_ok_test.sol')]) // match initial lines expect(res.stdout.toString().trim().includes('EVM set to petersburg')).toBeTruthy() expect(res.stdout.toString().trim()).toMatch(/:: Running remix-tests - Unit testing for solidity ::/) @@ -90,7 +90,7 @@ Commands: }) test('remix-tests running a test file by enabling optimization', () => { - const res = spawnSync(executablePath, ['--optimize', 'true', resolve(__dirname + '/examples_0/assert_ok_without_console_test.sol')]) + const res = spawnSync(executablePath, ['--optimize', 'true', resolve(__dirname + '/examples_0/assert_ok_test.sol')]) // match initial lines expect(res.stdout.toString().trim().includes('Optimization is enabled')).toBeTruthy() expect(res.stdout.toString().trim()).toMatch(/:: Running remix-tests - Unit testing for solidity ::/) @@ -103,7 +103,7 @@ Commands: }) test('remix-tests running a test file by enabling optimization and setting runs', () => { - const res = spawnSync(executablePath, ['--optimize', 'true', '--runs', '300', resolve(__dirname + '/examples_0/assert_ok_without_console_test.sol')]) + const res = spawnSync(executablePath, ['--optimize', 'true', '--runs', '300', resolve(__dirname + '/examples_0/assert_ok_test.sol')]) // match initial lines expect(res.stdout.toString().trim().includes('Optimization is enabled')).toBeTruthy() expect(res.stdout.toString().trim().includes('Runs set to 300')).toBeTruthy() @@ -117,13 +117,13 @@ Commands: }) test('remix-tests running a test file without enabling optimization and setting runs (should fail)', () => { - const res = spawnSync(executablePath, ['--runs', '300', resolve(__dirname + '/examples_0/assert_ok_without_console_test.sol')]) + const res = spawnSync(executablePath, ['--runs', '300', resolve(__dirname + '/examples_0/assert_ok_test.sol')]) // match initial lines expect(res.stdout.toString().trim().includes('Optimization should be enabled for runs')).toBeTruthy() }) test('remix-tests running a test file with all options', () => { - const res = spawnSync(executablePath, ['--compiler', '0.7.5', '--evm', 'istanbul', '--optimize', 'true', '--runs', '250', resolve(__dirname + '/examples_0/assert_ok_without_console_test.sol')]) + const res = spawnSync(executablePath, ['--compiler', '0.7.5', '--evm', 'istanbul', '--optimize', 'true', '--runs', '250', resolve(__dirname + '/examples_0/assert_ok_test.sol')]) // match initial lines expect(res.stdout.toString().trim().includes('Compiler version set to 0.7.5. Latest version is')).toBeTruthy() expect(res.stdout.toString().trim().includes('Loading remote solc version v0.7.5+commit.eb77ed08 ...')).toBeTruthy() diff --git a/libs/remix-tests/tests/testRunner.spec.ts b/libs/remix-tests/tests/testRunner.spec.ts index 2f6d363a31..34c1067ee0 100644 --- a/libs/remix-tests/tests/testRunner.spec.ts +++ b/libs/remix-tests/tests/testRunner.spec.ts @@ -129,7 +129,7 @@ describe('testRunner', () => { { type: 'accountList', value: accounts }, { type: 'contract', value: 'AssertOkTest', filename: __dirname + '/examples_0/assert_ok_test.sol' }, { type: 'testPass', debugTxHash: '0x5b665752a4faf83229259b9b2811d3295be0af633b0051d4b90042283ef55707', value: 'Ok pass test', filename: __dirname + '/examples_0/assert_ok_test.sol', context: 'AssertOkTest', hhLogs: hhLogs1 }, - { type: 'testFailure', debugTxHash: '0xa0a30ad042a7fc3495f72be7ba788d705888ffbbec7173f60bb27e07721510f2',value: 'Ok fail test', filename: __dirname + '/examples_0/assert_ok_test.sol', errMsg: 'okFailTest fails', context: 'AssertOkTest', hhLogs: hhLogs2, assertMethod: 'ok', location: '370:36:0', expected: 'true', returned: 'false'}, + { type: 'testFailure', debugTxHash: '0xa0a30ad042a7fc3495f72be7ba788d705888ffbbec7173f60bb27e07721510f2',value: 'Ok fail test', filename: __dirname + '/examples_0/assert_ok_test.sol', errMsg: 'okFailTest fails', context: 'AssertOkTest', hhLogs: hhLogs2, assertMethod: 'ok', location: '368:36:0', expected: 'true', returned: 'false'}, ], ['time', 'web3']) }) From 662976163b438eb6e26c8f46bb47c9feb34c5cc2 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 2 Aug 2022 15:44:30 +0530 Subject: [PATCH 055/179] show logs from contract --- libs/remix-tests/src/run.ts | 4 ++-- libs/remix-tests/src/runTestFiles.ts | 22 ++++++++++++++++--- .../tests/examples_0/assert_ok_test.sol | 2 -- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/libs/remix-tests/src/run.ts b/libs/remix-tests/src/run.ts index 45b89df5e7..ef4c1cfb4d 100644 --- a/libs/remix-tests/src/run.ts +++ b/libs/remix-tests/src/run.ts @@ -4,7 +4,7 @@ import path from 'path' import axios, { AxiosResponse } from 'axios' import { runTestFiles } from './runTestFiles' import fs from './fileSystem' -import { Provider } from '@remix-project/remix-simulator' +import { Provider, extend } from '@remix-project/remix-simulator' import { CompilerConfiguration } from './types' import Log from './logger' import colors from 'colors' @@ -115,7 +115,7 @@ commander const provider: any = new Provider() await provider.init() web3.setProvider(provider) - + extend(web3) runTestFiles(path.resolve(testsPath), isDirectory, web3, compilerConfig) }) diff --git a/libs/remix-tests/src/runTestFiles.ts b/libs/remix-tests/src/runTestFiles.ts index ebaaf27f98..3c9ef46ce4 100644 --- a/libs/remix-tests/src/runTestFiles.ts +++ b/libs/remix-tests/src/runTestFiles.ts @@ -4,7 +4,7 @@ import { runTest } from './testRunner' import { TestResultInterface, ResultsInterface, CompilerConfiguration, compilationInterface, ASTInterface, Options, AstNode } from './types' import colors from 'colors' import Web3 from 'web3' - +import { format } from 'util' import { compileFileOrFiles } from './compiler' import { deployAll } from './deployer' @@ -22,6 +22,15 @@ export function runTestFiles (filepath: string, isDirectory: boolean, web3: Web3 opts = opts || {} compilerConfig = compilerConfig || {} as CompilerConfiguration const sourceASTs: any = {} + const printLog = (log: string[]) => { + let formattedLog + if (typeof log[0] === 'string' && (log[0].includes('%s') || log[0].includes('%d'))) { + formattedLog = format(log[0], ...log.slice(1)) + } else { + formattedLog = log.join(' ') + } + signale.log(formattedLog) + } const { Signale } = require('signale') // eslint-disable-line // signale configuration const options = { @@ -36,6 +45,11 @@ export function runTestFiles (filepath: string, isDirectory: boolean, web3: Web3 label: '', color: 'white' }, + log: { + badge: '\t', + label: '', + color: 'white' + }, error: { badge: '\t✘', label: '', @@ -111,8 +125,10 @@ export function runTestFiles (filepath: string, isDirectory: boolean, web3: Web3 if (result.type === 'contract') { signale.name(result.value.white) } else if (result.type === 'testPass') { - signale.result(result.value) + if (result?.hhLogs?.length) result.hhLogs.forEach(printLog) + signale.result(result.value.green) } else if (result.type === 'testFailure') { + if (result?.hhLogs?.length) result.hhLogs.forEach(printLog) signale.error(result.value.red) errors.push(result) } @@ -127,7 +143,7 @@ export function runTestFiles (filepath: string, isDirectory: boolean, web3: Web3 async.eachOfLimit(contractsToTest, 1, (contractName: string, index, cb) => { try { const fileAST: AstNode = sourceASTs[contracts[contractName]['filename']] - runTest(contractName, contracts[contractName], contractsToTestDetails[index], fileAST, { accounts }, _testCallback, (err, result) => { + runTest(contractName, contracts[contractName], contractsToTestDetails[index], fileAST, { accounts, web3 }, _testCallback, (err, result) => { if (err) { console.log(err) return cb(err) diff --git a/libs/remix-tests/tests/examples_0/assert_ok_test.sol b/libs/remix-tests/tests/examples_0/assert_ok_test.sol index 52d0088e6a..497d0dd7ec 100644 --- a/libs/remix-tests/tests/examples_0/assert_ok_test.sol +++ b/libs/remix-tests/tests/examples_0/assert_ok_test.sol @@ -1,6 +1,4 @@ import "remix_tests.sol"; // this import is automatically injected by Remix. - - import "hardhat/console.sol"; contract AssertOkTest { From cd6a32b8c7b209db701ad7e01036661db5c93258 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 2 Aug 2022 15:59:01 +0530 Subject: [PATCH 056/179] unit tests --- libs/remix-tests/tests/testRunner.cli.spec.ts | 2 ++ libs/remix-tests/tests/testRunner.spec.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/remix-tests/tests/testRunner.cli.spec.ts b/libs/remix-tests/tests/testRunner.cli.spec.ts index 6f412dcc40..c3d9af8d74 100644 --- a/libs/remix-tests/tests/testRunner.cli.spec.ts +++ b/libs/remix-tests/tests/testRunner.cli.spec.ts @@ -48,7 +48,9 @@ Commands: expect(res.stdout.toString().trim()).toMatch(/creation of library remix_tests.sol:Assert pending.../) // match test result expect(res.stdout.toString().trim()).toMatch(/AssertOkTest/) + expect(res.stdout.toString().trim()).toMatch(/AssertOkTest okPassTest/) // check if console.log is printed expect(res.stdout.toString().trim()).toMatch(/Ok pass test/) + expect(res.stdout.toString().trim()).toMatch(/AssertOkTest okFailTest/) // check if console.log is printed expect(res.stdout.toString().trim()).toMatch(/Ok fail test/) // match fail test details expect(res.stdout.toString().trim()).toMatch(/error: okFailTest fails/) diff --git a/libs/remix-tests/tests/testRunner.spec.ts b/libs/remix-tests/tests/testRunner.spec.ts index 34c1067ee0..c475914522 100644 --- a/libs/remix-tests/tests/testRunner.spec.ts +++ b/libs/remix-tests/tests/testRunner.spec.ts @@ -129,7 +129,7 @@ describe('testRunner', () => { { type: 'accountList', value: accounts }, { type: 'contract', value: 'AssertOkTest', filename: __dirname + '/examples_0/assert_ok_test.sol' }, { type: 'testPass', debugTxHash: '0x5b665752a4faf83229259b9b2811d3295be0af633b0051d4b90042283ef55707', value: 'Ok pass test', filename: __dirname + '/examples_0/assert_ok_test.sol', context: 'AssertOkTest', hhLogs: hhLogs1 }, - { type: 'testFailure', debugTxHash: '0xa0a30ad042a7fc3495f72be7ba788d705888ffbbec7173f60bb27e07721510f2',value: 'Ok fail test', filename: __dirname + '/examples_0/assert_ok_test.sol', errMsg: 'okFailTest fails', context: 'AssertOkTest', hhLogs: hhLogs2, assertMethod: 'ok', location: '368:36:0', expected: 'true', returned: 'false'}, + { type: 'testFailure', debugTxHash: '0xa0a30ad042a7fc3495f72be7ba788d705888ffbbec7173f60bb27e07721510f2',value: 'Ok fail test', filename: __dirname + '/examples_0/assert_ok_test.sol', errMsg: 'okFailTest fails', context: 'AssertOkTest', hhLogs: hhLogs2, assertMethod: 'ok', location: '366:36:0', expected: 'true', returned: 'false'}, ], ['time', 'web3']) }) From f7e5633ccb21a46647be04d58fd4c01c9f021fd2 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 2 Aug 2022 16:00:54 +0530 Subject: [PATCH 057/179] update title --- libs/remix-tests/src/run.ts | 2 +- libs/remix-tests/tests/testRunner.cli.spec.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/remix-tests/src/run.ts b/libs/remix-tests/src/run.ts index ef4c1cfb4d..9225c31aee 100644 --- a/libs/remix-tests/src/run.ts +++ b/libs/remix-tests/src/run.ts @@ -68,7 +68,7 @@ commander } // Console message - console.log(colors.white('\n\t👁\t:: Running remix-tests - Unit testing for solidity ::\t👁\n')) + console.log(colors.white('\n\t👁\t:: Running tests using remix-tests ::\t👁\n')) // Set logger verbosity if (commander.verbose) { diff --git a/libs/remix-tests/tests/testRunner.cli.spec.ts b/libs/remix-tests/tests/testRunner.cli.spec.ts index c3d9af8d74..93b6d5f7f9 100644 --- a/libs/remix-tests/tests/testRunner.cli.spec.ts +++ b/libs/remix-tests/tests/testRunner.cli.spec.ts @@ -44,7 +44,7 @@ Commands: test('remix-tests running a test file', () => { const res = spawnSync(executablePath, [resolve(__dirname + '/examples_0/assert_ok_test.sol')]) // match initial lines - expect(res.stdout.toString().trim()).toMatch(/:: Running remix-tests - Unit testing for solidity ::/) + expect(res.stdout.toString().trim()).toMatch(/:: Running tests using remix-tests ::/) expect(res.stdout.toString().trim()).toMatch(/creation of library remix_tests.sol:Assert pending.../) // match test result expect(res.stdout.toString().trim()).toMatch(/AssertOkTest/) @@ -63,7 +63,7 @@ Commands: // match initial lines expect(res.stdout.toString().trim().includes('Compiler version set to 0.7.4. Latest version is')).toBeTruthy() expect(res.stdout.toString().trim().includes('Loading remote solc version v0.7.4+commit.3f05b770 ...')).toBeTruthy() - expect(res.stdout.toString().trim()).toMatch(/:: Running remix-tests - Unit testing for solidity ::/) + expect(res.stdout.toString().trim()).toMatch(/:: Running tests using remix-tests ::/) expect(res.stdout.toString().trim()).toMatch(/creation of library remix_tests.sol:Assert pending.../) // match test result expect(res.stdout.toString().trim()).toMatch(/Ok pass test/) @@ -82,7 +82,7 @@ Commands: const res = spawnSync(executablePath, ['--evm', 'petersburg', resolve(__dirname + '/examples_0/assert_ok_test.sol')]) // match initial lines expect(res.stdout.toString().trim().includes('EVM set to petersburg')).toBeTruthy() - expect(res.stdout.toString().trim()).toMatch(/:: Running remix-tests - Unit testing for solidity ::/) + expect(res.stdout.toString().trim()).toMatch(/:: Running tests using remix-tests ::/) expect(res.stdout.toString().trim()).toMatch(/creation of library remix_tests.sol:Assert pending.../) // match test result expect(res.stdout.toString().trim()).toMatch(/Ok pass test/) @@ -95,7 +95,7 @@ Commands: const res = spawnSync(executablePath, ['--optimize', 'true', resolve(__dirname + '/examples_0/assert_ok_test.sol')]) // match initial lines expect(res.stdout.toString().trim().includes('Optimization is enabled')).toBeTruthy() - expect(res.stdout.toString().trim()).toMatch(/:: Running remix-tests - Unit testing for solidity ::/) + expect(res.stdout.toString().trim()).toMatch(/:: Running tests using remix-tests ::/) expect(res.stdout.toString().trim()).toMatch(/creation of library remix_tests.sol:Assert pending.../) // match test result expect(res.stdout.toString().trim()).toMatch(/Ok pass test/) @@ -109,7 +109,7 @@ Commands: // match initial lines expect(res.stdout.toString().trim().includes('Optimization is enabled')).toBeTruthy() expect(res.stdout.toString().trim().includes('Runs set to 300')).toBeTruthy() - expect(res.stdout.toString().trim()).toMatch(/:: Running remix-tests - Unit testing for solidity ::/) + expect(res.stdout.toString().trim()).toMatch(/:: Running tests using remix-tests ::/) expect(res.stdout.toString().trim()).toMatch(/creation of library remix_tests.sol:Assert pending.../) // match test result expect(res.stdout.toString().trim()).toMatch(/Ok pass test/) @@ -132,7 +132,7 @@ Commands: expect(res.stdout.toString().trim().includes('EVM set to istanbul')).toBeTruthy() expect(res.stdout.toString().trim().includes('Optimization is enabled')).toBeTruthy() expect(res.stdout.toString().trim().includes('Runs set to 250')).toBeTruthy() - expect(res.stdout.toString().trim()).toMatch(/:: Running remix-tests - Unit testing for solidity ::/) + expect(res.stdout.toString().trim()).toMatch(/:: Running tests using remix-tests ::/) expect(res.stdout.toString().trim()).toMatch(/creation of library remix_tests.sol:Assert pending.../) // match test result expect(res.stdout.toString().trim()).toMatch(/Ok pass test/) From db601707fc8a81ee4568a6f2efeabe11fb83188f Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 2 Aug 2022 17:59:29 +0530 Subject: [PATCH 058/179] update tests output --- libs/remix-tests/src/run.ts | 2 +- libs/remix-tests/src/runTestFiles.ts | 38 +++++++++---------- libs/remix-tests/tests/testRunner.cli.spec.ts | 16 ++++---- 3 files changed, 27 insertions(+), 29 deletions(-) diff --git a/libs/remix-tests/src/run.ts b/libs/remix-tests/src/run.ts index 9225c31aee..d428b2d6f2 100644 --- a/libs/remix-tests/src/run.ts +++ b/libs/remix-tests/src/run.ts @@ -68,7 +68,7 @@ commander } // Console message - console.log(colors.white('\n\t👁\t:: Running tests using remix-tests ::\t👁\n')) + console.log(colors.bold('\n\t👁\t:: Running tests using remix-tests ::\t👁\n')) // Set logger verbosity if (commander.verbose) { diff --git a/libs/remix-tests/src/runTestFiles.ts b/libs/remix-tests/src/runTestFiles.ts index 3c9ef46ce4..143f38e45c 100644 --- a/libs/remix-tests/src/runTestFiles.ts +++ b/libs/remix-tests/src/runTestFiles.ts @@ -43,7 +43,7 @@ export function runTestFiles (filepath: string, isDirectory: boolean, web3: Web3 name: { badge: '\n\t◼', label: '', - color: 'white' + color: 'whiteBright' }, log: { badge: '\t', @@ -118,19 +118,24 @@ export function runTestFiles (filepath: string, isDirectory: boolean, web3: Web3 let totalPassing = 0 let totalFailing = 0 let totalTime = 0 - const errors: any[] = [] const _testCallback = function (err: Error | null | undefined, result: TestResultInterface) { if (err) throw err if (result.type === 'contract') { - signale.name(result.value.white) + signale.name(result.value) + console.log('\n') } else if (result.type === 'testPass') { if (result?.hhLogs?.length) result.hhLogs.forEach(printLog) - signale.result(result.value.green) + signale.result(result.value.white) } else if (result.type === 'testFailure') { if (result?.hhLogs?.length) result.hhLogs.forEach(printLog) - signale.error(result.value.red) - errors.push(result) + signale.error(result.value.white) + if (result.assertMethod) { + console.log(colors.green('\t Expected value should be ' + result.assertMethod + ' to: ' + result.expected)) + console.log(colors.red('\t Received: ' + result.returned)) + } + console.log(colors.red('\t Message: ' + result.errMsg)) + console.log('\n') } } const _resultsCallback = (_err: Error | null | undefined, result: ResultsInterface, cb) => { @@ -157,23 +162,16 @@ export function runTestFiles (filepath: string, isDirectory: boolean, web3: Web3 if (err) { return next(err) } - console.log('\n') - if (totalPassing > 0) { - console.log(colors.green(totalPassing + ' passing ') + colors.grey('(' + totalTime + 's)')) + console.log(colors.bold.underline('Tests Summary: ')) + + if (totalPassing >= 0) { + console.log(colors.green('Passed: ' + totalPassing)) } - if (totalFailing > 0) { - console.log(colors.red(totalFailing + ' failing')) + if (totalFailing >= 0) { + console.log(colors.red('Failed: ' + totalFailing)) } - console.log('') - - errors.forEach((error, index) => { - console.log(' ' + (index + 1) + ') ' + colors.bold(error.context + ': ') + error.value) - console.log('') - console.log(colors.red('\t error: ' + error.errMsg)) - console.log(colors.green('\t expected value to be ' + error.assertMethod + ' to: ' + error.expected)) - console.log(colors.red('\t returned: ' + error.returned)) - }) + console.log(colors.white('Time Taken: ' + totalTime + 's')) console.log('') next() diff --git a/libs/remix-tests/tests/testRunner.cli.spec.ts b/libs/remix-tests/tests/testRunner.cli.spec.ts index 93b6d5f7f9..a7b9953dd9 100644 --- a/libs/remix-tests/tests/testRunner.cli.spec.ts +++ b/libs/remix-tests/tests/testRunner.cli.spec.ts @@ -53,9 +53,9 @@ Commands: expect(res.stdout.toString().trim()).toMatch(/AssertOkTest okFailTest/) // check if console.log is printed expect(res.stdout.toString().trim()).toMatch(/Ok fail test/) // match fail test details - expect(res.stdout.toString().trim()).toMatch(/error: okFailTest fails/) - expect(res.stdout.toString().trim()).toMatch(/expected value to be ok to: true/) - expect(res.stdout.toString().trim()).toMatch(/returned: false/) + expect(res.stdout.toString().trim()).toMatch(/Expected value should be ok to: true/) + expect(res.stdout.toString().trim()).toMatch(/Received: false/) + expect(res.stdout.toString().trim()).toMatch(/Message: okFailTest fails/) }) test('remix-tests running a test file with custom compiler version', () => { @@ -69,7 +69,7 @@ Commands: expect(res.stdout.toString().trim()).toMatch(/Ok pass test/) expect(res.stdout.toString().trim()).toMatch(/Ok fail test/) // match fail test details - expect(res.stdout.toString().trim()).toMatch(/error: okFailTest fails/) + expect(res.stdout.toString().trim()).toMatch(/Message: okFailTest fails/) }) test('remix-tests running a test file with unavailable custom compiler version (should fail)', () => { @@ -88,7 +88,7 @@ Commands: expect(res.stdout.toString().trim()).toMatch(/Ok pass test/) expect(res.stdout.toString().trim()).toMatch(/Ok fail test/) // match fail test details - expect(res.stdout.toString().trim()).toMatch(/error: okFailTest fails/) + expect(res.stdout.toString().trim()).toMatch(/Message: okFailTest fails/) }) test('remix-tests running a test file by enabling optimization', () => { @@ -101,7 +101,7 @@ Commands: expect(res.stdout.toString().trim()).toMatch(/Ok pass test/) expect(res.stdout.toString().trim()).toMatch(/Ok fail test/) // match fail test details - expect(res.stdout.toString().trim()).toMatch(/error: okFailTest fails/) + expect(res.stdout.toString().trim()).toMatch(/Message: okFailTest fails/) }) test('remix-tests running a test file by enabling optimization and setting runs', () => { @@ -115,7 +115,7 @@ Commands: expect(res.stdout.toString().trim()).toMatch(/Ok pass test/) expect(res.stdout.toString().trim()).toMatch(/Ok fail test/) // match fail test details - expect(res.stdout.toString().trim()).toMatch(/error: okFailTest fails/) + expect(res.stdout.toString().trim()).toMatch(/Message: okFailTest fails/) }) test('remix-tests running a test file without enabling optimization and setting runs (should fail)', () => { @@ -138,7 +138,7 @@ Commands: expect(res.stdout.toString().trim()).toMatch(/Ok pass test/) expect(res.stdout.toString().trim()).toMatch(/Ok fail test/) // match fail test details - expect(res.stdout.toString().trim()).toMatch(/error: okFailTest fails/) + expect(res.stdout.toString().trim()).toMatch(/Message: okFailTest fails/) }) }) }) \ No newline at end of file From 10c337b5a89caf0f377e293d1eb378a426959a00 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 2 Aug 2022 11:27:24 +0200 Subject: [PATCH 059/179] use detectNetwork instead of ready --- apps/remix-ide/src/app/tabs/abstract-provider.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/tabs/abstract-provider.tsx b/apps/remix-ide/src/app/tabs/abstract-provider.tsx index 31b1a4e317..ae923bd88b 100644 --- a/apps/remix-ide/src/app/tabs/abstract-provider.tsx +++ b/apps/remix-ide/src/app/tabs/abstract-provider.tsx @@ -101,7 +101,7 @@ export abstract class AbstractProvider extends Plugin { reject('Unable to connect') } }, 2000) - await this.provider.ready + await this.provider.detectNetwork() // this throws if the network cannot be detected this.connected = true } catch (e) { this.switchAway(true) @@ -116,6 +116,7 @@ export abstract class AbstractProvider extends Plugin { } private async switchAway (showError) { + if (!this.provider) return this.provider = null this.blocked = true this.connected = false From cffd9bf8fdb5ba05a73e22b2c7de47149a830d09 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 2 Aug 2022 09:48:34 +0200 Subject: [PATCH 060/179] use latest code to parse input parameters --- libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx index 06ccd60f2e..c5f6f394ce 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx @@ -138,12 +138,10 @@ export function ContractGUI (props: ContractGUIProps) { } const makeMultiVal = () => { - let inputString = basicInput + const inputString = basicInput if (inputString) { - inputString = inputString.replace(/(^|,\s+|,)(\d+)(\s+,|,|$)/g, '$1"$2"$3') // replace non quoted number by quoted number - inputString = inputString.replace(/(^|,\s+|,)(0[xX][0-9a-fA-F]+)(\s+,|,|$)/g, '$1"$2"$3') // replace non quoted hex string by quoted hex string - const inputJSON = JSON.parse('[' + inputString + ']') + const inputJSON = remixLib.execution.txFormat.parseFunctionParams(inputString) const multiInputs = multiFields.current for (let k = 0; k < multiInputs.length; k++) { From 4a86d87a85f0a30463b54c71f4b19eff4022e795 Mon Sep 17 00:00:00 2001 From: yann300 Date: Sun, 10 Jul 2022 13:32:45 +0200 Subject: [PATCH 061/179] add vyper --- apps/vyper/.babelrc | 13 + apps/vyper/.browserslistrc | 16 + apps/vyper/.eslintrc | 18 + apps/vyper/src/app/app.css | 124 +++++ apps/vyper/src/app/app.tsx | 118 +++++ .../src/app/components/CompilerButton.tsx | 75 +++ apps/vyper/src/app/components/LocalUrl.tsx | 36 ++ apps/vyper/src/app/components/VyperResult.tsx | 70 +++ apps/vyper/src/app/components/WarnRemote.tsx | 19 + apps/vyper/src/app/examples/ballot.tsx | 161 ++++++ apps/vyper/src/app/logo.svg | 14 + apps/vyper/src/app/star.svg | 11 + apps/vyper/src/app/utils/compiler.tsx | 139 +++++ apps/vyper/src/app/utils/index.ts | 12 + apps/vyper/src/app/utils/remix-client.tsx | 71 +++ apps/vyper/src/assets/.gitkeep | 0 .../src/environments/environment.prod.ts | 3 + apps/vyper/src/environments/environment.ts | 6 + apps/vyper/src/favicon.ico | Bin 0 -> 15086 bytes apps/vyper/src/index.html | 14 + apps/vyper/src/main.tsx | 7 + apps/vyper/src/polyfills.ts | 7 + apps/vyper/src/styles.css | 1 + apps/vyper/tsconfig.app.json | 14 + apps/vyper/tsconfig.json | 20 + .../copy-to-clipboard/copy-to-clipboard.tsx | 2 +- nx.json | 44 +- package.json | 1 + workspace.json | 498 ++++++++++++++---- yarn.lock | 137 ++++- 30 files changed, 1522 insertions(+), 129 deletions(-) create mode 100644 apps/vyper/.babelrc create mode 100644 apps/vyper/.browserslistrc create mode 100644 apps/vyper/.eslintrc create mode 100644 apps/vyper/src/app/app.css create mode 100644 apps/vyper/src/app/app.tsx create mode 100644 apps/vyper/src/app/components/CompilerButton.tsx create mode 100644 apps/vyper/src/app/components/LocalUrl.tsx create mode 100644 apps/vyper/src/app/components/VyperResult.tsx create mode 100644 apps/vyper/src/app/components/WarnRemote.tsx create mode 100644 apps/vyper/src/app/examples/ballot.tsx create mode 100644 apps/vyper/src/app/logo.svg create mode 100644 apps/vyper/src/app/star.svg create mode 100644 apps/vyper/src/app/utils/compiler.tsx create mode 100644 apps/vyper/src/app/utils/index.ts create mode 100644 apps/vyper/src/app/utils/remix-client.tsx create mode 100644 apps/vyper/src/assets/.gitkeep create mode 100644 apps/vyper/src/environments/environment.prod.ts create mode 100644 apps/vyper/src/environments/environment.ts create mode 100644 apps/vyper/src/favicon.ico create mode 100644 apps/vyper/src/index.html create mode 100644 apps/vyper/src/main.tsx create mode 100644 apps/vyper/src/polyfills.ts create mode 100644 apps/vyper/src/styles.css create mode 100644 apps/vyper/tsconfig.app.json create mode 100644 apps/vyper/tsconfig.json diff --git a/apps/vyper/.babelrc b/apps/vyper/.babelrc new file mode 100644 index 0000000000..b1fc975456 --- /dev/null +++ b/apps/vyper/.babelrc @@ -0,0 +1,13 @@ +{ + "presets": [ + [ + "@nrwl/react/babel", { + "runtime": "automatic" + + } + ] + ], + "plugins": [ + + ] +} diff --git a/apps/vyper/.browserslistrc b/apps/vyper/.browserslistrc new file mode 100644 index 0000000000..f1d12df4fa --- /dev/null +++ b/apps/vyper/.browserslistrc @@ -0,0 +1,16 @@ +# This file is used by: +# 1. autoprefixer to adjust CSS to support the below specified browsers +# 2. babel preset-env to adjust included polyfills +# +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries +# +# If you need to support different browsers in production, you may tweak the list below. + +last 1 Chrome version +last 1 Firefox version +last 2 Edge major versions +last 2 Safari major version +last 2 iOS major versions +Firefox ESR +not IE 9-11 # For IE 9-11 support, remove 'not'. \ No newline at end of file diff --git a/apps/vyper/.eslintrc b/apps/vyper/.eslintrc new file mode 100644 index 0000000000..b7d498eea1 --- /dev/null +++ b/apps/vyper/.eslintrc @@ -0,0 +1,18 @@ +{ + "env": { + "browser": true, + "es6": true + }, + "extends": "../../.eslintrc.json", + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 11, + "sourceType": "module" + }, + "rules": { + "standard/no-callback-literal": "off" + } +} diff --git a/apps/vyper/src/app/app.css b/apps/vyper/src/app/app.css new file mode 100644 index 0000000000..978406926a --- /dev/null +++ b/apps/vyper/src/app/app.css @@ -0,0 +1,124 @@ +* { + box-sizing: border-box; +} +html, body, #root, main { + height: 100%; + margin: 0; +} + +#vyper-plugin header { + display: flex; + justify-content: space-between; + align-items: center; + height: 50px; + padding: 5px 15px; +} + +#vyper-plugin header a, +#vyper-plugin header .title { + display: flex; + height: 60%; +} + +#vyper-plugin header svg, +#vyper-plugin header img { + width: auto; + height: 100%; +} + +#vyper-plugin section { + display: flex; + flex-direction: column; + align-items: center; + height: calc(100% - 50px); +} + +.btn-group-toggle { + width: 90%; + text-transform: uppercase; + margin: 10px 0; +} + +.btn-group-toggle .btn { + cursor: pointer; + font-size: 0.8rem; +} + +#local-url { + width: 90%; +} + +#compile-btn { + width: 90%; +} + +#compile-btn * { + width: 100%; +} + +#result { + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 100%; + padding-top: 10px; + overflow: hidden; +} + +#result.error { + justify-content: flex-start; +} +#result.error svg { + width: 40px; + height: 40px; + margin: 10px; +} + +#result nav { + width: 100%; + flex-wrap: nowrap; + justify-content: space-evenly; +} + + +#result nav a { + padding: 0.5rem 1rem; + font-size: 0.8rem; +} + +#result .tab-content { + flex: 1; + width: 100%; + padding: 15px; + overflow: auto; +} + +#result .tab-pane.active { + height: 100%; + display: flex; + flex-direction: column; + align-items: stretch; +} + +#result .copy { + padding: 5x; + font-size: 0.8rem; + margin: 10px; +} + +#result p { + text-align: center; + width: 100% !important; +} + +#result .react-json-view { + overflow-y: auto; +} + +#result textarea { + border: none; + height: 100%; + width: 100%; +} \ No newline at end of file diff --git a/apps/vyper/src/app/app.tsx b/apps/vyper/src/app/app.tsx new file mode 100644 index 0000000000..2b06263214 --- /dev/null +++ b/apps/vyper/src/app/app.tsx @@ -0,0 +1,118 @@ +import React, { useState, useEffect } from 'react' + +import { VyperCompilationOutput, remixClient } from './utils' +import { CompilationResult } from '@remixproject/plugin-api' + +// Components +import CompilerButton from './components/CompilerButton' +import WarnRemote from './components/WarnRemote' +import VyperResult from './components/VyperResult' +import LocalUrlInput from './components/LocalUrl' +import ToggleButtonGroup from 'react-bootstrap/ToggleButtonGroup' +import ToggleButton from 'react-bootstrap/ToggleButton' + +import vyperLogo from './logo.svg' +import './app.css' + +interface AppState { + status: 'idle' | 'inProgress' + environment: 'remote' | 'local' + compilationResult?: CompilationResult + localUrl: string +} + +interface OutputMap { + [fileName: string]: VyperCompilationOutput +} + +const App: React.FC = () => { + const [contract, setContract] = useState() + const [output, setOutput] = useState({}) + const [state, setState] = useState({ + status: 'idle', + environment: 'local', + localUrl: 'http://localhost:8000/compile' + }) + + useEffect(() => { + async function start() { + try { + await remixClient.loaded() + remixClient.onFileChange(name => setContract(name)) + const name = await remixClient.getContractName() + setContract(name) + } catch (err) { + console.log(err) + } + } + start() + }, []) + + /** Update the environment state value */ + function setEnvironment(environment: 'local' | 'remote') { + setState({ ...state, environment }) + } + + function setLocalUrl(url: string) { + setState({ ...state, localUrl: url }) + } + + function compilerUrl() { + return state.environment === 'remote' + ? 'https://vyper.live/compile' + : state.localUrl + } + + return ( +
+
+
+ Vyper logo +

yper Compiler

+
+ + + +
+
+ + + Remote Compiler + + + Local Compiler + + + + +
+ + setOutput({ ...output, [name]: update }) + } + /> +
+
+ +
+
+
+ ) +} + +export default App diff --git a/apps/vyper/src/app/components/CompilerButton.tsx b/apps/vyper/src/app/components/CompilerButton.tsx new file mode 100644 index 0000000000..8c59abf3cb --- /dev/null +++ b/apps/vyper/src/app/components/CompilerButton.tsx @@ -0,0 +1,75 @@ +import React from 'react' +import { + isVyper, + compile, + toStandardOutput, + VyperCompilationOutput, + isCompilationError, + remixClient +} from '../utils' +import Button from 'react-bootstrap/Button' + +interface Props { + compilerUrl: string + contract?: string, + setOutput: (name: string, output: VyperCompilationOutput) => void +} + +function CompilerButton({ contract, setOutput, compilerUrl }: Props) { + + if (!contract || !contract) { + return + } + + if (!isVyper(contract)) { + return + } + + /** Compile a Contract */ + async function compileContract() { + try { + const _contract = await remixClient.getContract() + remixClient.changeStatus({ + key: 'loading', + type: 'info', + title: 'Compiling' + }) + const output = await compile(compilerUrl, _contract) + setOutput(_contract.name, output) + // ERROR + if (isCompilationError(output)) { + const line = output.line + const lineColumnPos = { + start: { line: line - 1 }, + end: { line: line - 1 } + } + remixClient.highlight(lineColumnPos as any, _contract.name, '#e0b4b4') + throw new Error(output.message) + } + // SUCCESS + remixClient.discardHighlight() + remixClient.changeStatus({ + key: 'succeed', + type: 'success', + title: 'succeed' + }) + const data = toStandardOutput(_contract.name, output) + remixClient.compilationFinish(_contract.name, _contract.content, data) + } catch (err: any) { + remixClient.changeStatus({ + key: 'failed', + type: 'error', + title: err.message + }) + console.error(err) + } + } + + return ( + + ) +} + +export default CompilerButton diff --git a/apps/vyper/src/app/components/LocalUrl.tsx b/apps/vyper/src/app/components/LocalUrl.tsx new file mode 100644 index 0000000000..3659b4094e --- /dev/null +++ b/apps/vyper/src/app/components/LocalUrl.tsx @@ -0,0 +1,36 @@ +import React from 'react' +import Form from 'react-bootstrap/Form' + +interface Props { + url: string + setUrl: (url: string) => void, + environment: 'remote' | 'local' +} + +function LocalUrlInput({ url, setUrl, environment }: Props) { + + if (environment === 'remote') { + return <> + } + + function updateUrl(event: React.FocusEvent) { + setUrl(event.target.value) + } + + return ( +
+ + Local Compiler Url + + + The url to your local compiler + + +
+ ) +} + +export default LocalUrlInput; \ No newline at end of file diff --git a/apps/vyper/src/app/components/VyperResult.tsx b/apps/vyper/src/app/components/VyperResult.tsx new file mode 100644 index 0000000000..b6fd49b69f --- /dev/null +++ b/apps/vyper/src/app/components/VyperResult.tsx @@ -0,0 +1,70 @@ +import React, { useState } from 'react'; +import { + VyperCompilationResult, + VyperCompilationOutput, + isCompilationError, + remixClient +} from '../utils'; +import Tabs from 'react-bootstrap/Tabs' +import Tab from 'react-bootstrap/Tab' +import { Ballot } from '../examples/ballot'; +import Button from 'react-bootstrap/Button'; +import JSONTree from 'react-json-view' +import { CopyToClipboard } from '@remix-ui/clipboard' + + +interface VyperResultProps { + output?: VyperCompilationOutput; +} + +function VyperResult({ output }: VyperResultProps) { + const [ active, setActive ] = useState('abi'); + + if (!output) return ( +
+

No contract compiled yet.

+ +
+ ) + + if (isCompilationError(output)) { + return ( +
+ +

{output.message}

+
) + } + + return ( + setActive(key)}> + + JSON.stringify(output.abi)}> + + + + + + output.bytecode}> + + + + + + output.bytecode_runtime}> + + + + + + output.ir}> + + + + + + ); +} + +export default VyperResult; \ No newline at end of file diff --git a/apps/vyper/src/app/components/WarnRemote.tsx b/apps/vyper/src/app/components/WarnRemote.tsx new file mode 100644 index 0000000000..3ece01895b --- /dev/null +++ b/apps/vyper/src/app/components/WarnRemote.tsx @@ -0,0 +1,19 @@ +import React from 'react' + +interface Props { + environment: 'remote' | 'local' +} + +function WarnRemoteLabel({ environment }: Props) { + + if (environment === 'local') { + return <> + } + + return ( +
It is really important to not use the remote compiler for production environment. + Please only use it for testing purpose and prefer to using a local compiler for production like environment.
+ ) +} + +export default WarnRemoteLabel; \ No newline at end of file diff --git a/apps/vyper/src/app/examples/ballot.tsx b/apps/vyper/src/app/examples/ballot.tsx new file mode 100644 index 0000000000..4b368c6fda --- /dev/null +++ b/apps/vyper/src/app/examples/ballot.tsx @@ -0,0 +1,161 @@ +export const Ballot = { + name: 'browser/ballot.vy', + content: `# Voting with delegation. + + # Information about voters + struct Voter: + # weight is accumulated by delegation + weight: int128 + # if true, that person already voted (which includes voting by delegating) + voted: bool + # person delegated to + delegate: address + # index of the voted proposal, which is not meaningful unless 'voted' is True. + vote: int128 + + # Users can create proposals + struct Proposal: + # short name (up to 32 bytes) + name: bytes32 + # number of accumulated votes + voteCount: int128 + + voters: public(map(address, Voter)) + proposals: public(map(int128, Proposal)) + voterCount: public(int128) + chairperson: public(address) + int128Proposals: public(int128) + + + @public + @constant + def delegated(addr: address) -> bool: + return self.voters[addr].delegate != ZERO_ADDRESS + + + @public + @constant + def directlyVoted(addr: address) -> bool: + return self.voters[addr].voted and (self.voters[addr].delegate == ZERO_ADDRESS) + + + # Setup global variables + @public + def __init__(_proposalNames: bytes32[2]): + self.chairperson = msg.sender + self.voterCount = 0 + for i in range(2): + self.proposals[i] = Proposal({ + name: _proposalNames[i], + voteCount: 0 + }) + self.int128Proposals += 1 + + # Give a 'voter' the right to vote on this ballot. + # This may only be called by the 'chairperson'. + @public + def giveRightToVote(voter: address): + # Throws if the sender is not the chairperson. + assert msg.sender == self.chairperson + # Throws if the voter has already voted. + assert not self.voters[voter].voted + # Throws if the voter's voting weight isn't 0. + assert self.voters[voter].weight == 0 + self.voters[voter].weight = 1 + self.voterCount += 1 + + # Used by 'delegate' below, and can be called by anyone. + @public + def forwardWeight(delegate_with_weight_to_forward: address): + assert self.delegated(delegate_with_weight_to_forward) + # Throw if there is nothing to do: + assert self.voters[delegate_with_weight_to_forward].weight > 0 + + target: address = self.voters[delegate_with_weight_to_forward].delegate + for i in range(4): + if self.delegated(target): + target = self.voters[target].delegate + # The following effectively detects cycles of length <= 5, + # in which the delegation is given back to the delegator. + # This could be done for any int128ber of loops, + # or even infinitely with a while loop. + # However, cycles aren't actually problematic for correctness; + # they just result in spoiled votes. + # So, in the production version, this should instead be + # the responsibility of the contract's client, and this + # check should be removed. + assert target != delegate_with_weight_to_forward + else: + # Weight will be moved to someone who directly voted or + # hasn't voted. + break + + weight_to_forward: int128 = self.voters[delegate_with_weight_to_forward].weight + self.voters[delegate_with_weight_to_forward].weight = 0 + self.voters[target].weight += weight_to_forward + + if self.directlyVoted(target): + self.proposals[self.voters[target].vote].voteCount += weight_to_forward + self.voters[target].weight = 0 + + # To reiterate: if target is also a delegate, this function will need + # to be called again, similarly to as above. + + # Delegate your vote to the voter 'to'. + @public + def delegate(to: address): + # Throws if the sender has already voted + assert not self.voters[msg.sender].voted + # Throws if the sender tries to delegate their vote to themselves or to + # the default address value of 0x0000000000000000000000000000000000000000 + # (the latter might not be problematic, but I don't want to think about it). + assert to != msg.sender + assert to != ZERO_ADDRESS + + self.voters[msg.sender].voted = True + self.voters[msg.sender].delegate = to + + # This call will throw if and only if this delegation would cause a loop + # of length <= 5 that ends up delegating back to the delegator. + self.forwardWeight(msg.sender) + + # Give your vote (including votes delegated to you) + # to proposal 'proposals[proposal].name'. + @public + def vote(proposal: int128): + # can't vote twice + assert not self.voters[msg.sender].voted + # can only vote on legitimate proposals + assert proposal < self.int128Proposals + + self.voters[msg.sender].vote = proposal + self.voters[msg.sender].voted = True + + # transfer msg.sender's weight to proposal + self.proposals[proposal].voteCount += self.voters[msg.sender].weight + self.voters[msg.sender].weight = 0 + + # Computes the winning proposal taking all + # previous votes into account. + @public + @constant + def winningProposal() -> int128: + winning_vote_count: int128 = 0 + winning_proposal: int128 = 0 + for i in range(2): + if self.proposals[i].voteCount > winning_vote_count: + winning_vote_count = self.proposals[i].voteCount + winning_proposal = i + return winning_proposal + + # Calls winningProposal() function to get the index + # of the winner contained in the proposals array and then + # returns the name of the winner + @public + @constant + def winnerName() -> bytes32: + return self.proposals[self.winningProposal()].name + + ` + } + \ No newline at end of file diff --git a/apps/vyper/src/app/logo.svg b/apps/vyper/src/app/logo.svg new file mode 100644 index 0000000000..78302e19f4 --- /dev/null +++ b/apps/vyper/src/app/logo.svg @@ -0,0 +1,14 @@ + diff --git a/apps/vyper/src/app/star.svg b/apps/vyper/src/app/star.svg new file mode 100644 index 0000000000..901053d385 --- /dev/null +++ b/apps/vyper/src/app/star.svg @@ -0,0 +1,11 @@ + + + + + diff --git a/apps/vyper/src/app/utils/compiler.tsx b/apps/vyper/src/app/utils/compiler.tsx new file mode 100644 index 0000000000..ebc117dba1 --- /dev/null +++ b/apps/vyper/src/app/utils/compiler.tsx @@ -0,0 +1,139 @@ +import { CompilationResult, ABIDescription } from "@remixproject/plugin-api"; + +export interface Contract { + name: string; + content: string; +} + +export interface VyperCompilationResult { + status: 'success', + bytecode: string, + bytecode_runtime: string, + abi: ABIDescription[], + ir: string, + method_identifiers: { + [method: string]: string + } +} + +export interface VyperCompilationError { + status: 'failed' + column: number + line: number + message: string +} + +export type VyperCompilationOutput = VyperCompilationResult | VyperCompilationError + +/** Check if the output is an error */ +export function isCompilationError(output: VyperCompilationOutput): output is VyperCompilationError { + return output.status === 'failed' +} + +/** + * Compile the a contract + * @param url The url of the compiler + * @param contract The name and content of the contract + */ +export async function compile(url: string, contract: Contract): Promise { + if (!contract.name) { + throw new Error('Set your Vyper contract file.') + } + const extension = contract.name.split('.')[1] + if (extension !== 'vy') { + throw new Error('Use extension .vy for Vyper.') + } + const response = await fetch(url, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ code: contract.content }) + }) + + if (response.status === 404) { + throw new Error(`Vyper compiler not found at "${url}".`) + } + /*if (response.status === 400) { + throw new Error(`Vyper compilation failed: ${response.statusText}`) + }*/ + return response.json() +} + +/** + * Transform Vyper Output to Solidity-like Compiler output + * @param name Name of the contract file + * @param compilationResult Result returned by the compiler + */ +export function toStandardOutput(fileName: string, compilationResult: VyperCompilationResult): CompilationResult { + const contractName = fileName.split('/').slice(-1)[0].split('.')[0]; + const methodIdentifiers = JSON.parse(JSON.stringify(compilationResult['method_identifiers']).replace(/0x/g,'')); + return { + sources: { + [fileName]: { + id: 1, + ast: {} as any, + legacyAST: {} as any + } + }, + contracts: { + [fileName]: { + // If the language used has no contract names, this field should equal to an empty string + [contractName]: { + // The Ethereum Contract ABI. If empty, it is represented as an empty array. + // See https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI + abi: compilationResult['abi'], + evm: { + bytecode: { + linkReferences: {}, + object: compilationResult['bytecode'].replace('0x',''), + opcodes: "" + }, + deployedBytecode: { + linkReferences: {}, + object: compilationResult['bytecode_runtime'].replace('0x',''), + opcodes: "" + }, + methodIdentifiers: methodIdentifiers + } + } + } as any + } + }; +} + + +/* +export function createCompilationResultMessage(name: string, result: any) { + if(result.status == 'success') { + return { + bytecode: this.state.compilationResult['bytecode'], + bytecode_runtime: this.state.compilationResult['bytecode_runtime'], + abi: JSON.stringify(this.state.compilationResult['abi'], null , "\t"), + ir: this.state.compilationResult['ir'] + } + } else if(result.status == 'failed' && result.column && result.line) { + const header = `${name}:${result.line}:${result.column}` + const body = this.state.compilationResult.message.split(/\r\n|\r|\n/) + const arr = [header].concat(body).join("\n") + return { + bytecode: arr, + bytecode_runtime: arr, + abi: arr, + ir: arr + } + } else if(result.status == 'failed') { + const message = this.state.compilationResult.message + return { + bytecode: message, + bytecode_runtime: message, + abi: message, + ir: message + } + } + return { + bytecode: "", + bytecode_runtime: "", + abi: "", + ir: "" + } +} +*/ \ No newline at end of file diff --git a/apps/vyper/src/app/utils/index.ts b/apps/vyper/src/app/utils/index.ts new file mode 100644 index 0000000000..cb094b5d7b --- /dev/null +++ b/apps/vyper/src/app/utils/index.ts @@ -0,0 +1,12 @@ +export * from './compiler' +export * from './remix-client' + +export function contractName(fileName: string): string { + const parts = fileName.split('/') + return parts[parts.length - 1] +} + +export function isVyper(name: string): boolean { + const parts = name.split('.') + return parts[parts.length - 1] === 'vy' +} \ No newline at end of file diff --git a/apps/vyper/src/app/utils/remix-client.tsx b/apps/vyper/src/app/utils/remix-client.tsx new file mode 100644 index 0000000000..080ba64a75 --- /dev/null +++ b/apps/vyper/src/app/utils/remix-client.tsx @@ -0,0 +1,71 @@ +import { HighlightPosition, CompilationResult, RemixApi } from '@remixproject/plugin-api'; +import { Api, Status } from '@remixproject/plugin-utils'; +import { createClient } from '@remixproject/plugin-webview' +import { PluginClient } from '@remixproject/plugin'; +import { Contract } from './compiler'; + +export class RemixClient extends PluginClient { + private client = createClient>(this); + + loaded() { + return this.client.onload() + } + + /** Emit an event when file changed */ + async onFileChange(cb: (contract: string) => any) { + this.client.on('fileManager', 'currentFileChanged', async (name: string) => { + if (!name) return + cb(name) + }) + } + + /** Load Ballot contract example into the file manager */ + async loadContract({name, content}: Contract) { + try { + await this.client.call('fileManager', 'setFile', name, content) + await this.client.call('fileManager', 'switchFile', name) + } catch (err) { + console.log(err) + } + } + + /** Update the status of the plugin in remix */ + changeStatus(status: Status) { + this.client.emit('statusChanged', status); + } + + /** Highlight a part of the editor */ + highlight(lineColumnPos: HighlightPosition, name: string, color: string) { + return this.client.call('editor', 'highlight', lineColumnPos, name, color) + } + + /** Remove current Hightlight */ + discardHighlight() { + return this.client.call('editor', 'discardHighlight') + } + + /** Get the name of the current contract */ + async getContractName(): Promise { + await this.client.onload() + return this.client.call('fileManager', 'getCurrentFile') + } + + /** Get the current contract file */ + async getContract(): Promise { + const name = await this.getContractName() + if (!name) throw new Error('No contract selected yet') + const content = await this.client.call('fileManager', 'getFile', name) + return { + name, + content, + } + } + + /** Emit an event to Remix with compilation result */ + compilationFinish(title: string, content: string, data: CompilationResult) { + this.client.emit('compilationFinished', title, content, 'vyper', data); + } +} + +export const remixClient = new RemixClient() +// export const RemixClientContext = React.createContext(new RemixClient()) \ No newline at end of file diff --git a/apps/vyper/src/assets/.gitkeep b/apps/vyper/src/assets/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/apps/vyper/src/environments/environment.prod.ts b/apps/vyper/src/environments/environment.prod.ts new file mode 100644 index 0000000000..3612073bc3 --- /dev/null +++ b/apps/vyper/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/apps/vyper/src/environments/environment.ts b/apps/vyper/src/environments/environment.ts new file mode 100644 index 0000000000..d9370e924b --- /dev/null +++ b/apps/vyper/src/environments/environment.ts @@ -0,0 +1,6 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// When building for production, this file is replaced with `environment.prod.ts`. + +export const environment = { + production: false +}; diff --git a/apps/vyper/src/favicon.ico b/apps/vyper/src/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..317ebcb2336e0833a22dddf0ab287849f26fda57 GIT binary patch literal 15086 zcmeI332;U^%p|z7g|#(P)qFEA@4f!_@qOK2 z_lJl}!lhL!VT_U|uN7%8B2iKH??xhDa;*`g{yjTFWHvXn;2s{4R7kH|pKGdy(7z!K zgftM+Ku7~24TLlh(!g)gz|foI94G^t2^IO$uvX$3(OR0<_5L2sB)lMAMy|+`xodJ{ z_Uh_1m)~h?a;2W{dmhM;u!YGo=)OdmId_B<%^V^{ovI@y`7^g1_V9G}*f# zNzAtvou}I!W1#{M^@ROc(BZ! z+F!!_aR&Px3_reO(EW+TwlW~tv*2zr?iP7(d~a~yA|@*a89IUke+c472NXM0wiX{- zl`UrZC^1XYyf%1u)-Y)jj9;MZ!SLfd2Hl?o|80Su%Z?To_=^g_Jt0oa#CT*tjx>BI z16wec&AOWNK<#i0Qd=1O$fymLRoUR*%;h@*@v7}wApDl^w*h}!sYq%kw+DKDY)@&A z@9$ULEB3qkR#85`lb8#WZw=@})#kQig9oqy^I$dj&k4jU&^2(M3q{n1AKeGUKPFbr z1^<)aH;VsG@J|B&l>UtU#Ejv3GIqERzYgL@UOAWtW<{p#zy`WyJgpCy8$c_e%wYJL zyGHRRx38)HyjU3y{-4z6)pzb>&Q1pR)B&u01F-|&Gx4EZWK$nkUkOI|(D4UHOXg_- zw{OBf!oWQUn)Pe(=f=nt=zkmdjpO^o8ZZ9o_|4tW1ni+Un9iCW47*-ut$KQOww!;u z`0q)$s6IZO!~9$e_P9X!hqLxu`fpcL|2f^I5d4*a@Dq28;@2271v_N+5HqYZ>x;&O z05*7JT)mUe&%S0@UD)@&8SmQrMtsDfZT;fkdA!r(S=}Oz>iP)w=W508=Rc#nNn7ym z1;42c|8($ALY8#a({%1#IXbWn9-Y|0eDY$_L&j{63?{?AH{);EzcqfydD$@-B`Y3<%IIj7S7rK_N}je^=dEk%JQ4c z!tBdTPE3Tse;oYF>cnrapWq*o)m47X1`~6@(!Y29#>-#8zm&LXrXa(3=7Z)ElaQqj z-#0JJy3Fi(C#Rx(`=VXtJ63E2_bZGCz+QRa{W0e2(m3sI?LOcUBx)~^YCqZ{XEPX)C>G>U4tfqeH8L(3|pQR*zbL1 zT9e~4Tb5p9_G}$y4t`i*4t_Mr9QYvL9C&Ah*}t`q*}S+VYh0M6GxTTSXI)hMpMpIq zD1ImYqJLzbj0}~EpE-aH#VCH_udYEW#`P2zYmi&xSPs_{n6tBj=MY|-XrA;SGA_>y zGtU$?HXm$gYj*!N)_nQ59%lQdXtQZS3*#PC-{iB_sm+ytD*7j`D*k(P&IH2GHT}Eh z5697eQECVIGQAUe#eU2I!yI&%0CP#>%6MWV z@zS!p@+Y1i1b^QuuEF*13CuB zu69dve5k7&Wgb+^s|UB08Dr3u`h@yM0NTj4h7MnHo-4@xmyr7(*4$rpPwsCDZ@2be zRz9V^GnV;;?^Lk%ynzq&K(Aix`mWmW`^152Hoy$CTYVehpD-S1-W^#k#{0^L`V6CN+E z!w+xte;2vu4AmVNEFUOBmrBL>6MK@!O2*N|2=d|Y;oN&A&qv=qKn73lDD zI(+oJAdgv>Yr}8(&@ZuAZE%XUXmX(U!N+Z_sjL<1vjy1R+1IeHt`79fnYdOL{$ci7 z%3f0A*;Zt@ED&Gjm|OFTYBDe%bbo*xXAQsFz+Q`fVBH!N2)kaxN8P$c>sp~QXnv>b zwq=W3&Mtmih7xkR$YA)1Yi?avHNR6C99!u6fh=cL|KQ&PwF!n@ud^n(HNIImHD!h87!i*t?G|p0o+eelJ?B@A64_9%SBhNaJ64EvKgD&%LjLCYnNfc; znj?%*p@*?dq#NqcQFmmX($wms@CSAr9#>hUR^=I+=0B)vvGX%T&#h$kmX*s=^M2E!@N9#m?LhMvz}YB+kd zG~mbP|D(;{s_#;hsKK9lbVK&Lo734x7SIFJ9V_}2$@q?zm^7?*XH94w5Qae{7zOMUF z^?%F%)c1Y)Q?Iy?I>knw*8gYW#ok|2gdS=YYZLiD=CW|Nj;n^x!=S#iJ#`~Ld79+xXpVmUK^B(xO_vO!btA9y7w3L3-0j-y4 z?M-V{%z;JI`bk7yFDcP}OcCd*{Q9S5$iGA7*E1@tfkyjAi!;wP^O71cZ^Ep)qrQ)N z#wqw0_HS;T7x3y|`P==i3hEwK%|>fZ)c&@kgKO1~5<5xBSk?iZV?KI6&i72H6S9A* z=U(*e)EqEs?Oc04)V-~K5AUmh|62H4*`UAtItO$O(q5?6jj+K^oD!04r=6#dsxp?~}{`?&sXn#q2 zGuY~7>O2=!u@@Kfu7q=W*4egu@qPMRM>(eyYyaIE<|j%d=iWNdGsx%c!902v#ngNg z@#U-O_4xN$s_9?(`{>{>7~-6FgWpBpqXb`Ydc3OFL#&I}Irse9F_8R@4zSS*Y*o*B zXL?6*Aw!AfkNCgcr#*yj&p3ZDe2y>v$>FUdKIy_2N~}6AbHc7gA3`6$g@1o|dE>vz z4pl(j9;kyMsjaw}lO?(?Xg%4k!5%^t#@5n=WVc&JRa+XT$~#@rldvN3S1rEpU$;XgxVny7mki3 z-Hh|jUCHrUXuLr!)`w>wgO0N%KTB-1di>cj(x3Bav`7v z3G7EIbU$z>`Nad7Rk_&OT-W{;qg)-GXV-aJT#(ozdmnA~Rq3GQ_3mby(>q6Ocb-RgTUhTN)))x>m&eD;$J5Bg zo&DhY36Yg=J=$Z>t}RJ>o|@hAcwWzN#r(WJ52^g$lh^!63@hh+dR$&_dEGu&^CR*< z!oFqSqO@>xZ*nC2oiOd0eS*F^IL~W-rsrO`J`ej{=ou_q^_(<$&-3f^J z&L^MSYWIe{&pYq&9eGaArA~*kA + + + + Vyper + + + + + + +
+ + diff --git a/apps/vyper/src/main.tsx b/apps/vyper/src/main.tsx new file mode 100644 index 0000000000..353ad43f6d --- /dev/null +++ b/apps/vyper/src/main.tsx @@ -0,0 +1,7 @@ +import { StrictMode } from 'react'; +import * as ReactDOM from 'react-dom'; + + +import App from './app/app'; + +ReactDOM.render(, document.getElementById('root')); diff --git a/apps/vyper/src/polyfills.ts b/apps/vyper/src/polyfills.ts new file mode 100644 index 0000000000..2adf3d05b6 --- /dev/null +++ b/apps/vyper/src/polyfills.ts @@ -0,0 +1,7 @@ +/** + * Polyfill stable language features. These imports will be optimized by `@babel/preset-env`. + * + * See: https://github.com/zloirock/core-js#babel + */ +import 'core-js/stable'; +import 'regenerator-runtime/runtime'; diff --git a/apps/vyper/src/styles.css b/apps/vyper/src/styles.css new file mode 100644 index 0000000000..90d4ee0072 --- /dev/null +++ b/apps/vyper/src/styles.css @@ -0,0 +1 @@ +/* You can add global styles to this file, and also import other style files */ diff --git a/apps/vyper/tsconfig.app.json b/apps/vyper/tsconfig.app.json new file mode 100644 index 0000000000..62d6d52c3d --- /dev/null +++ b/apps/vyper/tsconfig.app.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "types": ["node"] + }, + "files": [ + + "../../node_modules/@nrwl/react/typings/cssmodule.d.ts", + "../../node_modules/@nrwl/react/typings/image.d.ts" + ], + "exclude": ["**/*.spec.ts", "**/*.spec.tsx"], + "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] +} diff --git a/apps/vyper/tsconfig.json b/apps/vyper/tsconfig.json new file mode 100644 index 0000000000..a3e71f89f3 --- /dev/null +++ b/apps/vyper/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "jsx": "react-jsx", + "allowJs": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.app.json" + } + ] +} \ No newline at end of file diff --git a/libs/remix-ui/clipboard/src/lib/copy-to-clipboard/copy-to-clipboard.tsx b/libs/remix-ui/clipboard/src/lib/copy-to-clipboard/copy-to-clipboard.tsx index 2220bc1d1b..a90dc433af 100644 --- a/libs/remix-ui/clipboard/src/lib/copy-to-clipboard/copy-to-clipboard.tsx +++ b/libs/remix-ui/clipboard/src/lib/copy-to-clipboard/copy-to-clipboard.tsx @@ -36,7 +36,7 @@ export const CopyToClipboard = (props: ICopyToClipboard) => { } } - const handleClick = (e) => { + const handleClick = (e: any) => { if (content) { // module `copy` keeps last copied thing in the memory, so don't show tooltip if nothing is copied, because nothing was added to memory copyData() } else { diff --git a/nx.json b/nx.json index 13cd26c2b2..2afa03ec50 100644 --- a/nx.json +++ b/nx.json @@ -15,7 +15,12 @@ "default": { "runner": "@nrwl/workspace/tasks-runners/default", "options": { - "cacheableOperations": ["build", "lint", "test", "e2e"] + "cacheableOperations": [ + "build", + "lint", + "test", + "e2e" + ] } } }, @@ -25,27 +30,43 @@ }, "remix-astwalker": { "tags": [], - "implicitDependencies": ["remix-lib"] + "implicitDependencies": [ + "remix-lib" + ] }, "remix-analyzer": { "tags": [], - "implicitDependencies": ["remix-astwalker", "remix-lib"] + "implicitDependencies": [ + "remix-astwalker", + "remix-lib" + ] }, "remix-debug": { "tags": [], - "implicitDependencies": ["remix-astwalker", "remix-lib"] + "implicitDependencies": [ + "remix-astwalker", + "remix-lib" + ] }, "remix-simulator": { "tags": [], - "implicitDependencies": ["remix-lib"] + "implicitDependencies": [ + "remix-lib" + ] }, "remix-solidity": { "tags": [], - "implicitDependencies": ["remix-lib"] + "implicitDependencies": [ + "remix-lib" + ] }, "remix-tests": { "tags": [], - "implicitDependencies": ["remix-lib", "remix-simulator", "remix-solidity"] + "implicitDependencies": [ + "remix-lib", + "remix-simulator", + "remix-solidity" + ] }, "remix-url-resolver": { "tags": [] @@ -69,7 +90,9 @@ }, "remix-ide-e2e": { "tags": [], - "implicitDependencies": ["remix-ide"] + "implicitDependencies": [ + "remix-ide" + ] }, "remixd": { "tags": [] @@ -172,6 +195,9 @@ }, "remix-ui-tooltip-popup": { "tags": [] + }, + "vyper": { + "tags": [] } }, "targetDependencies": { @@ -182,4 +208,4 @@ } ] } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 6faf18ebd2..37cbe00ad6 100644 --- a/package.json +++ b/package.json @@ -199,6 +199,7 @@ "react-bootstrap": "^1.6.4", "react-dom": "^17.0.2", "react-draggable": "^4.4.4", + "react-json-view": "^1.21.3", "react-tabs": "^3.2.2", "regenerator-runtime": "0.13.7", "rss-parser": "^3.12.0", diff --git a/workspace.json b/workspace.json index b1ec5f63d5..0f76a94da2 100644 --- a/workspace.json +++ b/workspace.json @@ -1,5 +1,37 @@ { "version": 1, + "cli": { + "defaultCollection": "@nrwl/react" + }, + "defaultProject": "remix-ide", + "schematics": { + "@nrwl/workspace": { + "library": { + "linter": "eslint" + } + }, + "@nrwl/react": { + "application": { + "style": "css", + "linter": "eslint", + "strict": true, + "babel": true + }, + "component": { + "style": "css" + }, + "library": { + "style": "css", + "linter": "eslint", + "strict": true + } + }, + "@nrwl/nx-plugin": { + "plugin": { + "linter": "eslint" + } + } + }, "projects": { "remix-ide": { "root": "apps/remix-ide", @@ -75,7 +107,9 @@ "options": { "linter": "eslint", "config": "apps/remix-ide/.eslintrc", - "files": ["apps/remix-ide/src/**/*.js"], + "files": [ + "apps/remix-ide/src/**/*.js" + ], "exclude": [ "**/node_modules/**", "apps/remix-ide/src/app/editor/mode-solidity.js", @@ -94,8 +128,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["apps/remix-ide-e2e/tsconfig.e2e.json"], - "exclude": ["**/node_modules/**", "!apps/remix-ide-e2e/**/*"] + "tsConfig": [ + "apps/remix-ide-e2e/tsconfig.e2e.json" + ], + "exclude": [ + "**/node_modules/**", + "!apps/remix-ide-e2e/**/*" + ] } } } @@ -111,14 +150,21 @@ "options": { "linter": "eslint", "config": "libs/remix-analyzer/.eslintrc", - "tsConfig": ["libs/remix-analyzer/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "libs/remix-analyzer/test/**/*"] + "tsConfig": [ + "libs/remix-analyzer/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "libs/remix-analyzer/test/**/*" + ] } }, "test": { "builder": "@nrwl/workspace:run-commands", "options": { - "commands": ["./../../node_modules/.bin/npm-run-all test"], + "commands": [ + "./../../node_modules/.bin/npm-run-all test" + ], "cwd": "libs/remix-analyzer" } }, @@ -129,7 +175,9 @@ "tsConfig": "libs/remix-analyzer/tsconfig.lib.json", "packageJson": "libs/remix-analyzer/package.json", "main": "libs/remix-analyzer/src/index.ts", - "assets": ["libs/remix-analyzer/*.md"] + "assets": [ + "libs/remix-analyzer/*.md" + ] } } } @@ -145,14 +193,21 @@ "options": { "linter": "eslint", "config": "libs/remix-astwalker/.eslintrc", - "tsConfig": ["libs/remix-astwalker/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "libs/remix-astwalker/tests/**/*"] + "tsConfig": [ + "libs/remix-astwalker/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "libs/remix-astwalker/tests/**/*" + ] } }, "test": { "builder": "@nrwl/workspace:run-commands", "options": { - "commands": ["./../../node_modules/.bin/npm-run-all test"], + "commands": [ + "./../../node_modules/.bin/npm-run-all test" + ], "cwd": "libs/remix-astwalker" } }, @@ -163,7 +218,9 @@ "tsConfig": "libs/remix-astwalker/tsconfig.lib.json", "packageJson": "libs/remix-astwalker/package.json", "main": "libs/remix-astwalker/src/index.ts", - "assets": ["libs/remix-astwalker/*.md"] + "assets": [ + "libs/remix-astwalker/*.md" + ] } } } @@ -179,14 +236,21 @@ "options": { "linter": "eslint", "config": "libs/remix-debug/.eslintrc", - "tsConfig": ["libs/remix-debug/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "libs/remix-debug/test/**/*"] + "tsConfig": [ + "libs/remix-debug/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "libs/remix-debug/test/**/*" + ] } }, "test": { "builder": "@nrwl/workspace:run-commands", "options": { - "commands": ["./../../node_modules/.bin/npm-run-all test"], + "commands": [ + "./../../node_modules/.bin/npm-run-all test" + ], "cwd": "libs/remix-debug" } }, @@ -224,14 +288,21 @@ "options": { "linter": "eslint", "config": "libs/remix-lib/.eslintrc", - "tsConfig": ["libs/remix-lib/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "libs/remix-lib/test/**/*"] + "tsConfig": [ + "libs/remix-lib/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "libs/remix-lib/test/**/*" + ] } }, "test": { "builder": "@nrwl/workspace:run-commands", "options": { - "commands": ["./../../node_modules/.bin/npm-run-all test"], + "commands": [ + "./../../node_modules/.bin/npm-run-all test" + ], "cwd": "libs/remix-lib" } }, @@ -242,7 +313,9 @@ "tsConfig": "libs/remix-lib/tsconfig.lib.json", "packageJson": "libs/remix-lib/package.json", "main": "libs/remix-lib/src/index.ts", - "assets": ["libs/remix-lib/*.md"] + "assets": [ + "libs/remix-lib/*.md" + ] } } } @@ -258,14 +331,21 @@ "options": { "linter": "eslint", "config": "libs/remix-simulator/.eslintrc", - "tsConfig": ["libs/remix-simulator/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "libs/remix-simulator/test/**/*"] + "tsConfig": [ + "libs/remix-simulator/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "libs/remix-simulator/test/**/*" + ] } }, "test": { "builder": "@nrwl/workspace:run-commands", "options": { - "commands": ["./../../node_modules/.bin/npm-run-all test"], + "commands": [ + "./../../node_modules/.bin/npm-run-all test" + ], "cwd": "libs/remix-simulator" } }, @@ -303,8 +383,12 @@ "options": { "linter": "eslint", "config": "libs/remix-solidity/.eslintrc", - "tsConfig": ["libs/remix-solidity/tsconfig.lib.json"], - "exclude": ["**/node_modules/**"] + "tsConfig": [ + "libs/remix-solidity/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**" + ] } }, "test": { @@ -321,7 +405,9 @@ "tsConfig": "libs/remix-solidity/tsconfig.lib.json", "packageJson": "libs/remix-solidity/package.json", "main": "libs/remix-solidity/src/index.ts", - "assets": ["libs/remix-solidity/*.md"] + "assets": [ + "libs/remix-solidity/*.md" + ] } } } @@ -337,7 +423,9 @@ "options": { "linter": "eslint", "config": "libs/remix-tests/.eslintrc", - "tsConfig": ["libs/remix-tests/tsconfig.lib.json"], + "tsConfig": [ + "libs/remix-tests/tsconfig.lib.json" + ], "exclude": [ "**/node_modules/**", "libs/remix-tests/tests/**/*", @@ -386,7 +474,9 @@ "options": { "linter": "eslint", "config": "libs/remix-url-resolver/.eslintrc", - "tsConfig": ["libs/remix-url-resolver/tsconfig.lib.json"], + "tsConfig": [ + "libs/remix-url-resolver/tsconfig.lib.json" + ], "exclude": [ "**/node_modules/**", "libs/remix-url-resolver/tests/**/*" @@ -396,7 +486,9 @@ "test": { "builder": "@nrwl/workspace:run-commands", "options": { - "commands": ["./../../node_modules/.bin/npm-run-all test"], + "commands": [ + "./../../node_modules/.bin/npm-run-all test" + ], "cwd": "libs/remix-url-resolver" } }, @@ -407,7 +499,9 @@ "tsConfig": "libs/remix-url-resolver/tsconfig.lib.json", "packageJson": "libs/remix-url-resolver/package.json", "main": "libs/remix-url-resolver/src/index.ts", - "assets": ["libs/remix-url-resolver/*.md"] + "assets": [ + "libs/remix-url-resolver/*.md" + ] } } } @@ -426,7 +520,10 @@ "libs/remixd/tsconfig.lib.json", "libs/remixd/tsconfig.spec.json" ], - "exclude": ["**/node_modules/**", "!libs/remixd/**/*"] + "exclude": [ + "**/node_modules/**", + "!libs/remixd/**/*" + ] } }, "test": { @@ -444,7 +541,10 @@ "tsConfig": "libs/remixd/tsconfig.lib.json", "packageJson": "libs/remixd/package.json", "main": "libs/remixd/src/index.ts", - "assets": ["libs/remixd/*.md", "libs/remixd/src/origins.json"] + "assets": [ + "libs/remixd/*.md", + "libs/remixd/src/origins.json" + ] } } } @@ -463,7 +563,10 @@ "libs/remix-ui/tree-view/tsconfig.lib.json", "libs/remix-ui/tree-view/tsconfig.spec.json" ], - "exclude": ["**/node_modules/**", "!libs/remix-ui/tree-view/**/*"] + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/tree-view/**/*" + ] } }, "test": { @@ -490,7 +593,10 @@ "libs/remix-ui/debugger-ui/tsconfig.lib.json", "libs/remix-ui/debugger-ui/tsconfig.spec.json" ], - "exclude": ["**/node_modules/**", "!libs/remix-ui/debugger-ui/**/*"] + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/debugger-ui/**/*" + ] } }, "test": { @@ -517,7 +623,10 @@ "libs/remix-ui/utils/tsconfig.lib.json", "libs/remix-ui/utils/tsconfig.spec.json" ], - "exclude": ["**/node_modules/**", "!libs/remix-ui/utils/**/*"] + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/utils/**/*" + ] } }, "test": { @@ -544,7 +653,10 @@ "libs/remix-ui/clipboard/tsconfig.lib.json", "libs/remix-ui/clipboard/tsconfig.spec.json" ], - "exclude": ["**/node_modules/**", "!libs/remix-ui/clipboard/**/*"] + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/clipboard/**/*" + ] } }, "test": { @@ -597,8 +709,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/toaster/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-ui/toaster/**/*"] + "tsConfig": [ + "libs/remix-ui/toaster/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/toaster/**/*" + ] } } } @@ -666,8 +783,13 @@ "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { - "tsConfig": ["apps/debugger/tsconfig.app.json"], - "exclude": ["**/node_modules/**", "!apps/debugger/**/*"] + "tsConfig": [ + "apps/debugger/tsconfig.app.json" + ], + "exclude": [ + "**/node_modules/**", + "!apps/debugger/**/*" + ] } } } @@ -682,8 +804,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/workspace/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-ui/workspace/**/*"] + "tsConfig": [ + "libs/remix-ui/workspace/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/workspace/**/*" + ] } } } @@ -698,8 +825,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/settings/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-ui/settings/**/*"] + "tsConfig": [ + "libs/remix-ui/settings/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/settings/**/*" + ] } } } @@ -714,7 +846,9 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/static-analyser/tsconfig.lib.json"], + "tsConfig": [ + "libs/remix-ui/static-analyser/tsconfig.lib.json" + ], "exclude": [ "**/node_modules/**", "!libs/remix-ui/static-analyser/**/*" @@ -733,8 +867,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/checkbox/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-ui/checkbox/**/*"] + "tsConfig": [ + "libs/remix-ui/checkbox/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/checkbox/**/*" + ] } } } @@ -749,8 +888,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/terminal/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-ui/terminal/**/*"] + "tsConfig": [ + "libs/remix-ui/terminal/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/terminal/**/*" + ] } } } @@ -765,7 +909,9 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/plugin-manager/tsconfig.lib.json"], + "tsConfig": [ + "libs/remix-ui/plugin-manager/tsconfig.lib.json" + ], "exclude": [ "**/node_modules/**", "!libs/remix-ui/plugin-manager/**/*" @@ -784,8 +930,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-core-plugin/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-core-plugin/**/*"] + "tsConfig": [ + "libs/remix-core-plugin/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-core-plugin/**/*" + ] } }, "build": { @@ -809,7 +960,9 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/solidity-compiler/tsconfig.lib.json"], + "tsConfig": [ + "libs/remix-ui/solidity-compiler/tsconfig.lib.json" + ], "exclude": [ "**/node_modules/**", "!libs/remix-ui/solidity-compiler/**/*" @@ -828,7 +981,9 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/publish-to-storage/tsconfig.lib.json"], + "tsConfig": [ + "libs/remix-ui/publish-to-storage/tsconfig.lib.json" + ], "exclude": [ "**/node_modules/**", "!libs/remix-ui/publish-to-storage/**/*" @@ -847,8 +1002,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/renderer/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-ui/renderer/**/*"] + "tsConfig": [ + "libs/remix-ui/renderer/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/renderer/**/*" + ] } } } @@ -872,7 +1032,9 @@ "apps/solidity-compiler/src/assets", "apps/solidity-compiler/src/index.html" ], - "styles": ["apps/solidity-compiler/src/styles.css"], + "styles": [ + "apps/solidity-compiler/src/styles.css" + ], "scripts": [], "webpackConfig": "apps/solidity-compiler/webpack.config.js", "maxWorkers": 2 @@ -917,8 +1079,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["apps/solidity-compiler/tsconfig.app.json"], - "exclude": ["**/node_modules/**", "!apps/solidity-compiler/**/*"] + "tsConfig": [ + "apps/solidity-compiler/tsconfig.app.json" + ], + "exclude": [ + "**/node_modules/**", + "!apps/solidity-compiler/**/*" + ] } } } @@ -941,7 +1108,9 @@ "apps/remix-ide-e2e/src/local-plugin/src/favicon.ico", "apps/remix-ide-e2e/src/local-plugin/src/assets" ], - "styles": ["apps/remix-ide-e2e/src/local-plugin/src/styles.css"], + "styles": [ + "apps/remix-ide-e2e/src/local-plugin/src/styles.css" + ], "scripts": [], "webpackConfig": "@nrwl/react/plugins/webpack" }, @@ -1007,8 +1176,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/home-tab/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-ui/home-tab/**/*"] + "tsConfig": [ + "libs/remix-ui/home-tab/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/home-tab/**/*" + ] } } } @@ -1023,8 +1197,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/editor/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-ui/editor/**/*"] + "tsConfig": [ + "libs/remix-ui/editor/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/editor/**/*" + ] } } } @@ -1038,8 +1217,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/editor/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-ui/editor/**/*"] + "tsConfig": [ + "libs/remix-ui/editor/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/editor/**/*" + ] } } } @@ -1054,8 +1238,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/app/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-ui/app/**/*"] + "tsConfig": [ + "libs/remix-ui/app/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/app/**/*" + ] } } } @@ -1070,8 +1259,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/helper/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-ui/helper/**/*"] + "tsConfig": [ + "libs/remix-ui/helper/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/helper/**/*" + ] } } } @@ -1085,8 +1279,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/tabs/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-ui/tabs/**/*"] + "tsConfig": [ + "libs/remix-ui/tabs/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/tabs/**/*" + ] } } } @@ -1120,8 +1319,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/search/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-ui/search/**/*"] + "tsConfig": [ + "libs/remix-ui/search/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/search/**/*" + ] } } } @@ -1135,8 +1339,13 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/panel/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-ui/panel/**/*"] + "tsConfig": [ + "libs/remix-ui/panel/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/panel/**/*" + ] } } } @@ -1170,7 +1379,9 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/editor-context-view/tsconfig.lib.json"], + "tsConfig": [ + "libs/remix-ui/editor-context-view/tsconfig.lib.json" + ], "exclude": [ "**/node_modules/**", "!libs/remix-ui/editor-context-view/**/*" @@ -1188,7 +1399,9 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/run-tab/tsconfig.lib.json"], + "tsConfig": [ + "libs/remix-ui/run-tab/tsconfig.lib.json" + ], "exclude": [ "**/node_modules/**", "libs/remix-ui/run-tab/**/*.d.ts", @@ -1207,7 +1420,9 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/permission-handler/tsconfig.lib.json"], + "tsConfig": [ + "libs/remix-ui/permission-handler/tsconfig.lib.json" + ], "exclude": [ "**/node_modules/**", "libs/remix-ui/permission-handler/**/*.d.ts", @@ -1227,8 +1442,12 @@ "options": { "linter": "eslint", "config": "libs/remix-ws-templates/.eslintrc", - "tsConfig": ["libs/remix-ws-templates/tsconfig.lib.json"], - "exclude": ["**/node_modules/**"] + "tsConfig": [ + "libs/remix-ws-templates/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**" + ] } }, "build": { @@ -1241,7 +1460,9 @@ "assets": [ { "glob": "templates/**/*", - "ignore": ["templates/**/*/index.ts"], + "ignore": [ + "templates/**/*/index.ts" + ], "input": "libs/remix-ws-templates/src/", "output": "src/" }, @@ -1265,41 +1486,94 @@ "options": { "linter": "eslint", "config": "libs/remix-ui/tooltip-popup/.eslintrc.json", - "tsConfig": ["libs/remix-ui/tooltip-popup/tsconfig.lib.json"], - "exclude": ["**/node_modules/**"] + "tsConfig": [ + "libs/remix-ui/tooltip-popup/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**" + ] } } } - } - }, - "cli": { - "defaultCollection": "@nrwl/react" - }, - "schematics": { - "@nrwl/workspace": { - "library": { - "linter": "eslint" - } - }, - "@nrwl/react": { - "application": { - "style": "css", - "linter": "eslint", - "babel": true - }, - "component": { - "style": "css" - }, - "library": { - "style": "css", - "linter": "eslint" - } }, - "@nrwl/nx-plugin": { - "plugin": { - "linter": "eslint" + "vyper": { + "root": "apps/vyper", + "sourceRoot": "apps/vyper/src", + "projectType": "application", + "architect": { + "build": { + "builder": "@nrwl/web:build", + "outputs": [ + "{options.outputPath}" + ], + "options": { + "outputPath": "dist/apps/vyper", + "index": "apps/vyper/src/index.html", + "main": "apps/vyper/src/main.tsx", + "polyfills": "apps/vyper/src/polyfills.ts", + "tsConfig": "apps/vyper/tsconfig.app.json", + "assets": [ + "apps/vyper/src/favicon.ico", + "apps/vyper/src/assets" + ], + "styles": [ + "apps/vyper/src/styles.css" + ], + "scripts": [], + "webpackConfig": "@nrwl/react/plugins/webpack" + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "apps/vyper/src/environments/environment.ts", + "with": "apps/vyper/src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + } + ] + } + } + }, + "serve": { + "builder": "@nrwl/web:dev-server", + "options": { + "buildTarget": "vyper:build", + "hmr": true + }, + "configurations": { + "production": { + "buildTarget": "vyper:build:production", + "hmr": false + } + } + }, + "lint": { + "builder": "@nrwl/linter:lint", + "options": { + "linter": "eslint", + "config": "apps/vyper/.eslintrc", + "files": [ + "apps/vyper/src/**/*.js", "apps/vyper/src/**/*.ts" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } } } - }, - "defaultProject": "remix-ide" -} + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 6bac163214..ead77d9fa4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5359,6 +5359,11 @@ asap@^2.0.0, asap@~2.0.5: resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.5.tgz#522765b50c3510490e52d7dcfe085ef9ba96958f" integrity sha512-7Ql0Lz9sffzP1jDkhjeju5/6z0LnwZAMZdlJoTe2GghKnYNA+H1rZOD8rWx4b9EBjux0kJq66igvQkANmbWnKg== +asap@~2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA== + asn1.js@^5.2.0: version "5.4.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" @@ -6325,6 +6330,11 @@ base-x@^3.0.2, base-x@^3.0.8: dependencies: safe-buffer "^5.0.1" +base16@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/base16/-/base16-1.0.0.tgz#e297f60d7ec1014a7a971a39ebc8a98c0b681e70" + integrity sha512-pNdYkNPiJUnEhnfXV56+sQy8+AaPcG3POZAUnwr4EeqCUZFz4u2PePbo3e5Gj4ziYPCWGUZT9RHisvJKnwFuBQ== + base64-js@^1.0.2, base64-js@^1.3.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" @@ -8385,6 +8395,13 @@ cross-blob@^2.0.1: blob-polyfill "^5.0.20210201" fetch-blob "^2.1.2" +cross-fetch@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" + integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== + dependencies: + node-fetch "2.6.7" + cross-spawn-async@^2.1.1: version "2.2.5" resolved "https://registry.yarnpkg.com/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz#845ff0c0834a3ded9d160daca6d390906bb288cc" @@ -10577,6 +10594,31 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" +fbemitter@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/fbemitter/-/fbemitter-3.0.0.tgz#00b2a1af5411254aab416cd75f9e6289bee4bff3" + integrity sha512-KWKaceCwKQU0+HPoop6gn4eOHk50bBv/VxjJtGMfwmJt3D29JpN4H4eisCtIPA+a8GVBam+ldMMpMjJUvpDyHw== + dependencies: + fbjs "^3.0.0" + +fbjs-css-vars@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz#216551136ae02fe255932c3ec8775f18e2c078b8" + integrity sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ== + +fbjs@^3.0.0, fbjs@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-3.0.4.tgz#e1871c6bd3083bac71ff2da868ad5067d37716c6" + integrity sha512-ucV0tDODnGV3JCnnkmoszb5lf4bNpzjv80K41wd4k798Etq+UYD0y0TIfalLjZoKgjive6/adkRnszwapiDgBQ== + dependencies: + cross-fetch "^3.1.5" + fbjs-css-vars "^1.0.0" + loose-envify "^1.0.0" + object-assign "^4.1.0" + promise "^7.1.1" + setimmediate "^1.0.5" + ua-parser-js "^0.7.30" + fd-slicer@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" @@ -10864,6 +10906,14 @@ flush-write-stream@^1.0.0, flush-write-stream@^1.0.2: inherits "^2.0.3" readable-stream "^2.3.6" +flux@^4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/flux/-/flux-4.0.3.tgz#573b504a24982c4768fdfb59d8d2ea5637d72ee7" + integrity sha512-yKAbrp7JhZhj6uiT1FTuVMlIAT1J4jqEyBpFApi1kxpGZCvacMVc/t1pMQyotqHhAgvoE3bNvAykhCo2CLjnYw== + dependencies: + fbemitter "^3.0.0" + fbjs "^3.0.1" + fn.name@1.x.x: version "1.1.0" resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" @@ -15082,6 +15132,11 @@ lodash.clonedeep@^4.5.0, lodash.clonedeep@~4.5.0: resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= +lodash.curry@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.curry/-/lodash.curry-4.1.1.tgz#248e36072ede906501d75966200a86dab8b23170" + integrity sha512-/u14pXGviLaweY5JI0IUzgzF2J6Ne8INyzAZjImcryjgkZ+ebruBxy2/JaOOkTqScddcYtakjhSaeemV8lR0tA== + lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -15097,6 +15152,11 @@ lodash.flattendeep@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= +lodash.flow@^3.3.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/lodash.flow/-/lodash.flow-3.5.0.tgz#87bf40292b8cf83e4e8ce1a3ae4209e20071675a" + integrity sha512-ff3BX/tSioo+XojX4MOsOMhJw0nZoUEF011LX8g8d3gvjVbxd89cCio4BCXronjxcTUIJUoqKEUA+n4CqvvRPw== + lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" @@ -16600,6 +16660,13 @@ node-fetch-npm@^2.0.2: json-parse-better-errors "^1.0.0" safe-buffer "^5.1.1" +node-fetch@2.6.7, node-fetch@^2.5.0, node-fetch@^2.6.0, node-fetch@^2.6.1: + version "2.6.7" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + dependencies: + whatwg-url "^5.0.0" + node-fetch@3.0.0-beta.9: version "3.0.0-beta.9" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.0.0-beta.9.tgz#0a7554cfb824380dd6812864389923c783c80d9b" @@ -16608,13 +16675,6 @@ node-fetch@3.0.0-beta.9: data-uri-to-buffer "^3.0.1" fetch-blob "^2.1.1" -node-fetch@^2.5.0, node-fetch@^2.6.0, node-fetch@^2.6.1: - version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - node-forge@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3" @@ -18833,6 +18893,13 @@ promise.series@^0.2.0: resolved "https://registry.yarnpkg.com/promise.series/-/promise.series-0.2.0.tgz#2cc7ebe959fc3a6619c04ab4dbdc9e452d864bbd" integrity sha1-LMfr6Vn8OmYZwEq029yeRS2GS70= +promise@^7.1.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" + integrity sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg== + dependencies: + asap "~2.0.3" + prompts@^2.0.1: version "2.4.2" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" @@ -19021,6 +19088,11 @@ pupa@^2.1.1: dependencies: escape-goat "^2.0.0" +pure-color@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/pure-color/-/pure-color-1.3.0.tgz#1fe064fb0ac851f0de61320a8bf796836422f33e" + integrity sha512-QFADYnsVoBMw1srW7OVKEYjG+MbIa49s54w1MA1EDY6r2r/sTcKKYqRX1f4GYvnXP7eN/Pe9HFcX+hwzmrXRHA== + q@^1.1.2, q@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -19202,6 +19274,16 @@ re-emitter@1.1.3: resolved "https://registry.yarnpkg.com/re-emitter/-/re-emitter-1.1.3.tgz#fa9e319ffdeeeb35b27296ef0f3d374dac2f52a7" integrity sha1-+p4xn/3u6zWycpbvDz03TawvUqc= +react-base16-styling@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/react-base16-styling/-/react-base16-styling-0.6.0.tgz#ef2156d66cf4139695c8a167886cb69ea660792c" + integrity sha512-yvh/7CArceR/jNATXOKDlvTnPKPmGZz7zsenQ3jUwLzHkNUR0CvY3yGYJbWJ/nnxsL8Sgmt5cO3/SILVuPO6TQ== + dependencies: + base16 "^1.0.0" + lodash.curry "^4.0.1" + lodash.flow "^3.3.0" + pure-color "^1.2.0" + react-beautiful-dnd@^13.1.0: version "13.1.0" resolved "https://registry.yarnpkg.com/react-beautiful-dnd/-/react-beautiful-dnd-13.1.0.tgz#ec97c81093593526454b0de69852ae433783844d" @@ -19265,6 +19347,16 @@ react-is@^17.0.1, react-is@^17.0.2: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== +react-json-view@^1.21.3: + version "1.21.3" + resolved "https://registry.yarnpkg.com/react-json-view/-/react-json-view-1.21.3.tgz#f184209ee8f1bf374fb0c41b0813cff54549c475" + integrity sha512-13p8IREj9/x/Ye4WI/JpjhoIwuzEgUAtgJZNBJckfzJt1qyh24BdTm6UQNGnyTq9dapQdrqvquZTo3dz1X6Cjw== + dependencies: + flux "^4.0.1" + react-base16-styling "^0.6.0" + react-lifecycles-compat "^3.0.4" + react-textarea-autosize "^8.3.2" + react-lifecycles-compat@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" @@ -19314,6 +19406,15 @@ react-tabs@^3.2.2: clsx "^1.1.0" prop-types "^15.5.0" +react-textarea-autosize@^8.3.2: + version "8.3.4" + resolved "https://registry.yarnpkg.com/react-textarea-autosize/-/react-textarea-autosize-8.3.4.tgz#270a343de7ad350534141b02c9cb78903e553524" + integrity sha512-CdtmP8Dc19xL8/R6sWvtknD/eCXkQr30dtvC4VmGInhRsfF8X/ihXCq6+9l9qbxmKRiq407/7z5fxE7cVWQNgQ== + dependencies: + "@babel/runtime" "^7.10.2" + use-composed-ref "^1.3.0" + use-latest "^1.2.1" + react-transition-group@^4.4.1: version "4.4.2" resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.2.tgz#8b59a56f09ced7b55cbd53c36768b922890d5470" @@ -22580,6 +22681,11 @@ typescript@^4.4.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c" integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== +ua-parser-js@^0.7.30: + version "0.7.31" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.31.tgz#649a656b191dffab4f21d5e053e27ca17cbff5c6" + integrity sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ== + uglify-js@^2.8.16: version "2.8.29" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" @@ -22966,6 +23072,23 @@ url@^0.11.0, url@~0.11.0: punycode "1.3.2" querystring "0.2.0" +use-composed-ref@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/use-composed-ref/-/use-composed-ref-1.3.0.tgz#3d8104db34b7b264030a9d916c5e94fbe280dbda" + integrity sha512-GLMG0Jc/jiKov/3Ulid1wbv3r54K9HlMW29IWcDFPEqFkSO2nS0MuefWgMJpeHQ9YJeXDL3ZUF+P3jdXlZX/cQ== + +use-isomorphic-layout-effect@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.2.tgz#497cefb13d863d687b08477d9e5a164ad8c1a6fb" + integrity sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA== + +use-latest@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/use-latest/-/use-latest-1.2.1.tgz#d13dfb4b08c28e3e33991546a2cee53e14038cf2" + integrity sha512-xA+AVm/Wlg3e2P/JiItTziwS7FK92LWrDB0p+hgXloIMuVCeJJ8v6f0eeHyPZaJrM+usM1FkFfbNCrJGs8A/zw== + dependencies: + use-isomorphic-layout-effect "^1.1.1" + use-memo-one@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/use-memo-one/-/use-memo-one-1.1.2.tgz#0c8203a329f76e040047a35a1197defe342fab20" From 7477fa4c7c8dd57f4e0a85909940b5cad480ba7a Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 2 Aug 2022 12:21:44 +0200 Subject: [PATCH 062/179] add e2e test --- .circleci/config.yml | 54 ++++++++++- apps/remix-ide-e2e/src/helpers/init.ts | 17 +++- apps/remix-ide-e2e/src/tests/vyper_api.ts | 96 +++++++++++++++++++ .../ci/browser_tests_vyper_plugin.sh | 25 +++++ apps/remix-ide/src/remixAppManager.js | 6 +- apps/vyper/src/app/app.tsx | 4 +- .../src/app/components/CompilerButton.tsx | 2 +- apps/vyper/src/app/components/VyperResult.tsx | 4 +- workspace.json | 2 +- 9 files changed, 199 insertions(+), 11 deletions(-) create mode 100644 apps/remix-ide-e2e/src/tests/vyper_api.ts create mode 100755 apps/remix-ide/ci/browser_tests_vyper_plugin.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 988b8940ea..4c24890cab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,10 +35,10 @@ jobs: key: v1-deps-{{ checksum "yarn.lock" }} paths: - node_modules - - run: yarn run downloadsolc_assets + - run: yarn run downloadsolc_assets - run: npx nx build remix-ide - run: npx nx build remix-ide-e2e-src-local-plugin - + - run: yarn run build:libs - run: mkdir persist && zip -r persist/dist.zip dist - persist_to_workspace: @@ -266,6 +266,50 @@ jobs: path: ./reports/tests - store_artifacts: path: ./reports/screenshots + + remix-ide-vyper-plugin: + docker: + # specify the version you desire here + - image: cimg/node:14.17.6-browsers + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + resource_class: xlarge + # - image: circleci/mongo:3.4.4 + environment: + - COMMIT_AUTHOR_EMAIL: "yann@ethereum.org" + - COMMIT_AUTHOR: "Circle CI" + working_directory: ~/remix-project + parallelism: 10 + steps: + - browser-tools/install-chrome + - browser-tools/install-chromedriver + - run: + command: | + google-chrome --version + chromedriver --version + java -jar /usr/local/bin/selenium.jar --version + name: Check install + - checkout + - checkout + - attach_workspace: + at: . + - run: unzip ./persist/dist.zip + - restore_cache: + keys: + - v1-deps-{{ checksum "yarn.lock" }} + - run: yarn install + - run: + name: Start Selenium + command: java -jar /usr/local/bin/selenium.jar + background: true + - run: npx nx build vyper + - run: ./apps/remix-ide/ci/browser_tests_vyper_plugin.sh + - store_test_results: + path: ./reports/tests + - store_artifacts: + path: ./reports/screenshots remix-ide-plugin-api: docker: @@ -420,6 +464,9 @@ workflows: - remix-ide-plugin-api: requires: - build + - remix-ide-vyper-plugin: + requires: + - build - remix-ide-chrome: requires: - build @@ -433,6 +480,7 @@ workflows: - remix-ide-chrome - remix-ide-firefox - remix-ide-plugin-api + - remix-ide-vyper-plugin filters: branches: only: remix_live @@ -443,6 +491,7 @@ workflows: - remix-ide-chrome - remix-ide-firefox - remix-ide-plugin-api + - remix-ide-vyper-plugin filters: branches: only: master @@ -453,6 +502,7 @@ workflows: - remix-ide-chrome - remix-ide-firefox - remix-ide-plugin-api + - remix-ide-vyper-plugin filters: branches: only: remix_beta diff --git a/apps/remix-ide-e2e/src/helpers/init.ts b/apps/remix-ide-e2e/src/helpers/init.ts index 8b56b54b5a..8bc3ab8eda 100644 --- a/apps/remix-ide-e2e/src/helpers/init.ts +++ b/apps/remix-ide-e2e/src/helpers/init.ts @@ -2,13 +2,28 @@ import { NightwatchBrowser } from 'nightwatch' require('dotenv').config() -export default function (browser: NightwatchBrowser, callback: VoidFunction, url?: string, preloadPlugins = true): void { +type LoadPlugin = { + name: string + url: string +} + +export default function (browser: NightwatchBrowser, callback: VoidFunction, url?: string, preloadPlugins = true, loadPlugin?: LoadPlugin): void { browser .url(url || 'http://127.0.0.1:8080') .pause(6000) .switchBrowserTab(0) .waitForElementVisible('[id="remixTourSkipbtn"]') .click('[id="remixTourSkipbtn"]') + .perform((done) => { + if (!loadPlugin) return done() + browser.execute(function (loadPlugin) { // override a plugin url for testing purpose + localStorage.setItem('test-plugin-name', loadPlugin.name) + localStorage.setItem('test-plugin-url', loadPlugin.url) + }, [loadPlugin]) + .refresh() + .pause(6000) + .perform(done) + }) .maximizeWindow() .fullscreenWindow(() => { if (preloadPlugins) { diff --git a/apps/remix-ide-e2e/src/tests/vyper_api.ts b/apps/remix-ide-e2e/src/tests/vyper_api.ts new file mode 100644 index 0000000000..f168372963 --- /dev/null +++ b/apps/remix-ide-e2e/src/tests/vyper_api.ts @@ -0,0 +1,96 @@ +'use strict' +import { NightwatchBrowser } from 'nightwatch' +import init from '../helpers/init' + +declare global { + interface Window { testplugin: { name: string, url: string }; } +} + +module.exports = { + '@disabled': true, + before: function (browser: NightwatchBrowser, done: VoidFunction) { + init(browser, done, null, true, { name: 'vyper', url: 'http://127.0.0.1:5002'}) + }, + + 'Should connect to vyper plugin #group1': function (browser: NightwatchBrowser) { + browser.clickLaunchIcon('pluginManager') + .scrollAndClick('[data-id="pluginManagerComponentActivateButtonvyper"]') + .clickLaunchIcon('vyper') + .pause(5000) + // @ts-ignore + .frame(0) + }, + + 'Should add the Ballot.vy #group1': function (browser: NightwatchBrowser) { + browser.click('button[data-id="add-ballot"]') + .frameParent() + .openFile('ballot.vy') + }, + + 'Compile ballot.vy should error #group1': function (browser: NightwatchBrowser) { + browser.clickLaunchIcon('vyper') + // @ts-ignore + .frame(0) + .click('[data-id="remote-compiler"]') + .click('[data-id="compile"]') + .assert.containsText('[data-id="error-message"]', 'unexpected indent') + }, + + 'Compile test contract should success #group1': function (browser: NightwatchBrowser) { + let contractAddress + browser + .frameParent() + .addFile('test.vy', { content: testContract }) + .clickLaunchIcon('vyper') + // @ts-ignore + .frame(0) + .click('[data-id="compile"]') + .frameParent() + .clickLaunchIcon('udapp') + .createContract('') + .clickInstance(0) + .clickFunction('totalPokemonCount - call') + .getAddressAtPosition(0, (address) => { + console.log('Vyper contract ' + address) + contractAddress = address + }) + .perform((done) => { + browser.verifyCallReturnValue(contractAddress, ['0:uint256: 0']) + .perform(() => done()) + }) + } +} + +const testContract = ` +# @version >=0.2.4 <0.3.0 + +DNA_DIGITS: constant(uint256) = 16 +DNA_MODULUS: constant(uint256) = 10 ** DNA_DIGITS +# add HP_LIMIT + +struct Pokemon: + name: String[32] + dna: uint256 + HP: uint256 + matches: uint256 + wins: uint256 + +totalPokemonCount: public(uint256) +pokemonList: HashMap[uint256, Pokemon] + +@pure +@internal +def _generateRandomDNA(_name: String[32]) -> uint256: + random: uint256 = convert(keccak256(_name), uint256) + return random % DNA_MODULUS +# modify _createPokemon +@internal +def _createPokemon(_name: String[32], _dna: uint256, _HP: uint256): + self.pokemonList[self.totalPokemonCount] = Pokemon({ + name: _name, + dna: _dna, + HP: _HP, + matches: 0, + wins: 0 + }) + self.totalPokemonCount += 1` \ No newline at end of file diff --git a/apps/remix-ide/ci/browser_tests_vyper_plugin.sh b/apps/remix-ide/ci/browser_tests_vyper_plugin.sh new file mode 100755 index 0000000000..4c82c9f768 --- /dev/null +++ b/apps/remix-ide/ci/browser_tests_vyper_plugin.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -e + +BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}} +echo "$BUILD_ID" +TEST_EXITCODE=0 + +yarn run serve:production & +npx nx serve vyper & + +sleep 5 + +yarn run build:e2e + +TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "vyper_api" | sort | circleci tests split ) +for TESTFILE in $TESTFILES; do + npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=chrome || TEST_EXITCODE=1 +done + +echo "$TEST_EXITCODE" +if [ "$TEST_EXITCODE" -eq 1 ] +then + exit 1 +fi diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index 332b119542..1bebbc7083 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -146,9 +146,11 @@ export class RemixAppManager extends PluginManager { } } } - return plugins.map(plugin => { + const testPluginName = localStorage.getItem('test-plugin-name') + const testPluginUrl = localStorage.getItem('test-plugin-url') + return plugins.map(plugin => { + if (plugin.name === testPluginName) plugin.url = testPluginUrl return new IframePlugin(plugin) - // return new IframeReactPlugin(plugin) }) } diff --git a/apps/vyper/src/app/app.tsx b/apps/vyper/src/app/app.tsx index 2b06263214..e11684d409 100644 --- a/apps/vyper/src/app/app.tsx +++ b/apps/vyper/src/app/app.tsx @@ -85,10 +85,10 @@ const App: React.FC = () => { type="radio" value={state.environment} > - + Remote Compiler - + Local Compiler diff --git a/apps/vyper/src/app/components/CompilerButton.tsx b/apps/vyper/src/app/components/CompilerButton.tsx index 8c59abf3cb..fb0fb6ff05 100644 --- a/apps/vyper/src/app/components/CompilerButton.tsx +++ b/apps/vyper/src/app/components/CompilerButton.tsx @@ -66,7 +66,7 @@ function CompilerButton({ contract, setOutput, compilerUrl }: Props) { } return ( - ) diff --git a/apps/vyper/src/app/components/VyperResult.tsx b/apps/vyper/src/app/components/VyperResult.tsx index b6fd49b69f..f550d17370 100644 --- a/apps/vyper/src/app/components/VyperResult.tsx +++ b/apps/vyper/src/app/components/VyperResult.tsx @@ -23,7 +23,7 @@ function VyperResult({ output }: VyperResultProps) { if (!output) return (

No contract compiled yet.

-
@@ -33,7 +33,7 @@ function VyperResult({ output }: VyperResultProps) { return (
-

{output.message}

+

{output.message}

) } diff --git a/workspace.json b/workspace.json index 0f76a94da2..a2eca1cee7 100644 --- a/workspace.json +++ b/workspace.json @@ -1551,7 +1551,7 @@ "builder": "@nrwl/web:dev-server", "options": { "buildTarget": "vyper:build", - "hmr": true + "port": 5002 }, "configurations": { "production": { From 567d33399a6c36e7b58424c1edb7a77ca43ce525 Mon Sep 17 00:00:00 2001 From: Neil Shah <78612612+NeilShah2026@users.noreply.github.com> Date: Mon, 11 Apr 2022 15:04:11 -0400 Subject: [PATCH 063/179] Add Scopes To GitHub Token Maker Adds direct ability for the user to select the gist scope, as well as name the token, "Remix IDE Token". --- libs/remix-ui/settings/src/lib/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/settings/src/lib/constants.ts b/libs/remix-ui/settings/src/lib/constants.ts index 4062c68657..b95a9ff4b9 100644 --- a/libs/remix-ui/settings/src/lib/constants.ts +++ b/libs/remix-ui/settings/src/lib/constants.ts @@ -6,7 +6,7 @@ export const warnText = 'Be sure the endpoint is opened before enabling it. \nTh export const gitAccessTokenTitle = 'GitHub Access Token' export const gitAccessTokenText = 'Manage the access token used to publish to Gist and retrieve GitHub contents.' export const gitAccessTokenText2 = 'Go to github token page (link below) to create a new token and save it in Remix. Make sure this token has only \'create gist\' permission.' -export const gitAccessTokenLink = 'https://github.com/settings/tokens' +export const gitAccessTokenLink = 'https://github.com/settings/tokens/new?scopes=gist,repo&description=Remix%20IDE%20Token' export const etherscanTokenTitle = 'EtherScan Access Token' export const etherscanTokenLink = 'https://etherscan.io/myapikey' export const etherscanAccessTokenText = 'Manage the api key used to interact with Etherscan.' From 076e09f0475aba3a3ac10873eaff8b6004c1e9ae Mon Sep 17 00:00:00 2001 From: Jeremy Theintz Date: Wed, 6 Jul 2022 13:44:38 +0200 Subject: [PATCH 064/179] add calls param to iframe call multiple functions on start --- apps/remix-ide/src/app.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index d9c93fd4f6..a7673d45bc 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -410,6 +410,25 @@ class AppComponent { this.appManager.call(...callDetails).catch(console.error) } } + + if (params.calls) { + const calls = params.calls.split("///"); + + // call all functions in the list, one after the other + for (const call of calls) { + const callDetails = call.split("//"); + if (callDetails.length > 1) { + this.appManager.call( + "notification", + "toast", + `initiating ${callDetails[0]} ...` + ); + + // @todo(remove the timeout when activatePlugin is on 0.3.0) + await this.appManager.call(...callDetails).catch(console.error); + } + } + } }) .catch(console.error) } From be37ce2f2ee715361148061a54732595a06be71e Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 3 Aug 2022 10:02:45 +0200 Subject: [PATCH 065/179] wrap with try/catch --- apps/remix-ide/src/app.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index a7673d45bc..9fecce5b50 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -425,7 +425,11 @@ class AppComponent { ); // @todo(remove the timeout when activatePlugin is on 0.3.0) - await this.appManager.call(...callDetails).catch(console.error); + try { + await this.appManager.call(...callDetails) + } catch (e) { + console.error(e) + } } } } From 5407a1578c926421b7446d42a05f7db0f25f49e0 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 12:13:10 +0200 Subject: [PATCH 066/179] fix workspace --- workspace.json | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/workspace.json b/workspace.json index 95d40e5000..900de9173e 100644 --- a/workspace.json +++ b/workspace.json @@ -1505,35 +1505,16 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": ["libs/remix-ui/file-decorators/tsconfig.lib.json"], - "exclude": ["**/node_modules/**", "!libs/remix-ui/file-decorators/**/*"] + "tsConfig": [ + "libs/remix-ui/file-decorators/tsconfig.lib.json" + ], + "exclude": [ + "**/node_modules/**", + "!libs/remix-ui/file-decorators/**/*" + ] } } } - } - }, - "cli": { - "defaultCollection": "@nrwl/react" - }, - "schematics": { - "@nrwl/workspace": { - "library": { - "linter": "eslint" - } - }, - "@nrwl/react": { - "application": { - "style": "css", - "linter": "eslint", - "babel": true - }, - "component": { - "style": "css" - }, - "library": { - "style": "css", - "linter": "eslint" - } }, "vyper": { "root": "apps/vyper", @@ -1605,7 +1586,8 @@ "linter": "eslint", "config": "apps/vyper/.eslintrc", "files": [ - "apps/vyper/src/**/*.js", "apps/vyper/src/**/*.ts" + "apps/vyper/src/**/*.js", + "apps/vyper/src/**/*.ts" ], "exclude": [ "**/node_modules/**" From 07bea6da03d3dd8e5cc5df99349af9802bebf0a5 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 1 Aug 2022 14:27:14 +0530 Subject: [PATCH 067/179] show files on folder expansion --- libs/remix-ui/workspace/src/lib/actions/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/remix-ui/workspace/src/lib/actions/index.ts b/libs/remix-ui/workspace/src/lib/actions/index.ts index 953a75ba88..fce393a7c8 100644 --- a/libs/remix-ui/workspace/src/lib/actions/index.ts +++ b/libs/remix-ui/workspace/src/lib/actions/index.ts @@ -4,7 +4,7 @@ import Gists from 'gists' import { customAction } from '@remixproject/plugin-api/lib/file-system/file-panel/type' import { displayNotification, displayPopUp, fetchDirectoryError, fetchDirectoryRequest, fetchDirectorySuccess, focusElement, fsInitializationCompleted, hidePopUp, removeInputFieldSuccess, setCurrentWorkspace, setExpandPath, setMode, setWorkspaces } from './payload' import { listenOnPluginEvents, listenOnProviderEvents } from './events' -import { createWorkspaceTemplate, getWorkspaces, loadWorkspacePreset, setPlugin } from './workspace' +import { createWorkspaceTemplate, getWorkspaces, loadWorkspacePreset, setPlugin, workspaceExists } from './workspace' import { QueryParams } from '@remix-project/remix-lib' import { fetchContractFromEtherscan } from '@remix-project/core-plugin' // eslint-disable-line import JSZip from 'jszip' @@ -80,6 +80,7 @@ export const initWorkspace = (filePanelPlugin) => async (reducerDispatch: React. {id: 5, name: 'goerli'} ] let found = false + let filePath const foundOnNetworks = [] for (const network of networks) { const target = `/${network.name}/${contractAddress}` @@ -95,15 +96,15 @@ export const initWorkspace = (filePanelPlugin) => async (reducerDispatch: React. } found = true foundOnNetworks.push(network.name) - await createWorkspaceTemplate('etherscan-code-sample', 'code-template') + if (await workspaceExists('etherscan-code-sample')) workspaceProvider.setWorkspace('etherscan-code-sample') + else await createWorkspaceTemplate('etherscan-code-sample', 'code-template') plugin.setWorkspace({ name: 'etherscan-code-sample', isLocalhost: false }) dispatch(setCurrentWorkspace({ name: 'etherscan-code-sample', isGitRepo: false })) - let filePath count = count + (Object.keys(data.compilationTargets)).length for (filePath in data.compilationTargets) await workspaceProvider.set(filePath, data.compilationTargets[filePath]['content']) - plugin.on('editor', 'editorMounted', async () => await plugin.fileManager.openFile(filePath)) } + plugin.on('editor', 'editorMounted', async () => await plugin.fileManager.openFile(filePath)) plugin.call('notification', 'toast', `Added ${count} verified contract${count === 1 ? '': 's'} from ${foundOnNetworks.join(',')} network${foundOnNetworks.length === 1 ? '': 's'} of Etherscan for contract address ${contractAddress} !!`) } catch (error) { await basicWorkspaceInit(workspaces, workspaceProvider) From 6ce083752d7b76dbba7a71b81291b49d21e8eafe Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 1 Aug 2022 19:06:28 +0530 Subject: [PATCH 068/179] add e2e tests --- apps/remix-ide-e2e/src/tests/url.test.ts | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index b85b2caa1e..138bf7bf80 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -84,6 +84,33 @@ module.exports = { }) }, + 'Should load Etherscan verified contractss from URL "address" param)': function (browser: NightwatchBrowser) { + browser + .pause(5000) + .url('http://127.0.0.1:8080/#address=0x56db08fb78bc6689a1ef66efd079083fed0e4915') + .refresh() + .pause(5000) + .currentWorkspaceIs('etherscan-code-sample') + .assert.elementPresent('*[data-id=treeViewLitreeViewItemropsten]') + .assert.elementPresent('*[data-id=treeViewLitreeViewItemrinkeby]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemrinkeby/0x56db08fb78bc6689a1ef66efd079083fed0e4915"]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemrinkeby/0x56db08fb78bc6689a1ef66efd079083fed0e4915/Sample.sol"]') + .getEditorValue((content) => { + browser.assert.ok(content && content.indexOf( + 'contract Sample {') !== -1) + }) + .url('http://127.0.0.1:8080/#address=0xdac17f958d2ee523a2206206994597c13d831ec7') + .refresh() + .pause(5000) + .assert.elementPresent('*[data-id=treeViewLitreeViewItemmainnet]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7"]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7/TetherToken.sol"]') + .getEditorValue((content) => { + browser.assert.ok(content && content.indexOf( + 'contract TetherToken is Pausable, StandardToken, BlackList {') !== -1) + }) + }, + 'Should load the code from URL & code params': function (browser: NightwatchBrowser) { browser .pause(5000) From 6fae2a6c9b7081c1e201b5804876a081438fd9f4 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 1 Aug 2022 19:17:06 +0530 Subject: [PATCH 069/179] removed errors in console --- .../src/lib/helpers/fetch-etherscan.ts | 6 +++--- libs/remix-ui/workspace/src/lib/actions/index.ts | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts b/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts index 16f6b284b8..f81914d8a4 100644 --- a/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts +++ b/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts @@ -1,4 +1,4 @@ -export const fetchContractFromEtherscan = async (plugin, network, contractAddress, targetPath, key?) => { +export const fetchContractFromEtherscan = async (plugin, network, contractAddress, targetPath, shouldSetFile = true, key?) => { let data const compilationTargets = {} let etherscanKey @@ -27,7 +27,7 @@ export const fetchContractFromEtherscan = async (plugin, network, contractAddres if (typeof data.result[0].SourceCode === 'string') { const fileName = `${targetPath}/${data.result[0].ContractName}.sol` - await plugin.call('fileManager', 'setFile', fileName , data.result[0].SourceCode) + if (shouldSetFile) await plugin.call('fileManager', 'setFile', fileName , data.result[0].SourceCode) compilationTargets[fileName] = { content: data.result[0].SourceCode } } else if (data.result[0].SourceCode && typeof data.result[0].SourceCode == 'object') { const sources = data.result[0].SourceCode.sources @@ -39,7 +39,7 @@ export const fetchContractFromEtherscan = async (plugin, network, contractAddres } else { const path = `${targetPath}/${file}` const content = (source as any).content - await plugin.call('fileManager', 'setFile', path, content) + if (shouldSetFile) await plugin.call('fileManager', 'setFile', path, content) compilationTargets[path] = { content } } } diff --git a/libs/remix-ui/workspace/src/lib/actions/index.ts b/libs/remix-ui/workspace/src/lib/actions/index.ts index fce393a7c8..7c3615c10c 100644 --- a/libs/remix-ui/workspace/src/lib/actions/index.ts +++ b/libs/remix-ui/workspace/src/lib/actions/index.ts @@ -80,12 +80,13 @@ export const initWorkspace = (filePanelPlugin) => async (reducerDispatch: React. {id: 5, name: 'goerli'} ] let found = false + let workspaceName = 'etherscan-code-sample' let filePath const foundOnNetworks = [] for (const network of networks) { const target = `/${network.name}/${contractAddress}` try { - data = await fetchContractFromEtherscan(plugin, network, contractAddress, target, etherscanKey) + data = await fetchContractFromEtherscan(plugin, network, contractAddress, target, false, etherscanKey) } catch (error) { if ((error.message.startsWith('contract not verified on Etherscan') || error.message.startsWith('unable to retrieve contract data')) && network.id !== 5) continue @@ -96,10 +97,10 @@ export const initWorkspace = (filePanelPlugin) => async (reducerDispatch: React. } found = true foundOnNetworks.push(network.name) - if (await workspaceExists('etherscan-code-sample')) workspaceProvider.setWorkspace('etherscan-code-sample') - else await createWorkspaceTemplate('etherscan-code-sample', 'code-template') - plugin.setWorkspace({ name: 'etherscan-code-sample', isLocalhost: false }) - dispatch(setCurrentWorkspace({ name: 'etherscan-code-sample', isGitRepo: false })) + if (await workspaceExists(workspaceName)) workspaceProvider.setWorkspace(workspaceName) + else await createWorkspaceTemplate(workspaceName, 'code-template') + plugin.setWorkspace({ name: workspaceName, isLocalhost: false }) + dispatch(setCurrentWorkspace({ name: workspaceName, isGitRepo: false })) count = count + (Object.keys(data.compilationTargets)).length for (filePath in data.compilationTargets) await workspaceProvider.set(filePath, data.compilationTargets[filePath]['content']) From 0026337aaf4613b858f5e68a0e0660b45f09f9b6 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 1 Aug 2022 19:22:05 +0530 Subject: [PATCH 070/179] linting fix --- libs/remix-ui/workspace/src/lib/actions/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/workspace/src/lib/actions/index.ts b/libs/remix-ui/workspace/src/lib/actions/index.ts index 7c3615c10c..31fe71a453 100644 --- a/libs/remix-ui/workspace/src/lib/actions/index.ts +++ b/libs/remix-ui/workspace/src/lib/actions/index.ts @@ -80,7 +80,7 @@ export const initWorkspace = (filePanelPlugin) => async (reducerDispatch: React. {id: 5, name: 'goerli'} ] let found = false - let workspaceName = 'etherscan-code-sample' + const workspaceName = 'etherscan-code-sample' let filePath const foundOnNetworks = [] for (const network of networks) { From 6b8ce0a13e320657cf56088bc81a62d91042cc21 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 1 Aug 2022 19:44:31 +0530 Subject: [PATCH 071/179] update e2e tests --- apps/remix-ide-e2e/src/tests/url.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index 138bf7bf80..56ad225c04 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -89,7 +89,7 @@ module.exports = { .pause(5000) .url('http://127.0.0.1:8080/#address=0x56db08fb78bc6689a1ef66efd079083fed0e4915') .refresh() - .pause(5000) + .pause(6000) .currentWorkspaceIs('etherscan-code-sample') .assert.elementPresent('*[data-id=treeViewLitreeViewItemropsten]') .assert.elementPresent('*[data-id=treeViewLitreeViewItemrinkeby]') @@ -101,7 +101,8 @@ module.exports = { }) .url('http://127.0.0.1:8080/#address=0xdac17f958d2ee523a2206206994597c13d831ec7') .refresh() - .pause(5000) + .pause(6000) + .currentWorkspaceIs('etherscan-code-sample') .assert.elementPresent('*[data-id=treeViewLitreeViewItemmainnet]') .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7"]') .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7/TetherToken.sol"]') From af356081bac6123a9658b7a64bb737e1ae0c5c09 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 2 Aug 2022 11:40:02 +0530 Subject: [PATCH 072/179] pause turn on flaky flaky flaky rm refresh set query param refresh hash screenshot set to desktop back to fetch rm cors --- .circleci/config.yml | 4 +- apps/remix-ide-e2e/src/tests/url.test.ts | 95 +++++++++++-------- apps/remix-ide/src/app.js | 1 + .../src/lib/helpers/fetch-etherscan.ts | 36 ++++--- 4 files changed, 83 insertions(+), 53 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4c24890cab..56ad48d66e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: false + default: true orbs: browser-tools: circleci/browser-tools@1.2.3 jobs: @@ -176,7 +176,7 @@ jobs: name: Start Selenium command: java -jar /usr/local/bin/selenium.jar background: true - - run: ./apps/remix-ide/ci/flaky.sh chrome + - run: ./apps/remix-ide/ci/flaky.sh chromeDesktop - store_test_results: path: ./reports/tests - store_artifacts: diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index 56ad225c04..436365b786 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -41,15 +41,18 @@ const sources = [ ] module.exports = { + '@disabled': true, + '@desktop': true, before: function (browser: NightwatchBrowser, done: VoidFunction) { - init(browser, done, 'http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js', true) + init(browser, done) + //init(browser, done, 'http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js', true) }, '@sources': function () { return sources }, - 'Should load the code from URL params (code param)': function (browser: NightwatchBrowser) { + 'Should load the code from URL params (code param) #group1': function (browser: NightwatchBrowser) { browser .waitForElementVisible('[for="autoCompile"]') .click('[for="autoCompile"]') // we set it too false in the local storage @@ -66,11 +69,11 @@ module.exports = { .getEditorValue((content) => { browser.assert.ok(content && content.indexOf( 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol') !== -1, - 'code has not been loaded') + 'code has not been loaded') }) }, - 'Should load the code from URL params (url param)': function (browser: NightwatchBrowser) { + 'Should load the code from URL params (url param) #group1': function (browser: NightwatchBrowser) { browser .pause(5000) .url('http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js&url=https://github.com/ethereum/remix-project/blob/master/apps/remix-ide/contracts/app/solidity/mode.sol') @@ -80,39 +83,57 @@ module.exports = { .getEditorValue((content) => { browser.assert.ok(content && content.indexOf( 'proposals.length = _numProposals;') !== -1, - 'url has not been loaded') + 'url has not been loaded') }) }, - 'Should load Etherscan verified contractss from URL "address" param)': function (browser: NightwatchBrowser) { + 'Should load Etherscan verified contractss from URL "address" param) #group2 #flaky': function (browser: NightwatchBrowser) { browser .pause(5000) - .url('http://127.0.0.1:8080/#address=0x56db08fb78bc6689a1ef66efd079083fed0e4915') - .refresh() - .pause(6000) - .currentWorkspaceIs('etherscan-code-sample') - .assert.elementPresent('*[data-id=treeViewLitreeViewItemropsten]') - .assert.elementPresent('*[data-id=treeViewLitreeViewItemrinkeby]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemrinkeby/0x56db08fb78bc6689a1ef66efd079083fed0e4915"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemrinkeby/0x56db08fb78bc6689a1ef66efd079083fed0e4915/Sample.sol"]') - .getEditorValue((content) => { - browser.assert.ok(content && content.indexOf( - 'contract Sample {') !== -1) - }) - .url('http://127.0.0.1:8080/#address=0xdac17f958d2ee523a2206206994597c13d831ec7') - .refresh() - .pause(6000) - .currentWorkspaceIs('etherscan-code-sample') - .assert.elementPresent('*[data-id=treeViewLitreeViewItemmainnet]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7/TetherToken.sol"]') - .getEditorValue((content) => { - browser.assert.ok(content && content.indexOf( - 'contract TetherToken is Pausable, StandardToken, BlackList {') !== -1) + .url('http://127.0.0.1:8080/?address=0x56db08fb78bc6689a1ef66efd079083fed0e4915') + .pause(10000) + .getLog('browser', (logEntries) => { + if (logEntries && logEntries.length > 0) { + console.log('Browser log:') + console.log(logEntries) + } + }). + currentWorkspaceIs('etherscan-code-sample') + .getLog('browser', (logEntries) => { + if (logEntries && logEntries.length > 0) { + console.log('Browser log:') + console.log(logEntries) + } }) + /* + .saveScreenshot('./reports/screenshots/etherscan-verified-contract-1.png') + .refresh() + .pause(7000) + .currentWorkspaceIs('etherscan-code-sample') + .assert.elementPresent('*[data-id=treeViewLitreeViewItemropsten]') + .assert.elementPresent('*[data-id=treeViewLitreeViewItemrinkeby]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemrinkeby/0x56db08fb78bc6689a1ef66efd079083fed0e4915"]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemrinkeby/0x56db08fb78bc6689a1ef66efd079083fed0e4915/Sample.sol"]') + .getEditorValue((content) => { + browser.assert.ok(content && content.indexOf( + 'contract Sample {') !== -1) + }) + .url('http://127.0.0.1:8080/#address=0xdac17f958d2ee523a2206206994597c13d831ec7') + .refresh() + .pause(7000) + .currentWorkspaceIs('etherscan-code-sample') + .assert.elementPresent('*[data-id=treeViewLitreeViewItemmainnet]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7"]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7/TetherToken.sol"]') + .getEditorValue((content) => { + browser.assert.ok(content && content.indexOf( + 'contract TetherToken is Pausable, StandardToken, BlackList {') !== -1) + + }) +*/ }, - 'Should load the code from URL & code params': function (browser: NightwatchBrowser) { + 'Should load the code from URL & code params #group1': function (browser: NightwatchBrowser) { browser .pause(5000) .url('http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js&url=https://github.com/ethereum/remix-project/blob/master/apps/remix-ide/contracts/app/solidity/mode.sol&code=cHJhZ21hIHNvbGlkaXR5ID49MC42LjAgPDAuNy4wOwoKaW1wb3J0ICJodHRwczovL2dpdGh1Yi5jb20vT3BlblplcHBlbGluL29wZW56ZXBwZWxpbi1jb250cmFjdHMvYmxvYi9tYXN0ZXIvY29udHJhY3RzL2FjY2Vzcy9Pd25hYmxlLnNvbCI7Cgpjb250cmFjdCBHZXRQYWlkIGlzIE93bmFibGUgewogIGZ1bmN0aW9uIHdpdGhkcmF3KCkgZXh0ZXJuYWwgb25seU93bmVyIHsKICB9Cn0') @@ -123,7 +144,7 @@ module.exports = { .getEditorValue((content) => { browser.assert.ok(content && content.indexOf( 'proposals.length = _numProposals;') !== -1, - 'code has not been loaded') + 'code has not been loaded') }) .openFile('contract-76747f6e19.sol') .openFile('ethereum') @@ -136,7 +157,7 @@ module.exports = { .openFile('ethereum/remix-project/apps/remix-ide/contracts/app/solidity/mode.sol') }, - 'Should load the code from language & code params': function (browser: NightwatchBrowser) { + 'Should load the code from language & code params #group1': function (browser: NightwatchBrowser) { browser .pause(5000) .url('http://127.0.0.1:8080/#language=yul&version=soljson-v0.8.7+commit.e28d00a7.js&code=Ly8gQSBjb250cmFjdCBjb25zaXN0cyBvZiBhIHNpbmdsZSBvYmplY3Qgd2l0aCBzdWItb2JqZWN0cyByZXByZXNlbnRpbmcKLy8gdGhlIGNvZGUgdG8gYmUgZGVwbG95ZWQgb3Igb3RoZXIgY29udHJhY3RzIGl0IGNhbiBjcmVhdGUuCi8vIFRoZSBzaW5nbGUgImNvZGUiIG5vZGUgaXMgdGhlIGV4ZWN1dGFibGUgY29kZSBvZiB0aGUgb2JqZWN0LgovLyBFdmVyeSAob3RoZXIpIG5hbWVkIG9iamVjdCBvciBkYXRhIHNlY3Rpb24gaXMgc2VyaWFsaXplZCBhbmQKLy8gbWFkZSBhY2Nlc3NpYmxlIHRvIHRoZSBzcGVjaWFsIGJ1aWx0LWluIGZ1bmN0aW9ucyBkYXRhY29weSAvIGRhdGFvZmZzZXQgLyBkYXRhc2l6ZQovLyBUaGUgY3VycmVudCBvYmplY3QsIHN1Yi1vYmplY3RzIGFuZCBkYXRhIGl0ZW1zIGluc2lkZSB0aGUgY3VycmVudCBvYmplY3QKLy8gYXJlIGluIHNjb3BlLgpvYmplY3QgIkNvbnRyYWN0MSIgewogICAgLy8gVGhpcyBpcyB0aGUgY29uc3RydWN0b3IgY29kZSBvZiB0aGUgY29udHJhY3QuCiAgICBjb2RlIHsKICAgICAgICBmdW5jdGlvbiBhbGxvY2F0ZShzaXplKSAtPiBwdHIgewogICAgICAgICAgICBwdHIgOj0gbWxvYWQoMHg0MCkKICAgICAgICAgICAgaWYgaXN6ZXJvKHB0cikgeyBwdHIgOj0gMHg2MCB9CiAgICAgICAgICAgIG1zdG9yZSgweDQwLCBhZGQocHRyLCBzaXplKSkKICAgICAgICB9CgogICAgICAgIC8vIGZpcnN0IGNyZWF0ZSAiQ29udHJhY3QyIgogICAgICAgIGxldCBzaXplIDo9IGRhdGFzaXplKCJDb250cmFjdDIiKQogICAgICAgIGxldCBvZmZzZXQgOj0gYWxsb2NhdGUoc2l6ZSkKICAgICAgICAvLyBUaGlzIHdpbGwgdHVybiBpbnRvIGNvZGVjb3B5IGZvciBFVk0KICAgICAgICBkYXRhY29weShvZmZzZXQsIGRhdGFvZmZzZXQoIkNvbnRyYWN0MiIpLCBzaXplKQogICAgICAgIC8vIGNvbnN0cnVjdG9yIHBhcmFtZXRlciBpcyBhIHNpbmdsZSBudW1iZXIgMHgxMjM0CiAgICAgICAgbXN0b3JlKGFkZChvZmZzZXQsIHNpemUpLCAweDEyMzQpCiAgICAgICAgcG9wKGNyZWF0ZShvZmZzZXQsIGFkZChzaXplLCAzMiksIDApKQoKICAgICAgICAvLyBub3cgcmV0dXJuIHRoZSBydW50aW1lIG9iamVjdCAodGhlIGN1cnJlbnRseQogICAgICAgIC8vIGV4ZWN1dGluZyBjb2RlIGlzIHRoZSBjb25zdHJ1Y3RvciBjb2RlKQogICAgICAgIHNpemUgOj0gZGF0YXNpemUoIkNvbnRyYWN0MV9kZXBsb3llZCIpCiAgICAgICAgb2Zmc2V0IDo9IGFsbG9jYXRlKHNpemUpCiAgICAgICAgLy8gVGhpcyB3aWxsIHR1cm4gaW50byBhIG1lbW9yeS0+bWVtb3J5IGNvcHkgZm9yIEV3YXNtIGFuZAogICAgICAgIC8vIGEgY29kZWNvcHkgZm9yIEVWTQogICAgICAgIGRhdGFjb3B5KG9mZnNldCwgZGF0YW9mZnNldCgiQ29udHJhY3QxX2RlcGxveWVkIiksIHNpemUpCiAgICAgICAgcmV0dXJuKG9mZnNldCwgc2l6ZSkKICAgIH0KCiAgICBkYXRhICJUYWJsZTIiIGhleCI0MTIzIgoKICAgIG9iamVjdCAiQ29udHJhY3QxX2RlcGxveWVkIiB7CiAgICAgICAgY29kZSB7CiAgICAgICAgICAgIGZ1bmN0aW9uIGFsbG9jYXRlKHNpemUpIC0+IHB0ciB7CiAgICAgICAgICAgICAgICBwdHIgOj0gbWxvYWQoMHg0MCkKICAgICAgICAgICAgICAgIGlmIGlzemVybyhwdHIpIHsgcHRyIDo9IDB4NjAgfQogICAgICAgICAgICAgICAgbXN0b3JlKDB4NDAsIGFkZChwdHIsIHNpemUpKQogICAgICAgICAgICB9CgogICAgICAgICAgICAvLyBydW50aW1lIGNvZGUKCiAgICAgICAgICAgIG1zdG9yZSgwLCAiSGVsbG8sIFdvcmxkISIpCiAgICAgICAgICAgIHJldHVybigwLCAweDIwKQogICAgICAgIH0KICAgIH0KCiAgICAvLyBFbWJlZGRlZCBvYmplY3QuIFVzZSBjYXNlIGlzIHRoYXQgdGhlIG91dHNpZGUgaXMgYSBmYWN0b3J5IGNvbnRyYWN0LAogICAgLy8gYW5kIENvbnRyYWN0MiBpcyB0aGUgY29kZSB0byBiZSBjcmVhdGVkIGJ5IHRoZSBmYWN0b3J5CiAgICBvYmplY3QgIkNvbnRyYWN0MiIgewogICAgICAgIGNvZGUgewogICAgICAgICAgICAvLyBjb2RlIGhlcmUgLi4uCiAgICAgICAgfQoKICAgICAgICBvYmplY3QgIkNvbnRyYWN0Ml9kZXBsb3llZCIgewogICAgICAgICAgICBjb2RlIHsKICAgICAgICAgICAgICAgIC8vIGNvZGUgaGVyZSAuLi4KICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgZGF0YSAiVGFibGUxIiBoZXgiNDEyMyIKICAgIH0KfQ&optimize=false&runs=200&evmVersion=null') @@ -152,7 +173,7 @@ module.exports = { }) }, - 'Should select deploy with proxy option from URL params': function (browser: NightwatchBrowser) { + 'Should select deploy with proxy option from URL params #group1': function (browser: NightwatchBrowser) { browser .url('http://127.0.0.1:8080/#optimize=false&runs=200&deployProxy=true') .refresh() @@ -170,7 +191,7 @@ module.exports = { .expect.element('[data-id="contractGUIDeployWithProxy"]').to.be.selected }, - 'Should select upgrade with proxy option from URL params': function (browser: NightwatchBrowser) { + 'Should select upgrade with proxy option from URL params #group1': function (browser: NightwatchBrowser) { browser .url('http://127.0.0.1:8080/#optimize=false&runs=200&upgradeProxy=true') .refresh() @@ -187,7 +208,7 @@ module.exports = { .expect.element('[data-id="contractGUIUpgradeImplementation"]').to.be.selected }, - 'Should load using various URL compiler params': function (browser: NightwatchBrowser) { + 'Should load using various URL compiler params #group1': function (browser: NightwatchBrowser) { browser .pause(5000) .url('http://127.0.0.1:8080/#optimize=true&runs=300&autoCompile=true&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js&language=Yul') @@ -213,7 +234,7 @@ module.exports = { .assert.containsText('#versionSelector option[data-id="selected"]', '0.8.15+commit.e14f2714') }, - 'Should load using compiler from link passed in remix URL': function (browser: NightwatchBrowser) { + 'Should load using compiler from link passed in remix URL #group1': function (browser: NightwatchBrowser) { browser .url('http://127.0.0.1:8080/#version=https://solidity-blog.s3.eu-central-1.amazonaws.com/data/08preview/soljson.js&optimize=false') .refresh() @@ -222,7 +243,7 @@ module.exports = { .pause(5000) .click('*[data-id="scConfigExpander"]') .assert.containsText('#versionSelector option[data-id="selected"]', 'custom') - // default values + // default values .assert.containsText('#evmVersionSelector option[data-id="selected"]', 'default') .verify.elementPresent('#optimize') .assert.elementNotPresent('#optimize:checked') @@ -231,7 +252,7 @@ module.exports = { .verify.attributeEquals('#runs', 'value', '200') }, - 'Should load json files from link passed in remix URL': function (browser: NightwatchBrowser) { + 'Should load json files from link passed in remix URL #group1': function (browser: NightwatchBrowser) { browser .url('http://127.0.0.1:8080/#optimize=false&runs=200&evmVersion=null&version=soljson-v0.6.12+commit.27d51765.js&url=https://raw.githubusercontent.com/EthVM/evm-source-verification/main/contracts/1/0x011e5846975c6463a8c6337eecf3cbf64e328884/input.json') .refresh() diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index 9fecce5b50..05f77be84d 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -62,6 +62,7 @@ const { TabProxy } = require('./app/panels/tab-proxy.js') class AppComponent { constructor () { + console.error(window.location.href) this.appManager = new RemixAppManager({}) this.queryParams = new QueryParams() this._components = {} diff --git a/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts b/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts index f81914d8a4..b458093426 100644 --- a/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts +++ b/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts @@ -1,24 +1,32 @@ export const fetchContractFromEtherscan = async (plugin, network, contractAddress, targetPath, shouldSetFile = true, key?) => { + console.error('get etherscan contract', contractAddress); let data const compilationTargets = {} let etherscanKey if (!key) etherscanKey = await plugin.call('config', 'getAppParameter', 'etherscan-access-token') else etherscanKey = key - + if (etherscanKey) { + console.error('etherscan key found', etherscanKey); const endpoint = network.id == 1 ? 'api.etherscan.io' : 'api-' + network.name + '.etherscan.io' - data = await fetch('https://' + endpoint + '/api?module=contract&action=getsourcecode&address=' + contractAddress + '&apikey=' + etherscanKey) - data = await data.json() - // etherscan api doc https://docs.etherscan.io/api-endpoints/contracts - if (data.message === 'OK' && data.status === "1") { - if (data.result.length) { - if (data.result[0].SourceCode === '') throw new Error(`contract not verified on Etherscan ${network.name} network`) - if (data.result[0].SourceCode.startsWith('{')) { - data.result[0].SourceCode = JSON.parse(data.result[0].SourceCode.replace(/(?:\r\n|\r|\n)/g, '').replace(/^{{/,'{').replace(/}}$/,'}')) + try { + data = await fetch('https://' + endpoint + '/api?module=contract&action=getsourcecode&address=' + contractAddress + '&apikey=' + etherscanKey) + data = await data.json() + console.error('etherscan contract data', data); + // etherscan api doc https://docs.etherscan.io/api-endpoints/contracts + if (data.message === 'OK' && data.status === "1") { + if (data.result.length) { + if (data.result[0].SourceCode === '') throw new Error(`contract not verified on Etherscan ${network.name} network`) + if (data.result[0].SourceCode.startsWith('{')) { + data.result[0].SourceCode = JSON.parse(data.result[0].SourceCode.replace(/(?:\r\n|\r|\n)/g, '').replace(/^{{/, '{').replace(/}}$/, '}')) + } } - } - } else throw new Error('unable to retrieve contract data ' + data.message) + } else throw new Error('unable to retrieve contract data ' + data.message) + } catch (e) { + console.error('etherscan contract data error', e); + throw new Error('unable to retrieve contract data: ' + e.message) + } } else throw new Error('unable to try fetching the source code from etherscan: etherscan access token not found. please go to the Remix settings page and provide an access token.') if (!data || !data.result) { @@ -27,7 +35,7 @@ export const fetchContractFromEtherscan = async (plugin, network, contractAddres if (typeof data.result[0].SourceCode === 'string') { const fileName = `${targetPath}/${data.result[0].ContractName}.sol` - if (shouldSetFile) await plugin.call('fileManager', 'setFile', fileName , data.result[0].SourceCode) + if (shouldSetFile) await plugin.call('fileManager', 'setFile', fileName, data.result[0].SourceCode) compilationTargets[fileName] = { content: data.result[0].SourceCode } } else if (data.result[0].SourceCode && typeof data.result[0].SourceCode == 'object') { const sources = data.result[0].SourceCode.sources @@ -36,7 +44,7 @@ export const fetchContractFromEtherscan = async (plugin, network, contractAddres file = file.replace(/^\//g, '') // remove first slash. if (await plugin.call('contentImport', 'isExternalUrl', file)) { // nothing to do, the compiler callback will handle those - } else { + } else { const path = `${targetPath}/${file}` const content = (source as any).content if (shouldSetFile) await plugin.call('fileManager', 'setFile', path, content) @@ -47,7 +55,7 @@ export const fetchContractFromEtherscan = async (plugin, network, contractAddres let runs = 0 try { runs = parseInt(data.result[0].Runs) - } catch (e) {} + } catch (e) { } const settings = { version: data.result[0].CompilerVersion.replace(/^v/, ''), language: 'Solidity', From 9b413955672b67dd02a186621936f57b0f84f4a2 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 10:01:44 +0200 Subject: [PATCH 073/179] set user agent set desktop rm desktop reset file reset file screens mv logs log params params stringify strings restore test restore test restore script turn off flaky rm desktop --- .circleci/config.yml | 4 +- apps/remix-ide-e2e/nightwatch.ts | 8 ++- apps/remix-ide-e2e/src/tests/url.test.ts | 69 +++++++------------ apps/remix-ide/src/app.js | 1 - .../src/lib/helpers/fetch-etherscan.ts | 4 -- .../workspace/src/lib/actions/index.ts | 1 + 6 files changed, 35 insertions(+), 52 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 56ad48d66e..4c24890cab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: true + default: false orbs: browser-tools: circleci/browser-tools@1.2.3 jobs: @@ -176,7 +176,7 @@ jobs: name: Start Selenium command: java -jar /usr/local/bin/selenium.jar background: true - - run: ./apps/remix-ide/ci/flaky.sh chromeDesktop + - run: ./apps/remix-ide/ci/flaky.sh chrome - store_test_results: path: ./reports/tests - store_artifacts: diff --git a/apps/remix-ide-e2e/nightwatch.ts b/apps/remix-ide-e2e/nightwatch.ts index 7ca74fd2a7..f5554dfeb8 100644 --- a/apps/remix-ide-e2e/nightwatch.ts +++ b/apps/remix-ide-e2e/nightwatch.ts @@ -29,7 +29,13 @@ module.exports = { javascriptEnabled: true, acceptSslCerts: true, 'goog:chromeOptions': { - args: ['window-size=2560,1440', 'start-fullscreen', '--no-sandbox', '--headless', '--verbose'] + args: ['window-size=2560,1440', + 'start-fullscreen', + '--no-sandbox', + '--headless', + '--verbose', + "--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36", + ] } } }, diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index 436365b786..760d3eb6ae 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -42,10 +42,8 @@ const sources = [ module.exports = { '@disabled': true, - '@desktop': true, before: function (browser: NightwatchBrowser, done: VoidFunction) { - init(browser, done) - //init(browser, done, 'http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js', true) + init(browser, done, 'http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js', true) }, '@sources': function () { @@ -87,50 +85,33 @@ module.exports = { }) }, - 'Should load Etherscan verified contractss from URL "address" param) #group2 #flaky': function (browser: NightwatchBrowser) { + 'Should load Etherscan verified contractss from URL "address" param) #group2': function (browser: NightwatchBrowser) { browser .pause(5000) - .url('http://127.0.0.1:8080/?address=0x56db08fb78bc6689a1ef66efd079083fed0e4915') - .pause(10000) - .getLog('browser', (logEntries) => { - if (logEntries && logEntries.length > 0) { - console.log('Browser log:') - console.log(logEntries) - } - }). - currentWorkspaceIs('etherscan-code-sample') - .getLog('browser', (logEntries) => { - if (logEntries && logEntries.length > 0) { - console.log('Browser log:') - console.log(logEntries) - } + .url('http://127.0.0.1:8080/#address=0x56db08fb78bc6689a1ef66efd079083fed0e4915') + .refresh() + .pause(7000) + .currentWorkspaceIs('etherscan-code-sample') + .assert.elementPresent('*[data-id=treeViewLitreeViewItemropsten]') + .assert.elementPresent('*[data-id=treeViewLitreeViewItemrinkeby]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemrinkeby/0x56db08fb78bc6689a1ef66efd079083fed0e4915"]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemrinkeby/0x56db08fb78bc6689a1ef66efd079083fed0e4915/Sample.sol"]') + .getEditorValue((content) => { + browser.assert.ok(content && content.indexOf( + 'contract Sample {') !== -1) + }) + .url('http://127.0.0.1:8080/#address=0xdac17f958d2ee523a2206206994597c13d831ec7') + .refresh() + .pause(7000) + .currentWorkspaceIs('etherscan-code-sample') + .assert.elementPresent('*[data-id=treeViewLitreeViewItemmainnet]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7"]') + .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7/TetherToken.sol"]') + .getEditorValue((content) => { + browser.assert.ok(content && content.indexOf( + 'contract TetherToken is Pausable, StandardToken, BlackList {') !== -1) + }) - /* - .saveScreenshot('./reports/screenshots/etherscan-verified-contract-1.png') - .refresh() - .pause(7000) - .currentWorkspaceIs('etherscan-code-sample') - .assert.elementPresent('*[data-id=treeViewLitreeViewItemropsten]') - .assert.elementPresent('*[data-id=treeViewLitreeViewItemrinkeby]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemrinkeby/0x56db08fb78bc6689a1ef66efd079083fed0e4915"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemrinkeby/0x56db08fb78bc6689a1ef66efd079083fed0e4915/Sample.sol"]') - .getEditorValue((content) => { - browser.assert.ok(content && content.indexOf( - 'contract Sample {') !== -1) - }) - .url('http://127.0.0.1:8080/#address=0xdac17f958d2ee523a2206206994597c13d831ec7') - .refresh() - .pause(7000) - .currentWorkspaceIs('etherscan-code-sample') - .assert.elementPresent('*[data-id=treeViewLitreeViewItemmainnet]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7/TetherToken.sol"]') - .getEditorValue((content) => { - browser.assert.ok(content && content.indexOf( - 'contract TetherToken is Pausable, StandardToken, BlackList {') !== -1) - - }) -*/ }, 'Should load the code from URL & code params #group1': function (browser: NightwatchBrowser) { diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index 05f77be84d..9fecce5b50 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -62,7 +62,6 @@ const { TabProxy } = require('./app/panels/tab-proxy.js') class AppComponent { constructor () { - console.error(window.location.href) this.appManager = new RemixAppManager({}) this.queryParams = new QueryParams() this._components = {} diff --git a/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts b/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts index b458093426..1592663c38 100644 --- a/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts +++ b/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts @@ -1,5 +1,4 @@ export const fetchContractFromEtherscan = async (plugin, network, contractAddress, targetPath, shouldSetFile = true, key?) => { - console.error('get etherscan contract', contractAddress); let data const compilationTargets = {} let etherscanKey @@ -8,12 +7,10 @@ export const fetchContractFromEtherscan = async (plugin, network, contractAddres else etherscanKey = key if (etherscanKey) { - console.error('etherscan key found', etherscanKey); const endpoint = network.id == 1 ? 'api.etherscan.io' : 'api-' + network.name + '.etherscan.io' try { data = await fetch('https://' + endpoint + '/api?module=contract&action=getsourcecode&address=' + contractAddress + '&apikey=' + etherscanKey) data = await data.json() - console.error('etherscan contract data', data); // etherscan api doc https://docs.etherscan.io/api-endpoints/contracts if (data.message === 'OK' && data.status === "1") { if (data.result.length) { @@ -24,7 +21,6 @@ export const fetchContractFromEtherscan = async (plugin, network, contractAddres } } else throw new Error('unable to retrieve contract data ' + data.message) } catch (e) { - console.error('etherscan contract data error', e); throw new Error('unable to retrieve contract data: ' + e.message) } } else throw new Error('unable to try fetching the source code from etherscan: etherscan access token not found. please go to the Remix settings page and provide an access token.') diff --git a/libs/remix-ui/workspace/src/lib/actions/index.ts b/libs/remix-ui/workspace/src/lib/actions/index.ts index 31fe71a453..cb82ddb0aa 100644 --- a/libs/remix-ui/workspace/src/lib/actions/index.ts +++ b/libs/remix-ui/workspace/src/lib/actions/index.ts @@ -52,6 +52,7 @@ export const initWorkspace = (filePanelPlugin) => async (reducerDispatch: React. const params = queryParams.get() as UrlParametersType const workspaces = await getWorkspaces() || [] dispatch(setWorkspaces(workspaces)) + console.error('PARAMS', params) if (params.gist) { await createWorkspaceTemplate('gist-sample', 'gist-template') plugin.setWorkspace({ name: 'gist-sample', isLocalhost: false }) From 343d86bbc59512f0b6158963c84fb56b8f5532f1 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 11:44:26 +0200 Subject: [PATCH 074/179] set to windows --- apps/remix-ide-e2e/nightwatch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/nightwatch.ts b/apps/remix-ide-e2e/nightwatch.ts index f5554dfeb8..3f59c1549e 100644 --- a/apps/remix-ide-e2e/nightwatch.ts +++ b/apps/remix-ide-e2e/nightwatch.ts @@ -34,7 +34,7 @@ module.exports = { '--no-sandbox', '--headless', '--verbose', - "--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36", + "--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36", ] } } From c14835a012586347bc63e8e467e0e42337252efe Mon Sep 17 00:00:00 2001 From: Aniket <30843294+Aniket-Engg@users.noreply.github.com> Date: Wed, 3 Aug 2022 17:59:17 +0530 Subject: [PATCH 075/179] console removed --- libs/remix-ui/workspace/src/lib/actions/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/remix-ui/workspace/src/lib/actions/index.ts b/libs/remix-ui/workspace/src/lib/actions/index.ts index cb82ddb0aa..31fe71a453 100644 --- a/libs/remix-ui/workspace/src/lib/actions/index.ts +++ b/libs/remix-ui/workspace/src/lib/actions/index.ts @@ -52,7 +52,6 @@ export const initWorkspace = (filePanelPlugin) => async (reducerDispatch: React. const params = queryParams.get() as UrlParametersType const workspaces = await getWorkspaces() || [] dispatch(setWorkspaces(workspaces)) - console.error('PARAMS', params) if (params.gist) { await createWorkspaceTemplate('gist-sample', 'gist-template') plugin.setWorkspace({ name: 'gist-sample', isLocalhost: false }) From 08653481f2ea124b1f53970d37d886e19fdc89b7 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 18 Jul 2022 10:22:16 +0200 Subject: [PATCH 076/179] update nightwatch --- .../src/commands/checkTerminalFilter.ts | 2 +- .../src/commands/executeScriptInTerminal.ts | 20 + apps/remix-ide-e2e/src/commands/openFile.ts | 8 +- .../src/commands/rightClickCustom.ts | 37 ++ .../src/commands/validateValueInput.ts | 2 +- .../src/examples/editor-test-contracts.ts | 173 ++++++ .../src/tests/compiler_api.test.ts | 8 +- apps/remix-ide-e2e/src/tests/debugger.test.ts | 4 +- .../src/tests/defaultLayout.test.ts | 2 +- apps/remix-ide-e2e/src/tests/editor.test.ts | 263 +-------- .../src/tests/editorAutoComplete.test.ts | 518 ++++++++++++++++++ .../src/tests/editorHoverContext.test.ts | 236 ++++++++ .../src/tests/editorReferences.test.ts | 196 +++++++ .../src/tests/fileExplorer.test.ts | 23 +- .../src/tests/fileManager_api.test.ts | 24 +- apps/remix-ide-e2e/src/tests/gist.test.ts | 4 +- .../src/tests/importFromGithub.test.ts | 4 +- apps/remix-ide-e2e/src/tests/plugin_api.ts | 8 +- apps/remix-ide-e2e/src/tests/remixd.test.ts | 2 +- .../src/tests/runAndDeploy.test.ts | 6 +- apps/remix-ide-e2e/src/tests/search.test.ts | 4 +- .../src/tests/specialFunctions.test.ts | 26 +- .../src/tests/staticAnalysis.test.ts | 4 +- apps/remix-ide-e2e/src/tests/terminal.test.ts | 22 +- apps/remix-ide-e2e/src/tests/url.test.ts | 2 +- .../src/tests/verticalIconsPanel.test.ts | 4 +- apps/remix-ide-e2e/src/types/index.d.ts | 4 +- package.json | 6 +- 28 files changed, 1271 insertions(+), 341 deletions(-) create mode 100644 apps/remix-ide-e2e/src/commands/executeScriptInTerminal.ts create mode 100644 apps/remix-ide-e2e/src/commands/rightClickCustom.ts create mode 100644 apps/remix-ide-e2e/src/examples/editor-test-contracts.ts create mode 100644 apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts create mode 100644 apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts create mode 100644 apps/remix-ide-e2e/src/tests/editorReferences.test.ts diff --git a/apps/remix-ide-e2e/src/commands/checkTerminalFilter.ts b/apps/remix-ide-e2e/src/commands/checkTerminalFilter.ts index 2ebc4cd1f1..ed8fa54cbd 100644 --- a/apps/remix-ide-e2e/src/commands/checkTerminalFilter.ts +++ b/apps/remix-ide-e2e/src/commands/checkTerminalFilter.ts @@ -21,7 +21,7 @@ function checkFilter (browser: NightwatchBrowser, filter: string, test: string, const filterClass = '[data-id="terminalInputSearch"]' browser.setValue(filterClass, filter, function () { browser.execute(function () { - return document.querySelector('[data-id="terminalJournal"]').innerHTML === test + return document.querySelector('[data-id="terminalJournal"]').innerHTML === test || '' }, [], function (result) { browser.clearValue(filterClass).setValue(filterClass, '', function () { if (!result.value) { diff --git a/apps/remix-ide-e2e/src/commands/executeScriptInTerminal.ts b/apps/remix-ide-e2e/src/commands/executeScriptInTerminal.ts new file mode 100644 index 0000000000..0638011291 --- /dev/null +++ b/apps/remix-ide-e2e/src/commands/executeScriptInTerminal.ts @@ -0,0 +1,20 @@ +import { NightwatchBrowser } from 'nightwatch' +import EventEmitter from 'events' + +class ExecuteScriptInTerminal extends EventEmitter { + command (this: NightwatchBrowser, script: string): NightwatchBrowser { + this.api + .clearEditableContent('*[data-id="terminalCliInput"]') + .click('*[data-id="terminalCli"]') + .setValue('*[data-id="terminalCliInput"]', [this.api.Keys.CONTROL, 'a', this.api.Keys.DELETE]) + .sendKeys('*[data-id="terminalCliInput"]', script) + .sendKeys('*[data-id="terminalCliInput"]', this.api.Keys.ENTER) + .sendKeys('*[data-id="terminalCliInput"]', this.api.Keys.ENTER) + .perform(() => { + this.emit('complete') + }) + return this + } +} + +module.exports = ExecuteScriptInTerminal diff --git a/apps/remix-ide-e2e/src/commands/openFile.ts b/apps/remix-ide-e2e/src/commands/openFile.ts index f8191e874f..ad5ec6d06e 100644 --- a/apps/remix-ide-e2e/src/commands/openFile.ts +++ b/apps/remix-ide-e2e/src/commands/openFile.ts @@ -5,6 +5,7 @@ class OpenFile extends EventEmitter { command (this: NightwatchBrowser, name: string) { this.api.perform((done) => { openFile(this.api, name, () => { + console.log('doing done') done() this.emit('complete') }) @@ -22,9 +23,12 @@ function openFile (browser: NightwatchBrowser, name: string, done: VoidFunction) browser.element('css selector', '[data-id="verticalIconsKindfilePanel"] img[data-id="selected"]', (result) => { if (result.status === 0) { done() - } else browser.clickLaunchIcon('filePanel').perform(done) + } else browser.clickLaunchIcon('filePanel').perform(done()) }) - } else browser.clickLaunchIcon('filePanel').perform(done) + } else { + browser.clickLaunchIcon('filePanel').perform(done()) + } + }) }) .waitForElementVisible('li[data-id="treeViewLitreeViewItem' + name + '"', 60000) diff --git a/apps/remix-ide-e2e/src/commands/rightClickCustom.ts b/apps/remix-ide-e2e/src/commands/rightClickCustom.ts new file mode 100644 index 0000000000..f98ff7ea93 --- /dev/null +++ b/apps/remix-ide-e2e/src/commands/rightClickCustom.ts @@ -0,0 +1,37 @@ +import EventEmitter from 'events' +import { NightwatchBrowser } from 'nightwatch' + +class RightClickCustom extends EventEmitter { + command (this: NightwatchBrowser, cssSelector: string) { + this.api.perform((done) => { + rightClickCustom(this.api, cssSelector, () => { + done() + this.emit('complete') + }) + }) + return this + } +} + +function rightClickCustom (browser: NightwatchBrowser, cssSelector: string, callback: VoidFunction) { + browser.execute(function (cssSelector: string) { + const element: any = document.querySelector(cssSelector) + const evt = element.ownerDocument.createEvent('MouseEvents') + const RIGHT_CLICK_BUTTON_CODE = 2 + + evt.initMouseEvent('contextmenu', true, true, + element.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, + false, false, false, RIGHT_CLICK_BUTTON_CODE, null) + if (Object.prototype.hasOwnProperty.call(document, 'createEventObject')) { + // dispatch for IE + return element.fireEvent('onclick', evt) + } else { + // dispatch for firefox + others + return !element.dispatchEvent(evt) + } + }, [cssSelector], function () { + callback() + }) +} + +module.exports = RightClickCustom diff --git a/apps/remix-ide-e2e/src/commands/validateValueInput.ts b/apps/remix-ide-e2e/src/commands/validateValueInput.ts index dd7f653ad7..61e90a80dc 100644 --- a/apps/remix-ide-e2e/src/commands/validateValueInput.ts +++ b/apps/remix-ide-e2e/src/commands/validateValueInput.ts @@ -7,7 +7,7 @@ class ValidateValueInput extends EventEmitter { browser.perform((done) => { browser.clearValue(selector) .pause(2000) - .setValue(selector, valueTosSet) + .setValue(selector, valueTosSet).pause(2000) .execute(function (selector) { const elem = document.querySelector(selector) as HTMLInputElement return elem.value diff --git a/apps/remix-ide-e2e/src/examples/editor-test-contracts.ts b/apps/remix-ide-e2e/src/examples/editor-test-contracts.ts new file mode 100644 index 0000000000..86992350e4 --- /dev/null +++ b/apps/remix-ide-e2e/src/examples/editor-test-contracts.ts @@ -0,0 +1,173 @@ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const testContract = { + name: 'contracts/test.sol', + content: ` + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; + + import "contracts/base.sol"; + import "contracts/import1.sol"; + + contract test is base { + string public publicstring; + string private privatestring; + string internal internalstring; + + struct TestBookDefinition { + string title; + string author; + uint book_id; + } + TestBookDefinition public mybook; + enum MyEnum{ SMALL, MEDIUM, LARGE } + event MyEvent(uint abc); + importcontract importedcontract; + + modifier costs(uint price) { + if (msg.value >= price) { + _; + } + } + constructor(){ + + } + + function testing() public view { + + } + + function myprivatefunction() private { + + } + + function myinternalfunction() internal { + + } + + function myexternalfunction() external { + + } + }`} + + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const baseContract = { + name: 'contracts/base.sol', + content: ` + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; + + import "contracts/baseofbase.sol"; + + contract base is baseofbase { + event BaseEvent(address indexed _from, uint _value); + enum BaseEnum{ SMALL, MEDIUM, LARGE } + struct Book { + string title; + string author; + uint book_id; + } + Book public book; + }`} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const baseOfBaseContract = { + name: 'contracts/baseofbase.sol', + content: ` + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.7.0 <0.9.0; + + contract baseofbase { + + struct BaseBook { + string title; + string author; + uint book_id; + } + BaseBook public basebook; + + string private basestring; + string internal internalbasestring; + + function privatebase() private { + + } + + function internalbasefunction() internal { + + } + + function publicbasefunction() public { + + } + function externalbasefunction() external { + } + }`} + +const import1Contract = { + name: 'contracts/import1.sol', + content: ` + // SPDX-License-Identifier: MIT + pragma solidity >=0.7.0 <0.9.0; + + import "contracts/importbase.sol"; + import "contracts/secondimport.sol"; + +contract importcontract is importbase { + struct ImportedBook { + string title; + string author; + uint book_id; + } + ImportedBook public importedbook; + + string private importprivatestring; + string internal internalimportstring; + string public importpublicstring; + + function privateimport() private { + + } + + function internalimport() internal { + + } + + function publicimport() public { + + } + + function externalimport() external { + } +}`} + +const importbase = { + name: 'contracts/importbase.sol', + content: ` + // SPDX-License-Identifier: MIT +pragma solidity >=0.7.0 <0.9.0; + +contract importbase { + string public importbasestring; +} +`} + +const secondimport = { + name: 'contracts/secondimport.sol', + content: ` + // SPDX-License-Identifier: MIT +pragma solidity >=0.7.0 <0.9.0; + +contract secondimport { + string public secondimportstring; +} +`} + +export default { + testContract, + baseContract, + baseOfBaseContract, + import1Contract, + importbase, + secondimport +} \ No newline at end of file diff --git a/apps/remix-ide-e2e/src/tests/compiler_api.test.ts b/apps/remix-ide-e2e/src/tests/compiler_api.test.ts index 0646b83f80..17d8a96815 100644 --- a/apps/remix-ide-e2e/src/tests/compiler_api.test.ts +++ b/apps/remix-ide-e2e/src/tests/compiler_api.test.ts @@ -21,7 +21,7 @@ module.exports = { 'Should compile using "compileWithParamaters" API #group1': function (browser: NightwatchBrowser) { browser .addFile('test_jsCompile.js', { content: jsCompile }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .waitForElementContainsText('*[data-id="terminalJournal"]', '"languageversion":"0.6.8+commit.0bbfe453"', 60000) .click('*[data-id="terminalClearConsole"]') }, @@ -29,7 +29,7 @@ module.exports = { 'Should compile using "compileWithParamaters" API with optimization On #group2': function (browser: NightwatchBrowser) { browser .addFile('test_jsCompileWithOptimization.js', { content: jsCompileWithOptimization }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .waitForElementContainsText('*[data-id="terminalJournal"]', '\\"optimizer\\":{\\"enabled\\":true,\\"runs\\":300}', 60000) .click('*[data-id="terminalClearConsole"]') }, @@ -37,7 +37,7 @@ module.exports = { 'Should compile using "compileWithParamaters" API with optimization off check default runs #group3': function (browser: NightwatchBrowser) { browser .addFile('test_jsCompileWithOptimizationDefault.js', { content: jsCompileWithOptimizationDefault }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .waitForElementContainsText('*[data-id="terminalJournal"]', '\\"optimizer\\":{\\"enabled\\":false,\\"runs\\":200}', 60000) .click('*[data-id="terminalClearConsole"]') }, @@ -45,7 +45,7 @@ module.exports = { 'Should update the compiler configuration with "setCompilerConfig" API #group4': function (browser: NightwatchBrowser) { browser .addFile('test_updateConfiguration.js', { content: updateConfiguration }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .pause(15000) .addFile('test_updateConfiguration.sol', { content: simpleContract }) .verifyContracts(['StorageTestUpdateConfiguration'], { wait: 5000, version: '0.6.8+commit.0bbfe453' }) diff --git a/apps/remix-ide-e2e/src/tests/debugger.test.ts b/apps/remix-ide-e2e/src/tests/debugger.test.ts index c3541d2163..19918de0c4 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.test.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.test.ts @@ -192,7 +192,7 @@ module.exports = { 'Should call the debugger api: getTrace #group4': function (browser: NightwatchBrowser) { browser .addFile('test_jsGetTrace.js', { content: jsGetTrace }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .pause(3000) .waitForElementContainsText('*[data-id="terminalJournal"]', '{"gas":"0x575f","return":"0x0000000000000000000000000000000000000000000000000000000000000000","structLogs":', 60000) }, @@ -200,7 +200,7 @@ module.exports = { 'Should call the debugger api: debug #group4': function (browser: NightwatchBrowser) { browser .addFile('test_jsDebug.js', { content: jsDebug }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .pause(3000) .clickLaunchIcon('debugger') .waitForElementVisible('*[data-id="slider"]') diff --git a/apps/remix-ide-e2e/src/tests/defaultLayout.test.ts b/apps/remix-ide-e2e/src/tests/defaultLayout.test.ts index d79515020f..8f303bf593 100644 --- a/apps/remix-ide-e2e/src/tests/defaultLayout.test.ts +++ b/apps/remix-ide-e2e/src/tests/defaultLayout.test.ts @@ -42,7 +42,7 @@ module.exports = { browser.waitForElementVisible('div[data-id="remixIdeSidePanel"]') .assert.containsText('h6[data-id="sidePanelSwapitTitle"]', 'FILE EXPLORER') .clickLaunchIcon('filePanel') - .assert.hidden('div[data-id="remixIdeSidePanel"]') + .assert.not.visible('div[data-id="remixIdeSidePanel"]') .clickLaunchIcon('filePanel') .assert.visible('div[data-id="remixIdeSidePanel"]') .assert.containsText('h6[data-id="sidePanelSwapitTitle"]', 'FILE EXPLORER') diff --git a/apps/remix-ide-e2e/src/tests/editor.test.ts b/apps/remix-ide-e2e/src/tests/editor.test.ts index 9a83da9b81..771b59b93a 100644 --- a/apps/remix-ide-e2e/src/tests/editor.test.ts +++ b/apps/remix-ide-e2e/src/tests/editor.test.ts @@ -89,7 +89,7 @@ module.exports = { .addFile('sourcehighlight.js', sourcehighlightScript) .addFile('removeAllSourcehighlightScript.js', removeAllSourcehighlightScript) .openFile('sourcehighlight.js') - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .scrollToLine(32) .waitForElementPresent('.highlightLine33', 60000) .checkElementStyle('.highlightLine33', 'background-color', 'rgb(52, 152, 219)') @@ -105,7 +105,7 @@ module.exports = { browser.waitForElementVisible('li[data-id="treeViewLitreeViewItemremoveSourcehighlightScript.js"]') .click('li[data-id="treeViewLitreeViewItemremoveSourcehighlightScript.js"]') .pause(2000) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts"]') .click('li[data-id="treeViewLitreeViewItemcontracts"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]') @@ -119,7 +119,7 @@ module.exports = { browser.waitForElementVisible('li[data-id="treeViewLitreeViewItemremoveAllSourcehighlightScript.js"]') .click('li[data-id="treeViewLitreeViewItemremoveAllSourcehighlightScript.js"]') .pause(2000) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .waitForElementVisible('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]') .click('li[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]') .pause(2000) @@ -128,119 +128,6 @@ module.exports = { .waitForElementNotPresent('.highlightLine51', 60000) }, - 'Should display the context view #group2': function (browser: NightwatchBrowser) { - browser - .openFile('contracts') - .openFile('contracts/1_Storage.sol') - .waitForElementVisible('#editorView') - .setEditorValue(storageContractWithError) - .pause(2000) - .execute(() => { - (document.getElementById('editorView') as any).gotoLine(17, 16) - }, [], () => {}) - .waitForElementVisible('.contextview') - .waitForElementContainsText('.contextview .type', 'FunctionDefinition') - .waitForElementContainsText('.contextview .name', 'store') - .execute(() => { - (document.getElementById('editorView') as any).gotoLine(18, 12) - }, [], () => {}) - .waitForElementContainsText('.contextview .type', 'uint256') - .waitForElementContainsText('.contextview .name', 'number') - .click('.contextview [data-action="previous"]') // declaration - .pause(1000) - .execute(() => { - return (document.getElementById('editorView') as any).getCursorPosition() - }, [], (result) => { - console.log('result', result) - browser.assert.equal(result.value, '180') - }) - .click('.contextview [data-action="next"]') // back to the initial state - .pause(1000) - .execute(() => { - return (document.getElementById('editorView') as any).getCursorPosition() - }, [], (result) => { - console.log('result', result) - browser.assert.equal(result.value, '323') - }) - .click('.contextview [data-action="next"]') // next reference - .pause(1000) - .execute(() => { - return (document.getElementById('editorView') as any).getCursorPosition() - }, [], (result) => { - console.log('result', result) - browser.assert.equal(result.value, '489') - }) - .click('.contextview [data-action="gotoref"]') // back to the declaration - .pause(1000) - .execute(() => { - return (document.getElementById('editorView') as any).getCursorPosition() - }, [], (result) => { - console.log('result', result) - browser.assert.equal(result.value, '180') - }) - }, - - 'Should display the context view, loop over "Owner" by switching file #group2': function (browser: NightwatchBrowser) { - browser - .clickLaunchIcon('solidity') - .click('[for="autoCompile"]') // disable auto compile - .openFile('contracts') - .openFile('contracts/3_Ballot.sol') - .waitForElementVisible('#editorView') - .setEditorValue(BallotWithARefToOwner) - .clickLaunchIcon('solidity') - .click('*[data-id="compilerContainerCompileBtn"]') // compile - .pause(6000) - .execute(() => { - (document.getElementById('editorView') as any).gotoLine(14, 6) - }, [], () => {}) - .waitForElementVisible('.contextview') - .waitForElementContainsText('.contextview .type', 'ContractDefinition') - .waitForElementContainsText('.contextview .name', 'Owner') - .click('.contextview [data-action="next"]') - .pause(1000) - .execute(() => { - return (document.getElementById('editorView') as any).getCursorPosition() - }, [], (result) => { - console.log('result', result) - browser.assert.equal(result.value, '1061') - }) - .click('.contextview [data-action="next"]') - .pause(1000) - .execute(() => { - return (document.getElementById('editorView') as any).getCursorPosition() - }, [], (result) => { - console.log('result', result) - browser.assert.equal(result.value, '153') - }) - .currentSelectedFileIs('2_Owner.sol') // make sure the current file has been properly changed - .click('.contextview [data-action="next"]') - .pause(1000) - .execute(() => { - return (document.getElementById('editorView') as any).getCursorPosition() - }, [], (result) => { - console.log('result', result) - browser.assert.equal(result.value, '211') - }) - .click('.contextview [data-action="next"]') - .currentSelectedFileIs('3_Ballot.sol') - .pause(1000) - .execute(() => { - return (document.getElementById('editorView') as any).getCursorPosition() - }, [], (result) => { - console.log('result', result) - browser.assert.equal(result.value, '1061') - }) - .click('.contextview [data-action="gotoref"]') // go to the declaration - .pause(1000) - .execute(() => { - return (document.getElementById('editorView') as any).getCursorPosition() - }, [], (result) => { - console.log('result', result) - browser.assert.equal(result.value, '153') - }) - .end() - } } const aceThemes = { @@ -347,148 +234,4 @@ contract Storage { } }` -const BallotWithARefToOwner = ` - - -// SPDX-License-Identifier: GPL-3.0 - -pragma solidity >=0.7.0 <0.9.0; - -import "./2_Owner.sol"; - -/** - * @title Ballot - * @dev Implements voting process along with vote delegation - */ -contract Ballot { - Owner c; - struct Voter { - uint weight; // weight is accumulated by delegation - bool voted; // if true, that person already voted - address delegate; // person delegated to - uint vote; // index of the voted proposal - } - - struct Proposal { - // If you can limit the length to a certain number of bytes, - // always use one of bytes1 to bytes32 because they are much cheaper - bytes32 name; // short name (up to 32 bytes) - uint voteCount; // number of accumulated votes - } - - address public chairperson; - - mapping(address => Voter) public voters; - - Proposal[] public proposals; - - /** - * @dev Create a new ballot to choose one of 'proposalNames'. - * @param proposalNames names of proposals - */ - constructor(bytes32[] memory proposalNames) { - c = new Owner(); - chairperson = msg.sender; - voters[chairperson].weight = 1; - - for (uint i = 0; i < proposalNames.length; i++) { - // 'Proposal({...})' creates a temporary - // Proposal object and 'proposals.push(...)' - // appends it to the end of 'proposals'. - proposals.push(Proposal({ - name: proposalNames[i], - voteCount: 0 - })); - } - } - - /** - * @dev Give 'voter' the right to vote on this ballot. May only be called by 'chairperson'. - * @param voter address of voter - */ - function giveRightToVote(address voter) public { - require( - msg.sender == chairperson, - "Only chairperson can give right to vote." - ); - require( - !voters[voter].voted, - "The voter already voted." - ); - require(voters[voter].weight == 0); - voters[voter].weight = 1; - } - - /** - * @dev Delegate your vote to the voter 'to'. - * @param to address to which vote is delegated - */ - function delegate(address to) public { - Voter storage sender = voters[msg.sender]; - require(!sender.voted, "You already voted."); - require(to != msg.sender, "Self-delegation is disallowed."); - - while (voters[to].delegate != address(0)) { - to = voters[to].delegate; - // We found a loop in the delegation, not allowed. - require(to != msg.sender, "Found loop in delegation."); - } - sender.voted = true; - sender.delegate = to; - Voter storage delegate_ = voters[to]; - if (delegate_.voted) { - // If the delegate already voted, - // directly add to the number of votes - proposals[delegate_.vote].voteCount += sender.weight; - } else { - // If the delegate did not vote yet, - // add to her weight. - delegate_.weight += sender.weight; - } - } - - /** - * @dev Give your vote (including votes delegated to you) to proposal 'proposals[proposal].name'. - * @param proposal index of proposal in the proposals array - */ - function vote(uint proposal) public { - Voter storage sender = voters[msg.sender]; - require(sender.weight != 0, "Has no right to vote"); - require(!sender.voted, "Already voted."); - sender.voted = true; - sender.vote = proposal; - - // If 'proposal' is out of the range of the array, - // this will throw automatically and revert all - // changes. - proposals[proposal].voteCount += sender.weight; - } - - /** - * @dev Computes the winning proposal taking all previous votes into account. - * @return winningProposal_ index of winning proposal in the proposals array - */ - function winningProposal() public view - returns (uint winningProposal_) - { - uint winningVoteCount = 0; - for (uint p = 0; p < proposals.length; p++) { - if (proposals[p].voteCount > winningVoteCount) { - winningVoteCount = proposals[p].voteCount; - winningProposal_ = p; - } - } - } - - /** - * @dev Calls winningProposal() function to get the index of the winner contained in the proposals array and then - * @return winnerName_ the name of the winner - */ - function winnerName() public view - returns (bytes32 winnerName_) - { - winnerName_ = proposals[winningProposal()].name; - } -} -` diff --git a/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts b/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts new file mode 100644 index 0000000000..8dc7bd4440 --- /dev/null +++ b/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts @@ -0,0 +1,518 @@ +'use strict' +import { NightwatchBrowser } from 'nightwatch' +import init from '../helpers/init' +import examples from '../examples/editor-test-contracts' + +const autoCompleteLineElement = (name: string) => { + return `//*[@class='editor-widget suggest-widget visible']//*[@class='contents' and contains(.,'${name}')]` +} + +module.exports = { + '@disabled': true, + before: function (browser: NightwatchBrowser, done: VoidFunction) { + init(browser, done, 'http://127.0.0.1:8080', false) + }, + 'Should add test and base files #group2': function (browser: NightwatchBrowser) { + browser.addFile(examples.testContract.name, examples.testContract) + .addFile(examples.baseContract.name, examples.baseContract) + .addFile(examples.import1Contract.name, examples.import1Contract) + .addFile(examples.baseOfBaseContract.name, examples.baseOfBaseContract) + .addFile(examples.secondimport.name, examples.secondimport) + .addFile(examples.importbase.name, examples.importbase) + .openFile(examples.testContract.name) + }, + 'Should put cursor in the () of the function #group2': function (browser: NightwatchBrowser) { + browser.scrollToLine(36) + const path = "//*[@class='view-line' and contains(.,'myprivatefunction') and contains(.,'private')]//span//span[contains(.,'(')]" + browser.waitForElementVisible('#editorView') + .useXpath() + .click(path).pause(1000) + }, + 'Should complete variable declaration types in a function definition #group2': function (browser: NightwatchBrowser) { + browser + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('uint25') + }) + .waitForElementPresent(autoCompleteLineElement('uint256')) + .click(autoCompleteLineElement('uint256')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' abc') + .sendKeys(this.Keys.ENTER) // we need to split lines for FF texts to pass because the screen is too narrow + .sendKeys(', testb') + }) + .waitForElementPresent(autoCompleteLineElement('"TestBookDefinition"')) + .click(autoCompleteLineElement('"TestBookDefinition"')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' memo') + }) + .waitForElementPresent(autoCompleteLineElement('memory')) + .click(autoCompleteLineElement('memory')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' btextbook') + .sendKeys(this.Keys.ENTER) + .sendKeys(', BaseB') + }) + .waitForElementPresent(autoCompleteLineElement('"BaseBook"')) + .click(autoCompleteLineElement('"BaseBook"')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' stor') + }) + .waitForElementPresent(autoCompleteLineElement('storage')) + .click(autoCompleteLineElement('storage')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' localbbook') + }).pause(3000) + }, + 'Should put cursor at the end of function #group2': function (browser: NightwatchBrowser) { + + const path = "//*[@class='view-line' and contains(.,'localbbook') and contains(.,'private')]//span//span[contains(.,'{')]" + browser + .useXpath() + .click(path).pause(1000) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + // right arrow key + sendKeys(this.Keys.ARROW_RIGHT). + sendKeys(this.Keys.ARROW_RIGHT) + }) + }, + 'Should autcomplete address types': function (browser: NightwatchBrowser) { + browser + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('addre') + }) + .waitForElementPresent(autoCompleteLineElement('address')) + .click(autoCompleteLineElement('address')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' someaddress;') + .sendKeys(this.Keys.ENTER) + }).pause(2000) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('someaddress.') + }) + .waitForElementVisible(autoCompleteLineElement('balance')) + .waitForElementVisible(autoCompleteLineElement('send')) + .waitForElementVisible(autoCompleteLineElement('transfer')) + .waitForElementVisible(autoCompleteLineElement('code')) + .click(autoCompleteLineElement('balance')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys(this.Keys.ENTER) + }) + }, + 'Should autcomplete array types': function (browser: NightwatchBrowser) { + browser + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('uin') + }) + .waitForElementPresent(autoCompleteLineElement('uint')) + .click(autoCompleteLineElement('uint')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('[] mem') + }) + .waitForElementVisible(autoCompleteLineElement('memory')) + .click(autoCompleteLineElement('memory')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' somearray;') + } + ).pause(2000) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys(this.Keys.ENTER) + .sendKeys('somearray.') + }) + .waitForElementVisible(autoCompleteLineElement('push')) + .waitForElementVisible(autoCompleteLineElement('pop')) + .waitForElementVisible(autoCompleteLineElement('length')) + .click(autoCompleteLineElement('length')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys(this.Keys.ENTER) + }) + }, + 'Should see and autocomplete second import because it was imported by the first import #group2': function (browser: NightwatchBrowser) { + browser + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('secondi') + }) + .waitForElementPresent(autoCompleteLineElement('secondimport')) + .click(autoCompleteLineElement('secondimport')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(' sec;') + .sendKeys(this.Keys.ENTER) + }).pause(3000) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('sec.') + }) + .waitForElementVisible(autoCompleteLineElement('secondimportstring')) + .click(autoCompleteLineElement('secondimportstring')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + }) + + }, + 'Should see and autocomplete imported local class #group2': function (browser: NightwatchBrowser) { + browser + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('import') + }) + .waitForElementPresent(autoCompleteLineElement('importedcontract')) + .click(autoCompleteLineElement('importedcontract')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('.') + }) + .waitForElementVisible(autoCompleteLineElement('externalimport')) + .waitForElementVisible(autoCompleteLineElement('importbasestring')) + .waitForElementVisible(autoCompleteLineElement('importedbook')) + .waitForElementVisible(autoCompleteLineElement('importpublicstring')) + .waitForElementVisible(autoCompleteLineElement('publicimport')) + // no private + .waitForElementNotPresent(autoCompleteLineElement('importprivatestring')) + .waitForElementNotPresent(autoCompleteLineElement('privateimport')) + // no internal + .waitForElementNotPresent(autoCompleteLineElement('importinternalstring')) + .waitForElementNotPresent(autoCompleteLineElement('internalimport')) + .click(autoCompleteLineElement('importbasestring')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + }) + + }, + 'Should autocomplete derived and local event when not using this. #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('emit base') + }) + .waitForElementVisible(autoCompleteLineElement('BaseEvent')) + .click(autoCompleteLineElement('BaseEvent')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys('msg.sender') + .sendKeys(this.Keys.TAB) + .sendKeys(this.Keys.TAB) // somehow this is needed to get the cursor to the next parameter, only for selenium + .sendKeys('3232') + .sendKeys(this.Keys.TAB) + .sendKeys(this.Keys.ENTER) + }) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('emit MyEv') + }) + .waitForElementVisible(autoCompleteLineElement('MyEvent')) + .click(autoCompleteLineElement('MyEvent')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys('3232') + .sendKeys(this.Keys.TAB) + .sendKeys(this.Keys.ENTER) + }) + }, + + 'Should type and get msg options #group2': function (browser: NightwatchBrowser) { + browser. + perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER). + sendKeys('msg.') + }) + .waitForElementVisible(autoCompleteLineElement('sender')) + .waitForElementVisible(autoCompleteLineElement('data')) + .waitForElementVisible(autoCompleteLineElement('value')) + .waitForElementVisible(autoCompleteLineElement('gas')) + .waitForElementVisible(autoCompleteLineElement('sig')) + .click(autoCompleteLineElement('sender')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('.') + }) + .waitForElementVisible(autoCompleteLineElement('balance')) + .waitForElementVisible(autoCompleteLineElement('code')) + .waitForElementVisible(autoCompleteLineElement('codehash')) + .waitForElementVisible(autoCompleteLineElement('send')) + .waitForElementVisible(autoCompleteLineElement('transfer')) + .click(autoCompleteLineElement('balance')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER) + }) + }, + 'Should bo and get book #group2': function (browser: NightwatchBrowser) { + browser. + perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER). + sendKeys('bo') + }) + .waitForElementVisible(autoCompleteLineElement('book')) + .click(autoCompleteLineElement('book')) + }, + 'Should autcomplete derived struct #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('.') + }) + .waitForElementVisible(autoCompleteLineElement('author')) + .waitForElementVisible(autoCompleteLineElement('book_id')) + .waitForElementVisible(autoCompleteLineElement('title')) + .click(autoCompleteLineElement('title')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + }) + }, + 'Should bo and get basebook #group2': function (browser: NightwatchBrowser) { + browser. + perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER). + sendKeys('base') + }) + .waitForElementVisible(autoCompleteLineElement('basebook')) + .click(autoCompleteLineElement('basebook')) + }, + 'Should autcomplete derived struct from base class #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('.') + }) + .waitForElementVisible(autoCompleteLineElement('author')) + .waitForElementVisible(autoCompleteLineElement('book_id')) + .waitForElementVisible(autoCompleteLineElement('title')) + .click(autoCompleteLineElement('title')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + }) + }, + 'Should block scoped localbbook #group2': function (browser: NightwatchBrowser) { + browser.pause(4000). + perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER). + sendKeys('localb') + }) + .waitForElementVisible(autoCompleteLineElement('localbbook')) + .click(autoCompleteLineElement('localbbook')) + }, + 'Should autcomplete derived struct from block localbbook #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('.') + }) + .waitForElementVisible(autoCompleteLineElement('author')) + .waitForElementVisible(autoCompleteLineElement('book_id')) + .waitForElementVisible(autoCompleteLineElement('title')) + .click(autoCompleteLineElement('title')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + }) + }, + 'Should block scoped btextbook #group2': function (browser: NightwatchBrowser) { + browser. + perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER). + sendKeys('btext') + }) + .waitForElementVisible(autoCompleteLineElement('btextbook')) + .click(autoCompleteLineElement('btextbook')) + }, + 'Should autcomplete derived struct from block btextbook #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('.') + }) + .waitForElementVisible(autoCompleteLineElement('author')) + .waitForElementVisible(autoCompleteLineElement('book_id')) + .waitForElementVisible(autoCompleteLineElement('title')) + .click(autoCompleteLineElement('title')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + }) + }, + 'Should find private and internal local functions #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('my') + }) + .waitForElementVisible(autoCompleteLineElement('myprivatefunction')) + .waitForElementVisible(autoCompleteLineElement('myinternalfunction')) + .waitForElementVisible(autoCompleteLineElement('memory')) + .click(autoCompleteLineElement('myinternalfunction')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER) + }) + }, + 'Should find internal functions and var from base and owner #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('intern') + }) + .waitForElementVisible(autoCompleteLineElement('internalbasefunction')) + .waitForElementVisible(autoCompleteLineElement('internalstring')) + .waitForElementVisible(autoCompleteLineElement('internalbasestring')) + // keyword internal + .waitForElementVisible(autoCompleteLineElement('internal keyword')) + .click(autoCompleteLineElement('internalbasefunction')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys(this.Keys.ENTER) + }) + }, + + 'Should not find external functions without this. #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('extern') + }) + .waitForElementNotPresent(autoCompleteLineElement('externalbasefunction')) + .waitForElementNotPresent(autoCompleteLineElement('myexternalfunction')) + // keyword internal + .waitForElementVisible(autoCompleteLineElement('external keyword')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys(this.Keys.BACK_SPACE) + .sendKeys(this.Keys.BACK_SPACE) + .sendKeys(this.Keys.BACK_SPACE) + .sendKeys(this.Keys.BACK_SPACE) + .sendKeys(this.Keys.BACK_SPACE) + .sendKeys(this.Keys.BACK_SPACE) + .sendKeys(this.Keys.BACK_SPACE) + }) + }, + 'Should find external functions using this. #group2': function (browser: NightwatchBrowser) { + browser. + perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(this.Keys.ENTER). + sendKeys('this.') + }) + .waitForElementVisible(autoCompleteLineElement('externalbasefunction')) + .waitForElementVisible(autoCompleteLineElement('myexternalfunction')) + }, + 'Should find public functions and vars using this. but not private & other types of nodes #group2': function (browser: NightwatchBrowser) { + browser + .waitForElementVisible(autoCompleteLineElement('"publicbasefunction"')) + .waitForElementVisible(autoCompleteLineElement('"publicstring"')) + .waitForElementVisible(autoCompleteLineElement('"basebook"')) + .waitForElementVisible(autoCompleteLineElement('"mybook"')) + .waitForElementVisible(autoCompleteLineElement('"testing"')) + // but no private functions or vars or other types of nodes + .waitForElementNotPresent(autoCompleteLineElement('"private"')) + .waitForElementNotPresent(autoCompleteLineElement('"BaseEvent"')) + .waitForElementNotPresent(autoCompleteLineElement('"BaseEnum"')) + .waitForElementNotPresent(autoCompleteLineElement('"TestBookDefinition"')) + .click(autoCompleteLineElement('"publicbasefunction"')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions + .sendKeys(this.Keys.ENTER) + }) + }, + 'Should autocomplete local and derived ENUMS #group2': function (browser: NightwatchBrowser) { + browser.perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys('BaseEnum.') + }) + .waitForElementVisible(autoCompleteLineElement('SMALL')) + .waitForElementVisible(autoCompleteLineElement('MEDIUM')) + .waitForElementVisible(autoCompleteLineElement('LARGE')) + .click(autoCompleteLineElement('SMALL')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + .sendKeys('MyEnum.') + }) + .waitForElementVisible(autoCompleteLineElement('SMALL')) + .waitForElementVisible(autoCompleteLineElement('MEDIUM')) + .waitForElementVisible(autoCompleteLineElement('LARGE')) + .click(autoCompleteLineElement('SMALL')) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + sendKeys(';') + .sendKeys(this.Keys.ENTER) + }) + } +} + diff --git a/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts b/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts new file mode 100644 index 0000000000..db86224b11 --- /dev/null +++ b/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts @@ -0,0 +1,236 @@ +'use strict' +import { NightwatchBrowser } from 'nightwatch' +import init from '../helpers/init' + +const checkEditorHoverContent = (browser: NightwatchBrowser, path: string, expectedContent: string, offsetLeft: number = 0) => { + browser.useXpath() + .useXpath() + .moveToElement('//body', 0, 0) // always move away from the hover before the next test in case we hover in the same line on a different element + .waitForElementVisible(path) + .moveToElement(path, offsetLeft, 0) + .useCss() + .waitForElementContainsText('.monaco-hover-content', expectedContent).pause(1000) +} + +module.exports = { + '@disabled': true, + before: function (browser: NightwatchBrowser, done: VoidFunction) { + init(browser, done, 'http://127.0.0.1:8080', false) + }, + + 'Should load the test file': function (browser: NightwatchBrowser) { + browser.openFile('contracts') + .openFile('contracts/3_Ballot.sol') + .waitForElementVisible('#editorView') + .setEditorValue(BallotWithARefToOwner) + .pause(4000) // wait for the compiler to finish + .scrollToLine(37) + }, + 'Should show hover over contract in editor #group1': function (browser: NightwatchBrowser) { + const path = "//*[contains(text(),'BallotHoverTest')]" + checkEditorHoverContent(browser, path, 'contract BallotHoverTest is BallotHoverTest') + checkEditorHoverContent(browser, path, 'contracts/3_Ballot.sol 10:0') + checkEditorHoverContent(browser, path, '@title Ballot') + }, + 'Should show hover over var definition in editor #group1': function (browser: NightwatchBrowser) { + const path = "//*[@class='view-line' and contains(.,'chairperson') and contains(.,'address') and contains(.,'public')]//span//span[contains(.,'chairperson')]" + const expectedContent = 'address public chairperson' + checkEditorHoverContent(browser, path, expectedContent) + }, + 'Should show hover over constructor in editor #group1': function (browser: NightwatchBrowser) { + const path: string = "//*[@class='view-line' and contains(.,'constructor') and contains(.,'bytes32') and contains(.,'memory')]//span//span[contains(.,'constructor')]" + const expectedContent = 'Estimated creation cost: infinite gas Estimated code deposit cost:' + checkEditorHoverContent(browser, path, expectedContent) + }, + 'Should show hover over function in editor #group1': function (browser: NightwatchBrowser) { + browser.scrollToLine(58) + const path: string = "//*[@class='view-line' and contains(.,'giveRightToVote(address') and contains(.,'function') and contains(.,'public')]//span//span[contains(.,'giveRightToVote')]" + let expectedContent = 'Estimated execution cost' + checkEditorHoverContent(browser, path, expectedContent) + expectedContent = 'function giveRightToVote (address internal voter) public nonpayable returns ()' + checkEditorHoverContent(browser, path, expectedContent) + expectedContent = "@dev Give 'voter' the right to vote on this ballot. May only be called by 'chairperson'" + checkEditorHoverContent(browser, path, expectedContent) + }, + 'Should show hover over var components in editor #group1': function (browser: NightwatchBrowser) { + browser.scrollToLine(37) + let path = "//*[@class='view-line' and contains(.,'voters') and contains(.,'weight')]//span//span[contains(.,'voters')]" + let expectedContent = 'mapping(address => struct BallotHoverTest.Voter) public voters' + checkEditorHoverContent(browser, path, expectedContent, 15) + path = "//*[@class='view-line' and contains(.,'voters') and contains(.,'weight')]//span//span[contains(.,'chairperson')]" + expectedContent = 'address public chairperson' + checkEditorHoverContent(browser, path, expectedContent, 3) + path = "//*[@class='view-line' and contains(.,'voters') and contains(.,'weight')]//span//span[contains(.,'weight')]" + expectedContent = 'uint256 internal weight' + checkEditorHoverContent(browser, path, expectedContent) + }, + 'Should show hover over new contract creation in editor #group1': function (browser: NightwatchBrowser) { + let path = "//*[@class='view-line' and contains(.,'Owner') and contains(.,'new')]//span//span[contains(.,'cowner')]" + let expectedContent = 'contract Owner internal cowner' + checkEditorHoverContent(browser, path, expectedContent, 10) + path = "//*[@class='view-line' and contains(.,'Owner') and contains(.,'new')]//span//span[contains(.,'Owner')]" + expectedContent = 'contract Owner is Owner' + checkEditorHoverContent(browser, path, expectedContent, 10) + }, + 'Should show hover over external class member in editor #group1': function (browser: NightwatchBrowser) { + const path = "//*[@class='view-line' and contains(.,'getOwner') and contains(.,'cowner')]//span//span[contains(.,'getOwner')]" + let expectedContent = 'function getOwner () external view returns (address internal )' + checkEditorHoverContent(browser, path, expectedContent, 0) + expectedContent = 'contracts/2_Owner.sol' + checkEditorHoverContent(browser, path, expectedContent, 0) + expectedContent = '@dev Return owner address' + checkEditorHoverContent(browser, path, expectedContent, 0) + }, + 'Should show hover over struct definition in editor #group1': function (browser: NightwatchBrowser) { + browser.scrollToLine(5) + const path = "//*[@class='view-line' and contains(.,'Voter') and contains(.,'struct')]//span//span[contains(.,'Voter')]" + const expectedContent = 'StructDefinition' + checkEditorHoverContent(browser, path, expectedContent) + } +} + + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const BallotWithARefToOwner = `// SPDX-License-Identifier: GPL-3.0 + +pragma solidity >=0.7.0 <0.9.0; + +import "./2_Owner.sol"; + +/** + * @title Ballot + * @dev Implements voting process along with vote delegation + */ +contract BallotHoverTest { + Owner cowner; + struct Voter { + uint weight; // weight is accumulated by delegation + bool voted; // if true, that person already voted + address delegate; // person delegated to + uint vote; // index of the voted proposal + } + + struct Proposal { + // If you can limit the length to a certain number of bytes, + // always use one of bytes1 to bytes32 because they are much cheaper + bytes32 name; // short name (up to 32 bytes) + uint voteCount; // number of accumulated votes + } + + address public chairperson; + + mapping(address => Voter) public voters; + + Proposal[] public proposals; + + /** + * @dev Create a new ballot to choose one of 'proposalNames'. + * @param proposalNames names of proposals + */ + constructor(bytes32[] memory proposalNames) { + cowner = new Owner(); + cowner.getOwner(); + chairperson = msg.sender; + voters[chairperson].weight = 1; + + for (uint i = 0; i < proposalNames.length; i++) { + // 'Proposal({...})' creates a temporary + // Proposal object and 'proposals.push(...)' + // appends it to the end of 'proposals'. + proposals.push(Proposal({ + name: proposalNames[i], + voteCount: 0 + })); + } + } + + /** + * @dev Give 'voter' the right to vote on this ballot. May only be called by 'chairperson'. + * @param voter address of voter + */ + function giveRightToVote(address voter) public { + require( + msg.sender == chairperson, + "Only chairperson can give right to vote." + ); + require( + !voters[voter].voted, + "The voter already voted." + ); + require(voters[voter].weight == 0); + voters[voter].weight = 1; + } + + /** + * @dev Delegate your vote to the voter 'to'. + * @param to address to which vote is delegated + */ + function delegate(address to) public { + Voter storage sender = voters[msg.sender]; + require(!sender.voted, "You already voted."); + require(to != msg.sender, "Self-delegation is disallowed."); + + while (voters[to].delegate != address(0)) { + to = voters[to].delegate; + + // We found a loop in the delegation, not allowed. + require(to != msg.sender, "Found loop in delegation."); + } + sender.voted = true; + sender.delegate = to; + Voter storage delegate_ = voters[to]; + if (delegate_.voted) { + // If the delegate already voted, + // directly add to the number of votes + proposals[delegate_.vote].voteCount += sender.weight; + } else { + // If the delegate did not vote yet, + // add to her weight. + delegate_.weight += sender.weight; + } + } + + /** + * @dev Give your vote (including votes delegated to you) to proposal 'proposals[proposal].name'. + * @param proposal index of proposal in the proposals array + */ + function vote(uint proposal) public { + Voter storage sender = voters[msg.sender]; + require(sender.weight != 0, "Has no right to vote"); + require(!sender.voted, "Already voted."); + sender.voted = true; + sender.vote = proposal; + + // If 'proposal' is out of the range of the array, + // this will throw automatically and revert all + // changes. + proposals[proposal].voteCount += sender.weight; + } + + /** + * @dev Computes the winning proposal taking all previous votes into account. + * @return winningProposal_ index of winning proposal in the proposals array + */ + function winningProposal() public view + returns (uint winningProposal_) + { + uint winningVoteCount = 0; + for (uint p = 0; p < proposals.length; p++) { + if (proposals[p].voteCount > winningVoteCount) { + winningVoteCount = proposals[p].voteCount; + winningProposal_ = p; + } + } + } + + /** + * @dev Calls winningProposal() function to get the index of the winner contained in the proposals array and then + * @return winnerName_ the name of the winner + */ + function winnerName() public view + returns (bytes32 winnerName_) + { + winnerName_ = proposals[winningProposal()].name; + } +} +` \ No newline at end of file diff --git a/apps/remix-ide-e2e/src/tests/editorReferences.test.ts b/apps/remix-ide-e2e/src/tests/editorReferences.test.ts new file mode 100644 index 0000000000..86856a9822 --- /dev/null +++ b/apps/remix-ide-e2e/src/tests/editorReferences.test.ts @@ -0,0 +1,196 @@ +'use strict' +import { NightwatchBrowser } from 'nightwatch' +import init from '../helpers/init' + +const openReferences = (browser: NightwatchBrowser, path: string) => { + (browser as any).useXpath() + .useXpath() + .waitForElementVisible(path) + .click(path) + .perform(function () { + const actions = this.actions({ async: true }); + return actions. + keyDown(this.Keys.SHIFT). + sendKeys(this.Keys.F12) + }) +} + +module.exports = { + before: function (browser: NightwatchBrowser, done: VoidFunction) { + init(browser, done, 'http://127.0.0.1:8080', false) + }, + + 'Should load the test file': function (browser: NightwatchBrowser) { + browser.openFile('contracts') + .openFile('contracts/3_Ballot.sol') + .waitForElementVisible('#editorView') + .setEditorValue(BallotWithARefToOwner) + .pause(10000) // wait for the compiler to finish + .scrollToLine(37) + }, + 'Should show local references': function (browser: NightwatchBrowser) { + browser.scrollToLine(48) + const path = "//*[@class='view-line' and contains(.,'length') and contains(.,'proposalNames')]//span//span[contains(.,'proposalNames')]" + openReferences(browser, path) + browser.waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch']//span[contains(.,'length; i++')]") + .waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch']//span[contains(.,'name:')]") + .waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch']//span[contains(.,'constructor')]") + .keys(browser.Keys.ESCAPE) + }, + 'Should show references of getOwner': function (browser: NightwatchBrowser) { + browser.scrollToLine(39) + const path = "//*[@class='view-line' and contains(.,'getOwner') and contains(.,'cowner')]//span//span[contains(.,'getOwner')]" + openReferences(browser, path) + browser.useXpath() + .waitForElementVisible("//*[@class='monaco-highlighted-label']//span[contains(.,'2_Owner.sol')]") + .waitForElementVisible("//*[@class='monaco-highlighted-label']//span[contains(.,'3_Ballot.sol')]") + .waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch']//span[contains(.,'cowner.getOwner')]") + .waitForElementVisible("//*[contains(@class, 'results-loaded') and contains(., 'References (2)')]") + .keys(browser.Keys.ESCAPE) + } +} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const BallotWithARefToOwner = `// SPDX-License-Identifier: GPL-3.0 + +pragma solidity >=0.7.0 <0.9.0; + +import "./2_Owner.sol"; + +/** + * @title Ballot + * @dev Implements voting process along with vote delegation + */ +contract BallotHoverTest { + Owner cowner; + struct Voter { + uint weight; // weight is accumulated by delegation + bool voted; // if true, that person already voted + address delegate; // person delegated to + uint vote; // index of the voted proposal + } + + struct Proposal { + // If you can limit the length to a certain number of bytes, + // always use one of bytes1 to bytes32 because they are much cheaper + bytes32 name; // short name (up to 32 bytes) + uint voteCount; // number of accumulated votes + } + + address public chairperson; + + mapping(address => Voter) public voters; + + Proposal[] public proposals; + + /** + * @dev Create a new ballot to choose one of 'proposalNames'. + * @param proposalNames names of proposals + */ + constructor(bytes32[] memory proposalNames) { + cowner = new Owner(); + cowner.getOwner(); + chairperson = msg.sender; + voters[chairperson].weight = 1; + + for (uint i = 0; i < proposalNames.length; i++) { + // 'Proposal({...})' creates a temporary + // Proposal object and 'proposals.push(...)' + // appends it to the end of 'proposals'. + proposals.push(Proposal({ + name: proposalNames[i], + voteCount: 0 + })); + } + } + + /** + * @dev Give 'voter' the right to vote on this ballot. May only be called by 'chairperson'. + * @param voter address of voter + */ + function giveRightToVote(address voter) public { + require( + msg.sender == chairperson, + "Only chairperson can give right to vote." + ); + require( + !voters[voter].voted, + "The voter already voted." + ); + require(voters[voter].weight == 0); + voters[voter].weight = 1; + } + + /** + * @dev Delegate your vote to the voter 'to'. + * @param to address to which vote is delegated + */ + function delegate(address to) public { + Voter storage sender = voters[msg.sender]; + require(!sender.voted, "You already voted."); + require(to != msg.sender, "Self-delegation is disallowed."); + + while (voters[to].delegate != address(0)) { + to = voters[to].delegate; + + // We found a loop in the delegation, not allowed. + require(to != msg.sender, "Found loop in delegation."); + } + sender.voted = true; + sender.delegate = to; + Voter storage delegate_ = voters[to]; + if (delegate_.voted) { + // If the delegate already voted, + // directly add to the number of votes + proposals[delegate_.vote].voteCount += sender.weight; + } else { + // If the delegate did not vote yet, + // add to her weight. + delegate_.weight += sender.weight; + } + } + + /** + * @dev Give your vote (including votes delegated to you) to proposal 'proposals[proposal].name'. + * @param proposal index of proposal in the proposals array + */ + function vote(uint proposal) public { + Voter storage sender = voters[msg.sender]; + require(sender.weight != 0, "Has no right to vote"); + require(!sender.voted, "Already voted."); + sender.voted = true; + sender.vote = proposal; + + // If 'proposal' is out of the range of the array, + // this will throw automatically and revert all + // changes. + proposals[proposal].voteCount += sender.weight; + } + + /** + * @dev Computes the winning proposal taking all previous votes into account. + * @return winningProposal_ index of winning proposal in the proposals array + */ + function winningProposal() public view + returns (uint winningProposal_) + { + uint winningVoteCount = 0; + for (uint p = 0; p < proposals.length; p++) { + if (proposals[p].voteCount > winningVoteCount) { + winningVoteCount = proposals[p].voteCount; + winningProposal_ = p; + } + } + } + + /** + * @dev Calls winningProposal() function to get the index of the winner contained in the proposals array and then + * @return winnerName_ the name of the winner + */ + function winnerName() public view + returns (bytes32 winnerName_) + { + winnerName_ = proposals[winningProposal()].name; + } +} +` \ No newline at end of file diff --git a/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts b/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts index 7b26d84679..0a15009a89 100644 --- a/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts +++ b/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts @@ -10,12 +10,12 @@ const testData = { } module.exports = { - + '@disabled': true, before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done) }, - 'Should create a new file `5_New_contract.sol` in file explorer': function (browser: NightwatchBrowser) { + 'Should create a new file `5_New_contract.sol` in file explorer #group1': function (browser: NightwatchBrowser) { browser.waitForElementVisible('div[data-id="remixIdeSidePanel"]') .clickLaunchIcon('filePanel') .assert.containsText('h6[data-id="sidePanelSwapitTitle"]', 'FILE EXPLORER') @@ -28,7 +28,7 @@ module.exports = { .waitForElementVisible('*[data-id="treeViewLitreeViewItem5_New_contract.sol"]', 7000) }, - 'Should rename `5_New_contract.sol` to 5_Renamed_Contract.sol': function (browser: NightwatchBrowser) { + 'Should rename `5_New_contract.sol` to 5_Renamed_Contract.sol #group1': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[data-id="treeViewLitreeViewItem5_New_contract.sol"]') .click('*[data-id="treeViewLitreeViewItem5_New_contract.sol"]') @@ -36,14 +36,14 @@ module.exports = { .waitForElementVisible('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"]') }, - 'Should delete file `5_Renamed_Contract.sol` from file explorer': function (browser: NightwatchBrowser) { + 'Should delete file `5_Renamed_Contract.sol` from file explorer #group1': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"]') .removeFile('5_Renamed_Contract.sol', 'default_workspace') .waitForElementNotPresent('*[data-id="treeViewLitreeViewItem5_Renamed_Contract.sol"') }, - 'Should create a new folder': function (browser: NightwatchBrowser) { + 'Should create a new folder #group1': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[data-id="treeViewLitreeViewItemREADME.txt"]') .click('li[data-id="treeViewLitreeViewItemREADME.txt"]') // focus on root directory @@ -55,7 +55,7 @@ module.exports = { .waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_Tests"]') }, - 'Should rename Browser_Tests folder to Browser_E2E_Tests': function (browser: NightwatchBrowser) { + 'Should rename Browser_Tests folder to Browser_E2E_Tests #group1': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_Tests"]') .click('*[data-id="treeViewLitreeViewItemBrowser_Tests"]') @@ -63,10 +63,10 @@ module.exports = { .waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_E2E_Tests"]') }, - 'Should delete Browser_E2E_Tests folder': function (browser: NightwatchBrowser) { + 'Should delete Browser_E2E_Tests folder #group1': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_E2E_Tests"]') - .rightClick('[data-path="Browser_E2E_Tests"]') + .rightClickCustom('[data-path="Browser_E2E_Tests"]') .click('*[id="menuitemdelete"]') .waitForElementVisible('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok', 60000) .pause(2000) @@ -99,9 +99,12 @@ module.exports = { }) }, - 'Should open local filesystem explorer': function (browser: NightwatchBrowser) { - browser.waitForElementVisible('*[data-id="filePanelFileExplorerTree"]') + 'Should open local filesystem explorer #group2': !function (browser: NightwatchBrowser) { + browser.waitForElementVisible('div[data-id="remixIdeSidePanel"]') + .clickLaunchIcon('filePanel') + .waitForElementVisible('*[data-id="filePanelFileExplorerTree"]') .click('[data-id="remixUIWorkspaceExplorer"]') + .waitForElementPresent('*[data-id="fileExplorerFileUpload"]') .setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile1) .setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile2) .setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile3) diff --git a/apps/remix-ide-e2e/src/tests/fileManager_api.test.ts b/apps/remix-ide-e2e/src/tests/fileManager_api.test.ts index 32da1f4828..26a2e7cffd 100644 --- a/apps/remix-ide-e2e/src/tests/fileManager_api.test.ts +++ b/apps/remix-ide-e2e/src/tests/fileManager_api.test.ts @@ -11,7 +11,7 @@ module.exports = { 'Should execute `file` api from file manager external api #group1': function (browser: NightwatchBrowser) { browser .addFile('file.js', { content: executeFile }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .pause(1000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'file.js', 60000) }, @@ -19,7 +19,7 @@ module.exports = { 'Should execute `exists` api from file manager external api #group1': function (browser: NightwatchBrowser) { browser .addFile('exists.js', { content: executeExists }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .waitForElementContainsText('*[data-id="terminalJournal"]', 'exists.js true', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'non-exists.js false', 60000) }, @@ -27,14 +27,14 @@ module.exports = { 'Should execute `open` api from file manager external api #group1': function (browser: NightwatchBrowser) { browser .addFile('open.js', { content: executeOpen }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .waitForElementContainsText('*[data-id="terminalJournal"]', 'contracts/3_Ballot.sol', 60000) }, 'Should execute `writeFile` api from file manager external api #group1': function (browser: NightwatchBrowser) { browser .addFile('writeFile.js', { content: executeWriteFile }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .pause(2000) .openFile('new_contract.sol') .getEditorValue((content) => { @@ -45,23 +45,23 @@ module.exports = { 'Should execute `readFile` api from file manager external api #group2': function (browser: NightwatchBrowser) { browser .addFile('writeFile.js', { content: executeWriteFile }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .addFile('readFile.js', { content: executeReadFile }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .waitForElementContainsText('*[data-id="terminalJournal"]', 'pragma solidity ^0.6.0', 60000) }, 'Should execute `copyFile` api from file manager external api #group2': function (browser: NightwatchBrowser) { browser .addFile('copyFile.js', { content: executeCopyFile }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .waitForElementContainsText('*[data-id="terminalJournal"]', 'pragma solidity >=0.7.0 <0.9.0;', 60000) }, 'Should execute `rename` api from file manager external api #group2': function (browser: NightwatchBrowser) { browser .addFile('renameFile.js', { content: executeRename }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .pause(2000) .waitForElementPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]', 60000) }, @@ -69,7 +69,7 @@ module.exports = { 'Should execute `mkdir` api from file manager external api #group3': function (browser: NightwatchBrowser) { browser .addFile('mkdirFile.js', { content: executeMkdir }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .pause(2000) .waitForElementPresent('[data-id="treeViewLitreeViewItemTest_Folder"]', 80000) }, @@ -77,7 +77,7 @@ module.exports = { 'Should execute `readdir` api from file manager external api #group3': function (browser: NightwatchBrowser) { browser .addFile('readdirFile.js', { content: executeReaddir }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .waitForElementContainsText('*[data-id="terminalJournal"]', 'Test_Folder isDirectory', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'true', 5000) }, @@ -86,7 +86,7 @@ module.exports = { browser .addFile('old_contract.sol', { content: 'test' }) .addFile('removeFile.js', { content: executeRemove }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .pause(2000) .waitForElementNotPresent('[data-id="treeViewLitreeViewItemold_contract.sol"]', 60000) }, @@ -95,7 +95,7 @@ module.exports = { 'Should execute `remove` api from file manager external api on a folder #group4': function (browser: NightwatchBrowser) { browser .addFile('test_jsRemoveFolder.js', { content: executeRemoveOnFolder }) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .pause(2000) .waitForElementNotPresent('[data-id="treeViewLitreeViewItemcontracts"]', 60000) .end() diff --git a/apps/remix-ide-e2e/src/tests/gist.test.ts b/apps/remix-ide-e2e/src/tests/gist.test.ts index 0fd6efa234..5bf3b34d5d 100644 --- a/apps/remix-ide-e2e/src/tests/gist.test.ts +++ b/apps/remix-ide-e2e/src/tests/gist.test.ts @@ -34,7 +34,7 @@ module.exports = { .sendKeys('*[data-id$="/blank"] .remixui_items', browser.Keys.ENTER) .waitForElementVisible('*[data-id="treeViewLitreeViewItemBrowser_Tests"]') .addFile('File.sol', { content: '' }) - .executeScript(`remix.loadgist('${gistid}')`) + .executeScriptInTerminal(`remix.loadgist('${gistid}')`) // .perform((done) => { if (runtimeBrowser === 'chrome') { browser.openFile('gists') } done() }) .waitForElementVisible(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`) .click(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`) @@ -58,7 +58,7 @@ module.exports = { const gistid = id[1] browser .click('[data-id="default_workspace-modal-footer-cancel-react"]') - .executeScript(`remix.loadgist('${gistid}')`) + .executeScriptInTerminal(`remix.loadgist('${gistid}')`) // .perform((done) => { if (runtimeBrowser === 'chrome') { browser.openFile('gists') } done() }) .waitForElementVisible(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`) .click(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`) diff --git a/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts b/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts index bf4936a2d4..cf163dbb94 100644 --- a/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts +++ b/apps/remix-ide-e2e/src/tests/importFromGithub.test.ts @@ -37,8 +37,8 @@ module.exports = { .setValue('input[data-id="homeTabModalDialogCustomPromptText"]', testData.invalidURL) .waitForElementVisible('*[data-id="homeTab-modal-footer-ok-react"]') .click('[data-id="homeTab-modal-footer-ok-react"]') // submitted - .waitForElementVisible('*[data-shared="tooltipPopup"]') - .assert.containsText('*[data-shared="tooltipPopup"] span', 'not found ' + testData.invalidURL) + //.waitForElementVisible('*[data-shared="tooltipPopup"]') + //.waitForElementContainsText('*[data-shared="tooltipPopup"] span', 'not found ' + testData.invalidURL) }, 'Import From GitHub For Valid URL #group2': function (browser: NightwatchBrowser) { diff --git a/apps/remix-ide-e2e/src/tests/plugin_api.ts b/apps/remix-ide-e2e/src/tests/plugin_api.ts index c7ef41a231..a05197f4b6 100644 --- a/apps/remix-ide-e2e/src/tests/plugin_api.ts +++ b/apps/remix-ide-e2e/src/tests/plugin_api.ts @@ -214,7 +214,7 @@ module.exports = { } }) .waitForElementVisible('[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') - .rightClick('[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]').useXpath().waitForElementVisible('//*[@id="menuitemtestcommand"]').click('//*[@id="menuitemtestcommand"]', async () => { + .rightClickCustom('[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]').useXpath().waitForElementVisible('//*[@id="menuitemtestcommand"]').click('//*[@id="menuitemtestcommand"]', async () => { // @ts-ignore browser.click('//*[@data-id="verticalIconsKindlocalPlugin"]').frame(0, async () => { await clickAndCheckLog(browser, null, { id: 'localPlugin', name: 'testCommand', label: 'testCommand', type: [], extension: ['.sol'], path: ['contracts/1_Storage.sol'], pattern: [] }, null, null) @@ -321,14 +321,14 @@ module.exports = { // DGIT 'Should have changes on new workspace #group3': async function (browser: NightwatchBrowser) { await clickAndCheckLog(browser, 'filePanel:createWorkspace', null, null, 'dgit') - await clickAndCheckLog(browser, 'dGitProvider:status', [['README.txt', 0, 2, 0], ['contracts/1_Storage.sol', 0, 2, 0], ['contracts/2_Owner.sol', 0, 2, 0], ['contracts/3_Ballot.sol', 0, 2, 0], ['scripts/deploy_with_ethers.ts', 0, 2, 0], ['scripts/deploy_with_web3.ts', 0, 2, 0], ['tests/Ballot_test.sol', 0, 2, 0]], ['tests/storage.test.js', 0, 2, 0], null, null) + await clickAndCheckLog(browser, 'dGitProvider:status', [["README.txt",0,2,0],["contracts/1_Storage.sol",0,2,0],["contracts/2_Owner.sol",0,2,0],["contracts/3_Ballot.sol",0,2,0],["scripts/deploy_with_ethers.ts",0,2,0],["scripts/deploy_with_web3.ts",0,2,0],["scripts/ethers-lib.ts",0,2,0],["scripts/web3-lib.ts",0,2,0],["tests/Ballot_test.sol",0,2,0],["tests/storage.test.js",0,2,0]], null, null) }, 'Should stage contract #group3': async function (browser: NightwatchBrowser) { await clickAndCheckLog(browser, 'dGitProvider:add', null, null, { filepath: 'contracts/1_Storage.sol' }) - await clickAndCheckLog(browser, 'dGitProvider:status', [['README.txt', 0, 2, 0], ['contracts/1_Storage.sol', 0, 2, 2], ['contracts/2_Owner.sol', 0, 2, 0], ['contracts/3_Ballot.sol', 0, 2, 0], ['scripts/deploy_with_ethers.ts', 0, 2, 0], ['scripts/deploy_with_web3.ts', 0, 2, 0], ['tests/Ballot_test.sol', 0, 2, 0]], ['tests/storage.test.js', 0, 2, 0], null, null) + await clickAndCheckLog(browser, 'dGitProvider:status', [["README.txt",0,2,0],["contracts/1_Storage.sol",0,2,2],["contracts/2_Owner.sol",0,2,0],["contracts/3_Ballot.sol",0,2,0],["scripts/deploy_with_ethers.ts",0,2,0],["scripts/deploy_with_web3.ts",0,2,0],["scripts/ethers-lib.ts",0,2,0],["scripts/web3-lib.ts",0,2,0],["tests/Ballot_test.sol",0,2,0],["tests/storage.test.js",0,2,0]], null, null) }, 'Should commit changes #group3': async function (browser: NightwatchBrowser) { await clickAndCheckLog(browser, 'dGitProvider:commit', null, null, { author: { name: 'Remix', email: 'Remix' }, message: 'commit-message' }) @@ -417,7 +417,7 @@ module.exports = { .frameParent() .useCss() .addFile('test_modal.js', { content: testModalToasterApi }) - .executeScript('remix.execute(\'test_modal.js\')') + .executeScriptInTerminal('remix.execute(\'test_modal.js\')') .useCss() .waitForElementVisible('*[data-id="test_id_1_ModalDialogModalBody-react"]', 60000) .assert.containsText('*[data-id="test_id_1_ModalDialogModalBody-react"]', 'message 1') diff --git a/apps/remix-ide-e2e/src/tests/remixd.test.ts b/apps/remix-ide-e2e/src/tests/remixd.test.ts index 4e0772bf5f..6cf256e2cc 100644 --- a/apps/remix-ide-e2e/src/tests/remixd.test.ts +++ b/apps/remix-ide-e2e/src/tests/remixd.test.ts @@ -102,7 +102,7 @@ module.exports = { 'Run git status': '' + function (browser) { browser - .executeScript('git status') + .executeScriptInTerminal('git status') .pause(3000) .journalLastChildIncludes('On branch ') }, diff --git a/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts b/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts index 6d87899d79..dceb54a420 100644 --- a/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts +++ b/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts @@ -39,8 +39,8 @@ module.exports = { .waitForElementVisible('*[data-id="signMessageTextarea"]', 120000) .click('*[data-id="signMessageTextarea"]') .setValue('*[data-id="signMessageTextarea"]', 'Remix is cool!') - .assert.elementNotPresent('*[data-id="settingsRemixRunSignMsgHash"]') - .assert.elementNotPresent('*[data-id="settingsRemixRunSignMsgSignature"]') + .assert.not.elementPresent('*[data-id="settingsRemixRunSignMsgHash"]') + .assert.not.elementPresent('*[data-id="settingsRemixRunSignMsgSignature"]') .pause(2000) .waitForElementPresent('[data-id="udappNotify-modal-footer-ok-react"]') .click('[data-id="udappNotify-modal-footer-ok-react"]') @@ -200,7 +200,7 @@ module.exports = { 'Call web3.eth.getAccounts() using Injected Provider (Metamask)': '' + function (browser: NightwatchBrowser) { browser - .executeScript('web3.eth.getAccounts()') + .executeScriptInTerminal('web3.eth.getAccounts()') .pause(2000) .journalLastChildIncludes('[ "0x76a3ABb5a12dcd603B52Ed22195dED17ee82708f" ]') .end() diff --git a/apps/remix-ide-e2e/src/tests/search.test.ts b/apps/remix-ide-e2e/src/tests/search.test.ts index c8f90c5978..c91531d587 100644 --- a/apps/remix-ide-e2e/src/tests/search.test.ts +++ b/apps/remix-ide-e2e/src/tests/search.test.ts @@ -12,7 +12,7 @@ module.exports = { browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') .click('*[plugin="search"]').waitForElementVisible('*[id="search_input"]') .waitForElementVisible('*[id="search_include"]') - .setValue('*[id="search_include"]', ', *.txt').pause(2000) + .setValue('*[id="search_include"]', ', *.*').pause(2000) .setValue('*[id="search_input"]', 'read').sendKeys('*[id="search_input"]', browser.Keys.ENTER) .pause(1000) .waitForElementContainsText('*[data-id="search_results"]', '3_BALLOT.SOL', 60000) @@ -100,7 +100,7 @@ module.exports = { browser.click('*[data-id="confirm_replace_label"]').pause(500) .clearValue('*[id="search_input"]') .setValue('*[id="search_input"]', 'replacing').sendKeys('*[id="search_input"]', browser.Keys.ENTER).pause(1000) - .setValue('*[id="search_replace"]', '2').pause(1000) + .setValue('*[id="search_replace"]', 'replacing2').pause(1000) .waitForElementVisible('*[data-id="contracts/2_Owner.sol-33-71"]') .moveToElement('*[data-id="contracts/2_Owner.sol-33-71"]', 10, 10) .waitForElementVisible('*[data-id="replace-contracts/2_Owner.sol-33-71"]') diff --git a/apps/remix-ide-e2e/src/tests/specialFunctions.test.ts b/apps/remix-ide-e2e/src/tests/specialFunctions.test.ts index bcdc3c4977..ad41980081 100644 --- a/apps/remix-ide-e2e/src/tests/specialFunctions.test.ts +++ b/apps/remix-ide-e2e/src/tests/specialFunctions.test.ts @@ -33,7 +33,7 @@ module.exports = { .journalLastChildIncludes('to: CheckSpecials.(fallback)') .journalLastChildIncludes('value: 0 wei') .journalLastChildIncludes('data: 0xaa') - .perform(done) + .perform(done()) }) }) }, @@ -46,7 +46,7 @@ module.exports = { .pause(1000) .waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`) .assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'The calldata should be a valid hexadecimal value with size of at least one byte.') - .perform(done) + .perform(done()) }) }) }, @@ -58,7 +58,7 @@ module.exports = { .pause(1000) .waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`) .assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'The calldata should be a valid hexadecimal value.') - .perform(done) + .perform(done()) }) }) }, @@ -71,7 +71,7 @@ module.exports = { .journalLastChildIncludes('to: CheckSpecials.(receive)') .journalLastChildIncludes('value: 1 wei') .journalLastChildIncludes('data: 0x') - .perform(done) + .perform(done()) }) }) }, @@ -83,7 +83,7 @@ module.exports = { .pause(1000) .journalLastChildIncludes('to CheckSpecials.(fallback) errored:') .journalLastChildIncludes('The called function should be payable if you send value') - .perform(done) + .perform(done()) }) }) }, @@ -101,7 +101,7 @@ module.exports = { .journalLastChildIncludes('to: CheckSpecials.(receive)') .journalLastChildIncludes('value: 1 wei') .journalLastChildIncludes('data: 0x') - .perform(done) + .perform(done()) }) }) }, @@ -113,7 +113,7 @@ module.exports = { .pause(1000) .waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`) .assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, '\'Fallback\' function is not defined') - .perform(done) + .perform(done()) }) }) }, @@ -131,7 +131,7 @@ module.exports = { .journalLastChildIncludes('to: CheckSpecials.(fallback)') .journalLastChildIncludes('value: 1 wei') .journalLastChildIncludes('data: 0x') - .perform(done) + .perform(done()) }) }) }, @@ -144,7 +144,7 @@ module.exports = { .journalLastChildIncludes('to: CheckSpecials.(fallback)') .journalLastChildIncludes('value: 1 wei') .journalLastChildIncludes('data: 0xaa') - .perform(done) + .perform(done()) }) }) }, @@ -161,7 +161,7 @@ module.exports = { .pause(1000) .waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`) .assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'should have either \'receive\' or payable \'fallback\'') - .perform(done) + .perform(done()) }) }) }, @@ -184,7 +184,7 @@ module.exports = { .journalLastChildIncludes('to: CheckSpecials.(fallback)') .journalLastChildIncludes('value: 999999998765257135 wei') .journalLastChildIncludes('data: 0xaa') - .perform(done) + .perform(done()) }) }) }, @@ -196,7 +196,7 @@ module.exports = { .journalLastChildIncludes('to: CheckSpecials.(receive)') .journalLastChildIncludes('value: 1 wei') .journalLastChildIncludes('data: 0x') - .perform(done) + .perform(done()) }) }) }, @@ -217,7 +217,7 @@ module.exports = { .pause(1000) .waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`) .assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'Both \'receive\' and \'fallback\' functions are not defined') - .perform(done) + .perform(done()) }) }) .end() diff --git a/apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts b/apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts index 2a2b39b523..d254d15eee 100644 --- a/apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts +++ b/apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts @@ -42,7 +42,7 @@ module.exports = { .waitForElementPresent('#staticanalysisresult .warning', 5000) .assert.containsText('#verticalIconsKindsolidityStaticAnalysis .remixui_status', '1') // Check warning count .verify.elementPresent('input[name="showLibWarnings"]') - .verify.elementNotPresent('input[name="showLibWarnings"]:checked') + .verify.not.elementPresent('input[name="showLibWarnings"]:checked') .verify.elementPresent('label[id="headingshowLibWarnings"]') .click('label[id="headingshowLibWarnings"]') .pause(1000) @@ -62,7 +62,7 @@ function runTests (browser: NightwatchBrowser) { .testContracts('Untitled.sol', sources[0]['Untitled.sol'], ['TooMuchGas', 'test1', 'test2']) .clickLaunchIcon('solidityStaticAnalysis') .click('#staticanalysisButton button') - .waitForElementPresent('#staticanalysisresult .warning', 2000, true, function () { + .waitForElementPresent('#staticanalysisresult .warning', 2000, 500, true, function () { listSelectorContains(['Use of tx.origin', 'Fallback function of contract TooMuchGas requires too much gas', 'TooMuchGas.() : Variables have very similar names "test" and "test1".', diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index 79305cd22d..e7d76869e0 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -10,7 +10,7 @@ module.exports = { 'Should execution a simple console command #group1 #group999': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[data-id="terminalCli"]', 10000) - .executeScript('console.log(1 + 1)') + .executeScriptInTerminal('console.log(1 + 1)') .pause(2000) .waitForElementContainsText('*[data-id="terminalJournal"]', '2', 60000) }, @@ -26,7 +26,7 @@ module.exports = { 'Async/Await Script #group1': function (browser: NightwatchBrowser) { browser .addFile('asyncAwait.js', { content: asyncAwait }) - .executeScript('remix.execute("asyncAwait.js")') + .executeScriptInTerminal('remix.execute("asyncAwait.js")') .waitForElementContainsText('*[data-id="terminalJournal"]', 'Waiting Promise', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'result - ', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'Promise Resolved', 60000) @@ -35,13 +35,13 @@ module.exports = { 'Call Remix File Manager from a script #group2': function (browser: NightwatchBrowser) { browser .addFile('asyncAwaitWithFileManagerAccess.js', { content: asyncAwaitWithFileManagerAccess }) - .executeScript('remix.execute(\'asyncAwaitWithFileManagerAccess.js\')') + .executeScriptInTerminal('remix.execute(\'asyncAwaitWithFileManagerAccess.js\')') .waitForElementContainsText('*[data-id="terminalJournal"]', 'contract Ballot {', 60000) }, 'Call web3.eth.getAccounts() using Remix VM #group2': function (browser: NightwatchBrowser) { browser - .executeScript('web3.eth.getAccounts()') + .executeScriptInTerminal('web3.eth.getAccounts()') .waitForElementContainsText('*[data-id="terminalJournal"]', '["0x5B38Da6a701c568545dCfcB03FcB875f56beddC4","0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2","0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db","0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB","0x617F2E2fD72FD9D5503197092aC168c91465E7f2","0x17F6AD8Ef982297579C203069C1DbfFE4348c372","0x5c6B0f7Bf3E7ce046039Bd8FABdfD3f9F5021678","0x03C6FcED478cBbC9a4FAB34eF9f40767739D1Ff7","0x1aE0EA34a72D944a8C7603FfB3eC30a6669E454C","0x0A098Eda01Ce92ff4A4CCb7A4fFFb5A43EBC70DC","0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c","0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C","0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB","0x583031D1113aD414F02576BD6afaBfb302140225","0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]') }, @@ -51,7 +51,7 @@ module.exports = { .clickLaunchIcon('udapp') .switchEnvironment('External Http Provider') .modalFooterOKClick('basic-http-provider') - .executeScript('web3.eth.getAccounts()') + .executeScriptInTerminal('web3.eth.getAccounts()') .waitForElementContainsText('*[data-id="terminalJournal"]', '["', 60000) // we check if an array is present, don't need to check for the content .waitForElementContainsText('*[data-id="terminalJournal"]', '"]', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '","', 60000) @@ -63,7 +63,7 @@ module.exports = { .addFile('resolveExternalUrlAndSave.js', { content: resolveExternalUrlAndSave }) .openFile('resolveExternalUrlAndSave.js') .pause(1000) - .executeScript('remix.execute(\'resolveExternalUrlAndSave.js\')') + .executeScriptInTerminal('remix.execute(\'resolveExternalUrlAndSave.js\')') .waitForElementContainsText('*[data-id="terminalJournal"]', 'Implementation of the {IERC20} interface.', 60000) .openFile('.deps/github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol') }, @@ -74,7 +74,7 @@ module.exports = { .addFile('resolveUrl.js', { content: resolveUrl }) .openFile('resolveUrl.js') .pause(1000) - .executeScript('remix.execute(\'resolveUrl.js\')') + .executeScriptInTerminal('remix.execute(\'resolveUrl.js\')') .waitForElementContainsText('*[data-id="terminalJournal"]', 'contract Ballot {', 60000) }, @@ -84,7 +84,7 @@ module.exports = { .addFile('resolveExternalUrlAndSaveToaPath.js', { content: resolveExternalUrlAndSaveToaPath }) .openFile('resolveExternalUrlAndSaveToaPath.js') .pause(1000) - .executeScript('remix.execute(\'resolveExternalUrlAndSaveToaPath.js\')') + .executeScriptInTerminal('remix.execute(\'resolveExternalUrlAndSaveToaPath.js\')') .waitForElementContainsText('*[data-id="terminalJournal"]', 'abstract contract ERC20Burnable', 60000) .openFile('.deps/github/newFile.sol') @@ -105,7 +105,7 @@ module.exports = { .openFile('contracts/2_Owner.sol') .clickLaunchIcon('solidity') .click('*[data-id="compilerContainerCompileBtn"]').pause(5000) // compile Owner - .executeScript('remix.execute(\'deployWithEthersJs.js\')') + .executeScriptInTerminal('remix.execute(\'deployWithEthersJs.js\')') .waitForElementContainsText('*[data-id="terminalJournal"]', 'Contract Address:', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', '0xd9145CCE52D386f254917e481eB44e9943F39138', 60000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'Deployment successful.', 60000) @@ -127,7 +127,7 @@ module.exports = { .clickLaunchIcon('solidity') .click('*[data-id="compilerContainerCompileBtn"]') .pause(1000) // compile Storage - .executeScript('remix.execute(\'scripts/storage.test.js\')') + .executeScriptInTerminal('remix.execute(\'scripts/storage.test.js\')') .pause(1000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'Running tests....') .waitForElementContainsText('*[data-id="terminalJournal"]', 'storage contract Address:') @@ -149,7 +149,7 @@ module.exports = { .clickLaunchIcon('solidity') .click('*[data-id="compilerContainerCompileBtn"]') .pause(1000) // compile StorageWithLib - .executeScript('remix.execute(\'scripts/storageWithLib.test.js\')') + .executeScriptInTerminal('remix.execute(\'scripts/storageWithLib.test.js\')') .pause(1000) .waitForElementContainsText('*[data-id="terminalJournal"]', 'Running tests....') .waitForElementContainsText('*[data-id="terminalJournal"]', 'Storage with lib') diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index 760d3eb6ae..832dca69d0 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -227,7 +227,7 @@ module.exports = { // default values .assert.containsText('#evmVersionSelector option[data-id="selected"]', 'default') .verify.elementPresent('#optimize') - .assert.elementNotPresent('#optimize:checked') + .assert.not.elementPresent('#optimize:checked') .verify.elementPresent('#runs:disabled') .click('[for="optimize"') .verify.attributeEquals('#runs', 'value', '200') diff --git a/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts b/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts index 63a98743a6..3cbe497dd7 100644 --- a/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts +++ b/apps/remix-ide-e2e/src/tests/verticalIconsPanel.test.ts @@ -13,7 +13,7 @@ module.exports = { .click('*[data-id="verticalIconsKindpluginManager"]') .scrollAndClick('*[data-id="pluginManagerComponentActivateButtondebugger"]') .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]', 7000) - .rightClick('[data-id="verticalIconsKinddebugger"]') + .rightClickCustom('[data-id="verticalIconsKinddebugger"]') .waitForElementVisible('*[id="menuitemdeactivate"]') .waitForElementVisible('*[id="menuitemdocumentation"]') .click('*[data-id="remixIdeIconPanel"]') @@ -23,7 +23,7 @@ module.exports = { browser.waitForElementVisible('div[data-id="remixIdeIconPanel"]', 10000) .waitForElementVisible('*[data-id="verticalIconsKinddebugger"]', 7000) .pause(5000) - .rightClick('[data-id="verticalIconsKinddebugger"]') + .rightClickCustom('[data-id="verticalIconsKinddebugger"]') .click('*[id="menuitemdeactivate"]') .click('*[data-id="verticalIconsKindsettings"]') .click('*[data-id="verticalIconsKindpluginManager"]') diff --git a/apps/remix-ide-e2e/src/types/index.d.ts b/apps/remix-ide-e2e/src/types/index.d.ts index c45c1d4d3d..4f5568e773 100644 --- a/apps/remix-ide-e2e/src/types/index.d.ts +++ b/apps/remix-ide-e2e/src/types/index.d.ts @@ -21,14 +21,14 @@ declare module 'nightwatch' { modalFooterOKClick(id?: string): NightwatchBrowser, clickInstance(index: number): NightwatchBrowser, journalLastChildIncludes(val: string): NightwatchBrowser, - executeScript(script: string): NightwatchBrowser, + executeScriptInTerminal(script: string): NightwatchBrowser, clearEditableContent(cssSelector: 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, renamePath(path: string, newFileName: string, renamedPath: string): NightwatchBrowser, - rightClick(cssSelector: string): NightwatchBrowser, + rightClickCustom(cssSelector: string): NightwatchBrowser, scrollToLine(line: number): NightwatchBrowser, waitForElementContainsText(id: string, value: string, timeout?: number): NightwatchBrowser, getModalBody(callback: (value: string, cb: VoidFunction) => void): NightwatchBrowser, diff --git a/package.json b/package.json index 37cbe00ad6..a0a8f0f101 100644 --- a/package.json +++ b/package.json @@ -153,7 +153,7 @@ "@ethereumjs/vm": "^5.5.3", "@ethersphere/bee-js": "^3.2.0", "@isomorphic-git/lightning-fs": "^4.4.1", - "@monaco-editor/react": "^4.3.1", + "@monaco-editor/react": "4.4.5", "@remixproject/engine": "^0.3.31", "@remixproject/engine-web": "^0.3.31", "@remixproject/plugin": "^0.3.31", @@ -161,6 +161,7 @@ "@remixproject/plugin-utils": "^0.3.31", "@remixproject/plugin-webview": "^0.3.31", "@remixproject/plugin-ws": "^0.3.31", + "@types/nightwatch": "^2.0.9", "ansi-gray": "^0.1.1", "async": "^2.6.2", "axios": ">=0.26.0", @@ -245,7 +246,6 @@ "@types/jest": "^27.0.2", "@types/lodash": "^4.14.172", "@types/mocha": "^7.0.2", - "@types/nightwatch": "1.3.4", "@types/node": "~8.9.4", "@types/react": "^17.0.24", "@types/react-beautiful-dnd": "^13.1.2", @@ -307,7 +307,7 @@ "mkdirp": "^0.5.1", "mocha": "^8.0.1", "nanohtml": "^1.6.3", - "nightwatch": "^1.7.11", + "nightwatch": "^2.2.2", "nodemon": "^2.0.4", "notify-error": "^1.2.0", "npm-link-local": "^1.1.0", From e07e6e72ddd330d311edd8b75c1c59beafdb9d6c Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 18 Jul 2022 10:22:27 +0200 Subject: [PATCH 077/179] remove tests --- .../src/tests/editorAutoComplete.test.ts | 518 ------------------ .../src/tests/editorHoverContext.test.ts | 236 -------- .../src/tests/editorReferences.test.ts | 196 ------- 3 files changed, 950 deletions(-) delete mode 100644 apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts delete mode 100644 apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts delete mode 100644 apps/remix-ide-e2e/src/tests/editorReferences.test.ts diff --git a/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts b/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts deleted file mode 100644 index 8dc7bd4440..0000000000 --- a/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts +++ /dev/null @@ -1,518 +0,0 @@ -'use strict' -import { NightwatchBrowser } from 'nightwatch' -import init from '../helpers/init' -import examples from '../examples/editor-test-contracts' - -const autoCompleteLineElement = (name: string) => { - return `//*[@class='editor-widget suggest-widget visible']//*[@class='contents' and contains(.,'${name}')]` -} - -module.exports = { - '@disabled': true, - before: function (browser: NightwatchBrowser, done: VoidFunction) { - init(browser, done, 'http://127.0.0.1:8080', false) - }, - 'Should add test and base files #group2': function (browser: NightwatchBrowser) { - browser.addFile(examples.testContract.name, examples.testContract) - .addFile(examples.baseContract.name, examples.baseContract) - .addFile(examples.import1Contract.name, examples.import1Contract) - .addFile(examples.baseOfBaseContract.name, examples.baseOfBaseContract) - .addFile(examples.secondimport.name, examples.secondimport) - .addFile(examples.importbase.name, examples.importbase) - .openFile(examples.testContract.name) - }, - 'Should put cursor in the () of the function #group2': function (browser: NightwatchBrowser) { - browser.scrollToLine(36) - const path = "//*[@class='view-line' and contains(.,'myprivatefunction') and contains(.,'private')]//span//span[contains(.,'(')]" - browser.waitForElementVisible('#editorView') - .useXpath() - .click(path).pause(1000) - }, - 'Should complete variable declaration types in a function definition #group2': function (browser: NightwatchBrowser) { - browser - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('uint25') - }) - .waitForElementPresent(autoCompleteLineElement('uint256')) - .click(autoCompleteLineElement('uint256')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' abc') - .sendKeys(this.Keys.ENTER) // we need to split lines for FF texts to pass because the screen is too narrow - .sendKeys(', testb') - }) - .waitForElementPresent(autoCompleteLineElement('"TestBookDefinition"')) - .click(autoCompleteLineElement('"TestBookDefinition"')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' memo') - }) - .waitForElementPresent(autoCompleteLineElement('memory')) - .click(autoCompleteLineElement('memory')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' btextbook') - .sendKeys(this.Keys.ENTER) - .sendKeys(', BaseB') - }) - .waitForElementPresent(autoCompleteLineElement('"BaseBook"')) - .click(autoCompleteLineElement('"BaseBook"')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' stor') - }) - .waitForElementPresent(autoCompleteLineElement('storage')) - .click(autoCompleteLineElement('storage')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' localbbook') - }).pause(3000) - }, - 'Should put cursor at the end of function #group2': function (browser: NightwatchBrowser) { - - const path = "//*[@class='view-line' and contains(.,'localbbook') and contains(.,'private')]//span//span[contains(.,'{')]" - browser - .useXpath() - .click(path).pause(1000) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - // right arrow key - sendKeys(this.Keys.ARROW_RIGHT). - sendKeys(this.Keys.ARROW_RIGHT) - }) - }, - 'Should autcomplete address types': function (browser: NightwatchBrowser) { - browser - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('addre') - }) - .waitForElementPresent(autoCompleteLineElement('address')) - .click(autoCompleteLineElement('address')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' someaddress;') - .sendKeys(this.Keys.ENTER) - }).pause(2000) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('someaddress.') - }) - .waitForElementVisible(autoCompleteLineElement('balance')) - .waitForElementVisible(autoCompleteLineElement('send')) - .waitForElementVisible(autoCompleteLineElement('transfer')) - .waitForElementVisible(autoCompleteLineElement('code')) - .click(autoCompleteLineElement('balance')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys(this.Keys.ENTER) - }) - }, - 'Should autcomplete array types': function (browser: NightwatchBrowser) { - browser - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('uin') - }) - .waitForElementPresent(autoCompleteLineElement('uint')) - .click(autoCompleteLineElement('uint')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('[] mem') - }) - .waitForElementVisible(autoCompleteLineElement('memory')) - .click(autoCompleteLineElement('memory')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' somearray;') - } - ).pause(2000) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys(this.Keys.ENTER) - .sendKeys('somearray.') - }) - .waitForElementVisible(autoCompleteLineElement('push')) - .waitForElementVisible(autoCompleteLineElement('pop')) - .waitForElementVisible(autoCompleteLineElement('length')) - .click(autoCompleteLineElement('length')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys(this.Keys.ENTER) - }) - }, - 'Should see and autocomplete second import because it was imported by the first import #group2': function (browser: NightwatchBrowser) { - browser - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('secondi') - }) - .waitForElementPresent(autoCompleteLineElement('secondimport')) - .click(autoCompleteLineElement('secondimport')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(' sec;') - .sendKeys(this.Keys.ENTER) - }).pause(3000) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('sec.') - }) - .waitForElementVisible(autoCompleteLineElement('secondimportstring')) - .click(autoCompleteLineElement('secondimportstring')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - }) - - }, - 'Should see and autocomplete imported local class #group2': function (browser: NightwatchBrowser) { - browser - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('import') - }) - .waitForElementPresent(autoCompleteLineElement('importedcontract')) - .click(autoCompleteLineElement('importedcontract')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('.') - }) - .waitForElementVisible(autoCompleteLineElement('externalimport')) - .waitForElementVisible(autoCompleteLineElement('importbasestring')) - .waitForElementVisible(autoCompleteLineElement('importedbook')) - .waitForElementVisible(autoCompleteLineElement('importpublicstring')) - .waitForElementVisible(autoCompleteLineElement('publicimport')) - // no private - .waitForElementNotPresent(autoCompleteLineElement('importprivatestring')) - .waitForElementNotPresent(autoCompleteLineElement('privateimport')) - // no internal - .waitForElementNotPresent(autoCompleteLineElement('importinternalstring')) - .waitForElementNotPresent(autoCompleteLineElement('internalimport')) - .click(autoCompleteLineElement('importbasestring')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - }) - - }, - 'Should autocomplete derived and local event when not using this. #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('emit base') - }) - .waitForElementVisible(autoCompleteLineElement('BaseEvent')) - .click(autoCompleteLineElement('BaseEvent')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys('msg.sender') - .sendKeys(this.Keys.TAB) - .sendKeys(this.Keys.TAB) // somehow this is needed to get the cursor to the next parameter, only for selenium - .sendKeys('3232') - .sendKeys(this.Keys.TAB) - .sendKeys(this.Keys.ENTER) - }) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('emit MyEv') - }) - .waitForElementVisible(autoCompleteLineElement('MyEvent')) - .click(autoCompleteLineElement('MyEvent')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys('3232') - .sendKeys(this.Keys.TAB) - .sendKeys(this.Keys.ENTER) - }) - }, - - 'Should type and get msg options #group2': function (browser: NightwatchBrowser) { - browser. - perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER). - sendKeys('msg.') - }) - .waitForElementVisible(autoCompleteLineElement('sender')) - .waitForElementVisible(autoCompleteLineElement('data')) - .waitForElementVisible(autoCompleteLineElement('value')) - .waitForElementVisible(autoCompleteLineElement('gas')) - .waitForElementVisible(autoCompleteLineElement('sig')) - .click(autoCompleteLineElement('sender')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('.') - }) - .waitForElementVisible(autoCompleteLineElement('balance')) - .waitForElementVisible(autoCompleteLineElement('code')) - .waitForElementVisible(autoCompleteLineElement('codehash')) - .waitForElementVisible(autoCompleteLineElement('send')) - .waitForElementVisible(autoCompleteLineElement('transfer')) - .click(autoCompleteLineElement('balance')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER) - }) - }, - 'Should bo and get book #group2': function (browser: NightwatchBrowser) { - browser. - perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER). - sendKeys('bo') - }) - .waitForElementVisible(autoCompleteLineElement('book')) - .click(autoCompleteLineElement('book')) - }, - 'Should autcomplete derived struct #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('.') - }) - .waitForElementVisible(autoCompleteLineElement('author')) - .waitForElementVisible(autoCompleteLineElement('book_id')) - .waitForElementVisible(autoCompleteLineElement('title')) - .click(autoCompleteLineElement('title')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - }) - }, - 'Should bo and get basebook #group2': function (browser: NightwatchBrowser) { - browser. - perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER). - sendKeys('base') - }) - .waitForElementVisible(autoCompleteLineElement('basebook')) - .click(autoCompleteLineElement('basebook')) - }, - 'Should autcomplete derived struct from base class #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('.') - }) - .waitForElementVisible(autoCompleteLineElement('author')) - .waitForElementVisible(autoCompleteLineElement('book_id')) - .waitForElementVisible(autoCompleteLineElement('title')) - .click(autoCompleteLineElement('title')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - }) - }, - 'Should block scoped localbbook #group2': function (browser: NightwatchBrowser) { - browser.pause(4000). - perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER). - sendKeys('localb') - }) - .waitForElementVisible(autoCompleteLineElement('localbbook')) - .click(autoCompleteLineElement('localbbook')) - }, - 'Should autcomplete derived struct from block localbbook #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('.') - }) - .waitForElementVisible(autoCompleteLineElement('author')) - .waitForElementVisible(autoCompleteLineElement('book_id')) - .waitForElementVisible(autoCompleteLineElement('title')) - .click(autoCompleteLineElement('title')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - }) - }, - 'Should block scoped btextbook #group2': function (browser: NightwatchBrowser) { - browser. - perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER). - sendKeys('btext') - }) - .waitForElementVisible(autoCompleteLineElement('btextbook')) - .click(autoCompleteLineElement('btextbook')) - }, - 'Should autcomplete derived struct from block btextbook #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('.') - }) - .waitForElementVisible(autoCompleteLineElement('author')) - .waitForElementVisible(autoCompleteLineElement('book_id')) - .waitForElementVisible(autoCompleteLineElement('title')) - .click(autoCompleteLineElement('title')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - }) - }, - 'Should find private and internal local functions #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('my') - }) - .waitForElementVisible(autoCompleteLineElement('myprivatefunction')) - .waitForElementVisible(autoCompleteLineElement('myinternalfunction')) - .waitForElementVisible(autoCompleteLineElement('memory')) - .click(autoCompleteLineElement('myinternalfunction')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER) - }) - }, - 'Should find internal functions and var from base and owner #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('intern') - }) - .waitForElementVisible(autoCompleteLineElement('internalbasefunction')) - .waitForElementVisible(autoCompleteLineElement('internalstring')) - .waitForElementVisible(autoCompleteLineElement('internalbasestring')) - // keyword internal - .waitForElementVisible(autoCompleteLineElement('internal keyword')) - .click(autoCompleteLineElement('internalbasefunction')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys(this.Keys.ENTER) - }) - }, - - 'Should not find external functions without this. #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('extern') - }) - .waitForElementNotPresent(autoCompleteLineElement('externalbasefunction')) - .waitForElementNotPresent(autoCompleteLineElement('myexternalfunction')) - // keyword internal - .waitForElementVisible(autoCompleteLineElement('external keyword')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys(this.Keys.BACK_SPACE) - .sendKeys(this.Keys.BACK_SPACE) - .sendKeys(this.Keys.BACK_SPACE) - .sendKeys(this.Keys.BACK_SPACE) - .sendKeys(this.Keys.BACK_SPACE) - .sendKeys(this.Keys.BACK_SPACE) - .sendKeys(this.Keys.BACK_SPACE) - }) - }, - 'Should find external functions using this. #group2': function (browser: NightwatchBrowser) { - browser. - perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(this.Keys.ENTER). - sendKeys('this.') - }) - .waitForElementVisible(autoCompleteLineElement('externalbasefunction')) - .waitForElementVisible(autoCompleteLineElement('myexternalfunction')) - }, - 'Should find public functions and vars using this. but not private & other types of nodes #group2': function (browser: NightwatchBrowser) { - browser - .waitForElementVisible(autoCompleteLineElement('"publicbasefunction"')) - .waitForElementVisible(autoCompleteLineElement('"publicstring"')) - .waitForElementVisible(autoCompleteLineElement('"basebook"')) - .waitForElementVisible(autoCompleteLineElement('"mybook"')) - .waitForElementVisible(autoCompleteLineElement('"testing"')) - // but no private functions or vars or other types of nodes - .waitForElementNotPresent(autoCompleteLineElement('"private"')) - .waitForElementNotPresent(autoCompleteLineElement('"BaseEvent"')) - .waitForElementNotPresent(autoCompleteLineElement('"BaseEnum"')) - .waitForElementNotPresent(autoCompleteLineElement('"TestBookDefinition"')) - .click(autoCompleteLineElement('"publicbasefunction"')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions - .sendKeys(this.Keys.ENTER) - }) - }, - 'Should autocomplete local and derived ENUMS #group2': function (browser: NightwatchBrowser) { - browser.perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys('BaseEnum.') - }) - .waitForElementVisible(autoCompleteLineElement('SMALL')) - .waitForElementVisible(autoCompleteLineElement('MEDIUM')) - .waitForElementVisible(autoCompleteLineElement('LARGE')) - .click(autoCompleteLineElement('SMALL')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - .sendKeys('MyEnum.') - }) - .waitForElementVisible(autoCompleteLineElement('SMALL')) - .waitForElementVisible(autoCompleteLineElement('MEDIUM')) - .waitForElementVisible(autoCompleteLineElement('LARGE')) - .click(autoCompleteLineElement('SMALL')) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - sendKeys(';') - .sendKeys(this.Keys.ENTER) - }) - } -} - diff --git a/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts b/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts deleted file mode 100644 index db86224b11..0000000000 --- a/apps/remix-ide-e2e/src/tests/editorHoverContext.test.ts +++ /dev/null @@ -1,236 +0,0 @@ -'use strict' -import { NightwatchBrowser } from 'nightwatch' -import init from '../helpers/init' - -const checkEditorHoverContent = (browser: NightwatchBrowser, path: string, expectedContent: string, offsetLeft: number = 0) => { - browser.useXpath() - .useXpath() - .moveToElement('//body', 0, 0) // always move away from the hover before the next test in case we hover in the same line on a different element - .waitForElementVisible(path) - .moveToElement(path, offsetLeft, 0) - .useCss() - .waitForElementContainsText('.monaco-hover-content', expectedContent).pause(1000) -} - -module.exports = { - '@disabled': true, - before: function (browser: NightwatchBrowser, done: VoidFunction) { - init(browser, done, 'http://127.0.0.1:8080', false) - }, - - 'Should load the test file': function (browser: NightwatchBrowser) { - browser.openFile('contracts') - .openFile('contracts/3_Ballot.sol') - .waitForElementVisible('#editorView') - .setEditorValue(BallotWithARefToOwner) - .pause(4000) // wait for the compiler to finish - .scrollToLine(37) - }, - 'Should show hover over contract in editor #group1': function (browser: NightwatchBrowser) { - const path = "//*[contains(text(),'BallotHoverTest')]" - checkEditorHoverContent(browser, path, 'contract BallotHoverTest is BallotHoverTest') - checkEditorHoverContent(browser, path, 'contracts/3_Ballot.sol 10:0') - checkEditorHoverContent(browser, path, '@title Ballot') - }, - 'Should show hover over var definition in editor #group1': function (browser: NightwatchBrowser) { - const path = "//*[@class='view-line' and contains(.,'chairperson') and contains(.,'address') and contains(.,'public')]//span//span[contains(.,'chairperson')]" - const expectedContent = 'address public chairperson' - checkEditorHoverContent(browser, path, expectedContent) - }, - 'Should show hover over constructor in editor #group1': function (browser: NightwatchBrowser) { - const path: string = "//*[@class='view-line' and contains(.,'constructor') and contains(.,'bytes32') and contains(.,'memory')]//span//span[contains(.,'constructor')]" - const expectedContent = 'Estimated creation cost: infinite gas Estimated code deposit cost:' - checkEditorHoverContent(browser, path, expectedContent) - }, - 'Should show hover over function in editor #group1': function (browser: NightwatchBrowser) { - browser.scrollToLine(58) - const path: string = "//*[@class='view-line' and contains(.,'giveRightToVote(address') and contains(.,'function') and contains(.,'public')]//span//span[contains(.,'giveRightToVote')]" - let expectedContent = 'Estimated execution cost' - checkEditorHoverContent(browser, path, expectedContent) - expectedContent = 'function giveRightToVote (address internal voter) public nonpayable returns ()' - checkEditorHoverContent(browser, path, expectedContent) - expectedContent = "@dev Give 'voter' the right to vote on this ballot. May only be called by 'chairperson'" - checkEditorHoverContent(browser, path, expectedContent) - }, - 'Should show hover over var components in editor #group1': function (browser: NightwatchBrowser) { - browser.scrollToLine(37) - let path = "//*[@class='view-line' and contains(.,'voters') and contains(.,'weight')]//span//span[contains(.,'voters')]" - let expectedContent = 'mapping(address => struct BallotHoverTest.Voter) public voters' - checkEditorHoverContent(browser, path, expectedContent, 15) - path = "//*[@class='view-line' and contains(.,'voters') and contains(.,'weight')]//span//span[contains(.,'chairperson')]" - expectedContent = 'address public chairperson' - checkEditorHoverContent(browser, path, expectedContent, 3) - path = "//*[@class='view-line' and contains(.,'voters') and contains(.,'weight')]//span//span[contains(.,'weight')]" - expectedContent = 'uint256 internal weight' - checkEditorHoverContent(browser, path, expectedContent) - }, - 'Should show hover over new contract creation in editor #group1': function (browser: NightwatchBrowser) { - let path = "//*[@class='view-line' and contains(.,'Owner') and contains(.,'new')]//span//span[contains(.,'cowner')]" - let expectedContent = 'contract Owner internal cowner' - checkEditorHoverContent(browser, path, expectedContent, 10) - path = "//*[@class='view-line' and contains(.,'Owner') and contains(.,'new')]//span//span[contains(.,'Owner')]" - expectedContent = 'contract Owner is Owner' - checkEditorHoverContent(browser, path, expectedContent, 10) - }, - 'Should show hover over external class member in editor #group1': function (browser: NightwatchBrowser) { - const path = "//*[@class='view-line' and contains(.,'getOwner') and contains(.,'cowner')]//span//span[contains(.,'getOwner')]" - let expectedContent = 'function getOwner () external view returns (address internal )' - checkEditorHoverContent(browser, path, expectedContent, 0) - expectedContent = 'contracts/2_Owner.sol' - checkEditorHoverContent(browser, path, expectedContent, 0) - expectedContent = '@dev Return owner address' - checkEditorHoverContent(browser, path, expectedContent, 0) - }, - 'Should show hover over struct definition in editor #group1': function (browser: NightwatchBrowser) { - browser.scrollToLine(5) - const path = "//*[@class='view-line' and contains(.,'Voter') and contains(.,'struct')]//span//span[contains(.,'Voter')]" - const expectedContent = 'StructDefinition' - checkEditorHoverContent(browser, path, expectedContent) - } -} - - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -const BallotWithARefToOwner = `// SPDX-License-Identifier: GPL-3.0 - -pragma solidity >=0.7.0 <0.9.0; - -import "./2_Owner.sol"; - -/** - * @title Ballot - * @dev Implements voting process along with vote delegation - */ -contract BallotHoverTest { - Owner cowner; - struct Voter { - uint weight; // weight is accumulated by delegation - bool voted; // if true, that person already voted - address delegate; // person delegated to - uint vote; // index of the voted proposal - } - - struct Proposal { - // If you can limit the length to a certain number of bytes, - // always use one of bytes1 to bytes32 because they are much cheaper - bytes32 name; // short name (up to 32 bytes) - uint voteCount; // number of accumulated votes - } - - address public chairperson; - - mapping(address => Voter) public voters; - - Proposal[] public proposals; - - /** - * @dev Create a new ballot to choose one of 'proposalNames'. - * @param proposalNames names of proposals - */ - constructor(bytes32[] memory proposalNames) { - cowner = new Owner(); - cowner.getOwner(); - chairperson = msg.sender; - voters[chairperson].weight = 1; - - for (uint i = 0; i < proposalNames.length; i++) { - // 'Proposal({...})' creates a temporary - // Proposal object and 'proposals.push(...)' - // appends it to the end of 'proposals'. - proposals.push(Proposal({ - name: proposalNames[i], - voteCount: 0 - })); - } - } - - /** - * @dev Give 'voter' the right to vote on this ballot. May only be called by 'chairperson'. - * @param voter address of voter - */ - function giveRightToVote(address voter) public { - require( - msg.sender == chairperson, - "Only chairperson can give right to vote." - ); - require( - !voters[voter].voted, - "The voter already voted." - ); - require(voters[voter].weight == 0); - voters[voter].weight = 1; - } - - /** - * @dev Delegate your vote to the voter 'to'. - * @param to address to which vote is delegated - */ - function delegate(address to) public { - Voter storage sender = voters[msg.sender]; - require(!sender.voted, "You already voted."); - require(to != msg.sender, "Self-delegation is disallowed."); - - while (voters[to].delegate != address(0)) { - to = voters[to].delegate; - - // We found a loop in the delegation, not allowed. - require(to != msg.sender, "Found loop in delegation."); - } - sender.voted = true; - sender.delegate = to; - Voter storage delegate_ = voters[to]; - if (delegate_.voted) { - // If the delegate already voted, - // directly add to the number of votes - proposals[delegate_.vote].voteCount += sender.weight; - } else { - // If the delegate did not vote yet, - // add to her weight. - delegate_.weight += sender.weight; - } - } - - /** - * @dev Give your vote (including votes delegated to you) to proposal 'proposals[proposal].name'. - * @param proposal index of proposal in the proposals array - */ - function vote(uint proposal) public { - Voter storage sender = voters[msg.sender]; - require(sender.weight != 0, "Has no right to vote"); - require(!sender.voted, "Already voted."); - sender.voted = true; - sender.vote = proposal; - - // If 'proposal' is out of the range of the array, - // this will throw automatically and revert all - // changes. - proposals[proposal].voteCount += sender.weight; - } - - /** - * @dev Computes the winning proposal taking all previous votes into account. - * @return winningProposal_ index of winning proposal in the proposals array - */ - function winningProposal() public view - returns (uint winningProposal_) - { - uint winningVoteCount = 0; - for (uint p = 0; p < proposals.length; p++) { - if (proposals[p].voteCount > winningVoteCount) { - winningVoteCount = proposals[p].voteCount; - winningProposal_ = p; - } - } - } - - /** - * @dev Calls winningProposal() function to get the index of the winner contained in the proposals array and then - * @return winnerName_ the name of the winner - */ - function winnerName() public view - returns (bytes32 winnerName_) - { - winnerName_ = proposals[winningProposal()].name; - } -} -` \ No newline at end of file diff --git a/apps/remix-ide-e2e/src/tests/editorReferences.test.ts b/apps/remix-ide-e2e/src/tests/editorReferences.test.ts deleted file mode 100644 index 86856a9822..0000000000 --- a/apps/remix-ide-e2e/src/tests/editorReferences.test.ts +++ /dev/null @@ -1,196 +0,0 @@ -'use strict' -import { NightwatchBrowser } from 'nightwatch' -import init from '../helpers/init' - -const openReferences = (browser: NightwatchBrowser, path: string) => { - (browser as any).useXpath() - .useXpath() - .waitForElementVisible(path) - .click(path) - .perform(function () { - const actions = this.actions({ async: true }); - return actions. - keyDown(this.Keys.SHIFT). - sendKeys(this.Keys.F12) - }) -} - -module.exports = { - before: function (browser: NightwatchBrowser, done: VoidFunction) { - init(browser, done, 'http://127.0.0.1:8080', false) - }, - - 'Should load the test file': function (browser: NightwatchBrowser) { - browser.openFile('contracts') - .openFile('contracts/3_Ballot.sol') - .waitForElementVisible('#editorView') - .setEditorValue(BallotWithARefToOwner) - .pause(10000) // wait for the compiler to finish - .scrollToLine(37) - }, - 'Should show local references': function (browser: NightwatchBrowser) { - browser.scrollToLine(48) - const path = "//*[@class='view-line' and contains(.,'length') and contains(.,'proposalNames')]//span//span[contains(.,'proposalNames')]" - openReferences(browser, path) - browser.waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch']//span[contains(.,'length; i++')]") - .waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch']//span[contains(.,'name:')]") - .waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch']//span[contains(.,'constructor')]") - .keys(browser.Keys.ESCAPE) - }, - 'Should show references of getOwner': function (browser: NightwatchBrowser) { - browser.scrollToLine(39) - const path = "//*[@class='view-line' and contains(.,'getOwner') and contains(.,'cowner')]//span//span[contains(.,'getOwner')]" - openReferences(browser, path) - browser.useXpath() - .waitForElementVisible("//*[@class='monaco-highlighted-label']//span[contains(.,'2_Owner.sol')]") - .waitForElementVisible("//*[@class='monaco-highlighted-label']//span[contains(.,'3_Ballot.sol')]") - .waitForElementVisible("//*[@class='monaco-highlighted-label referenceMatch']//span[contains(.,'cowner.getOwner')]") - .waitForElementVisible("//*[contains(@class, 'results-loaded') and contains(., 'References (2)')]") - .keys(browser.Keys.ESCAPE) - } -} - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -const BallotWithARefToOwner = `// SPDX-License-Identifier: GPL-3.0 - -pragma solidity >=0.7.0 <0.9.0; - -import "./2_Owner.sol"; - -/** - * @title Ballot - * @dev Implements voting process along with vote delegation - */ -contract BallotHoverTest { - Owner cowner; - struct Voter { - uint weight; // weight is accumulated by delegation - bool voted; // if true, that person already voted - address delegate; // person delegated to - uint vote; // index of the voted proposal - } - - struct Proposal { - // If you can limit the length to a certain number of bytes, - // always use one of bytes1 to bytes32 because they are much cheaper - bytes32 name; // short name (up to 32 bytes) - uint voteCount; // number of accumulated votes - } - - address public chairperson; - - mapping(address => Voter) public voters; - - Proposal[] public proposals; - - /** - * @dev Create a new ballot to choose one of 'proposalNames'. - * @param proposalNames names of proposals - */ - constructor(bytes32[] memory proposalNames) { - cowner = new Owner(); - cowner.getOwner(); - chairperson = msg.sender; - voters[chairperson].weight = 1; - - for (uint i = 0; i < proposalNames.length; i++) { - // 'Proposal({...})' creates a temporary - // Proposal object and 'proposals.push(...)' - // appends it to the end of 'proposals'. - proposals.push(Proposal({ - name: proposalNames[i], - voteCount: 0 - })); - } - } - - /** - * @dev Give 'voter' the right to vote on this ballot. May only be called by 'chairperson'. - * @param voter address of voter - */ - function giveRightToVote(address voter) public { - require( - msg.sender == chairperson, - "Only chairperson can give right to vote." - ); - require( - !voters[voter].voted, - "The voter already voted." - ); - require(voters[voter].weight == 0); - voters[voter].weight = 1; - } - - /** - * @dev Delegate your vote to the voter 'to'. - * @param to address to which vote is delegated - */ - function delegate(address to) public { - Voter storage sender = voters[msg.sender]; - require(!sender.voted, "You already voted."); - require(to != msg.sender, "Self-delegation is disallowed."); - - while (voters[to].delegate != address(0)) { - to = voters[to].delegate; - - // We found a loop in the delegation, not allowed. - require(to != msg.sender, "Found loop in delegation."); - } - sender.voted = true; - sender.delegate = to; - Voter storage delegate_ = voters[to]; - if (delegate_.voted) { - // If the delegate already voted, - // directly add to the number of votes - proposals[delegate_.vote].voteCount += sender.weight; - } else { - // If the delegate did not vote yet, - // add to her weight. - delegate_.weight += sender.weight; - } - } - - /** - * @dev Give your vote (including votes delegated to you) to proposal 'proposals[proposal].name'. - * @param proposal index of proposal in the proposals array - */ - function vote(uint proposal) public { - Voter storage sender = voters[msg.sender]; - require(sender.weight != 0, "Has no right to vote"); - require(!sender.voted, "Already voted."); - sender.voted = true; - sender.vote = proposal; - - // If 'proposal' is out of the range of the array, - // this will throw automatically and revert all - // changes. - proposals[proposal].voteCount += sender.weight; - } - - /** - * @dev Computes the winning proposal taking all previous votes into account. - * @return winningProposal_ index of winning proposal in the proposals array - */ - function winningProposal() public view - returns (uint winningProposal_) - { - uint winningVoteCount = 0; - for (uint p = 0; p < proposals.length; p++) { - if (proposals[p].voteCount > winningVoteCount) { - winningVoteCount = proposals[p].voteCount; - winningProposal_ = p; - } - } - } - - /** - * @dev Calls winningProposal() function to get the index of the winner contained in the proposals array and then - * @return winnerName_ the name of the winner - */ - function winnerName() public view - returns (bytes32 winnerName_) - { - winnerName_ = proposals[winningProposal()].name; - } -} -` \ No newline at end of file From 4e7360267247a4577590a5e372e34ba5f026d126 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 18 Jul 2022 10:23:37 +0200 Subject: [PATCH 078/179] remove editor test files --- .../src/examples/editor-test-contracts.ts | 173 ------------------ 1 file changed, 173 deletions(-) delete mode 100644 apps/remix-ide-e2e/src/examples/editor-test-contracts.ts diff --git a/apps/remix-ide-e2e/src/examples/editor-test-contracts.ts b/apps/remix-ide-e2e/src/examples/editor-test-contracts.ts deleted file mode 100644 index 86992350e4..0000000000 --- a/apps/remix-ide-e2e/src/examples/editor-test-contracts.ts +++ /dev/null @@ -1,173 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/no-unused-vars -const testContract = { - name: 'contracts/test.sol', - content: ` - // SPDX-License-Identifier: GPL-3.0 - pragma solidity >=0.7.0 <0.9.0; - - import "contracts/base.sol"; - import "contracts/import1.sol"; - - contract test is base { - string public publicstring; - string private privatestring; - string internal internalstring; - - struct TestBookDefinition { - string title; - string author; - uint book_id; - } - TestBookDefinition public mybook; - enum MyEnum{ SMALL, MEDIUM, LARGE } - event MyEvent(uint abc); - importcontract importedcontract; - - modifier costs(uint price) { - if (msg.value >= price) { - _; - } - } - constructor(){ - - } - - function testing() public view { - - } - - function myprivatefunction() private { - - } - - function myinternalfunction() internal { - - } - - function myexternalfunction() external { - - } - }`} - - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -const baseContract = { - name: 'contracts/base.sol', - content: ` - // SPDX-License-Identifier: GPL-3.0 - pragma solidity >=0.7.0 <0.9.0; - - import "contracts/baseofbase.sol"; - - contract base is baseofbase { - event BaseEvent(address indexed _from, uint _value); - enum BaseEnum{ SMALL, MEDIUM, LARGE } - struct Book { - string title; - string author; - uint book_id; - } - Book public book; - }`} - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -const baseOfBaseContract = { - name: 'contracts/baseofbase.sol', - content: ` - // SPDX-License-Identifier: GPL-3.0 - pragma solidity >=0.7.0 <0.9.0; - - contract baseofbase { - - struct BaseBook { - string title; - string author; - uint book_id; - } - BaseBook public basebook; - - string private basestring; - string internal internalbasestring; - - function privatebase() private { - - } - - function internalbasefunction() internal { - - } - - function publicbasefunction() public { - - } - function externalbasefunction() external { - } - }`} - -const import1Contract = { - name: 'contracts/import1.sol', - content: ` - // SPDX-License-Identifier: MIT - pragma solidity >=0.7.0 <0.9.0; - - import "contracts/importbase.sol"; - import "contracts/secondimport.sol"; - -contract importcontract is importbase { - struct ImportedBook { - string title; - string author; - uint book_id; - } - ImportedBook public importedbook; - - string private importprivatestring; - string internal internalimportstring; - string public importpublicstring; - - function privateimport() private { - - } - - function internalimport() internal { - - } - - function publicimport() public { - - } - - function externalimport() external { - } -}`} - -const importbase = { - name: 'contracts/importbase.sol', - content: ` - // SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -contract importbase { - string public importbasestring; -} -`} - -const secondimport = { - name: 'contracts/secondimport.sol', - content: ` - // SPDX-License-Identifier: MIT -pragma solidity >=0.7.0 <0.9.0; - -contract secondimport { - string public secondimportstring; -} -`} - -export default { - testContract, - baseContract, - baseOfBaseContract, - import1Contract, - importbase, - secondimport -} \ No newline at end of file From 06f156cccd0b8e1bd4ccf0581f0e58f8a9f28097 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 18 Jul 2022 10:26:06 +0200 Subject: [PATCH 079/179] restore editor tests --- apps/remix-ide-e2e/src/tests/editor.test.ts | 257 ++++++++++++++++++++ 1 file changed, 257 insertions(+) diff --git a/apps/remix-ide-e2e/src/tests/editor.test.ts b/apps/remix-ide-e2e/src/tests/editor.test.ts index 771b59b93a..08dc8680ff 100644 --- a/apps/remix-ide-e2e/src/tests/editor.test.ts +++ b/apps/remix-ide-e2e/src/tests/editor.test.ts @@ -128,6 +128,119 @@ module.exports = { .waitForElementNotPresent('.highlightLine51', 60000) }, + 'Should display the context view #group2': function (browser: NightwatchBrowser) { + browser + .openFile('contracts') + .openFile('contracts/1_Storage.sol') + .waitForElementVisible('#editorView') + .setEditorValue(storageContractWithError) + .pause(2000) + .execute(() => { + (document.getElementById('editorView') as any).gotoLine(17, 16) + }, [], () => {}) + .waitForElementVisible('.contextview') + .waitForElementContainsText('.contextview .type', 'FunctionDefinition') + .waitForElementContainsText('.contextview .name', 'store') + .execute(() => { + (document.getElementById('editorView') as any).gotoLine(18, 12) + }, [], () => {}) + .waitForElementContainsText('.contextview .type', 'uint256') + .waitForElementContainsText('.contextview .name', 'number') + .click('.contextview [data-action="previous"]') // declaration + .pause(1000) + .execute(() => { + return (document.getElementById('editorView') as any).getCursorPosition() + }, [], (result) => { + console.log('result', result) + browser.assert.equal(result.value, '180') + }) + .click('.contextview [data-action="next"]') // back to the initial state + .pause(1000) + .execute(() => { + return (document.getElementById('editorView') as any).getCursorPosition() + }, [], (result) => { + console.log('result', result) + browser.assert.equal(result.value, '323') + }) + .click('.contextview [data-action="next"]') // next reference + .pause(1000) + .execute(() => { + return (document.getElementById('editorView') as any).getCursorPosition() + }, [], (result) => { + console.log('result', result) + browser.assert.equal(result.value, '489') + }) + .click('.contextview [data-action="gotoref"]') // back to the declaration + .pause(1000) + .execute(() => { + return (document.getElementById('editorView') as any).getCursorPosition() + }, [], (result) => { + console.log('result', result) + browser.assert.equal(result.value, '180') + }) + }, + + 'Should display the context view, loop over "Owner" by switching file #group2': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('solidity') + .click('[for="autoCompile"]') // disable auto compile + .openFile('contracts') + .openFile('contracts/3_Ballot.sol') + .waitForElementVisible('#editorView') + .setEditorValue(BallotWithARefToOwner) + .clickLaunchIcon('solidity') + .click('*[data-id="compilerContainerCompileBtn"]') // compile + .pause(6000) + .execute(() => { + (document.getElementById('editorView') as any).gotoLine(14, 6) + }, [], () => {}) + .waitForElementVisible('.contextview') + .waitForElementContainsText('.contextview .type', 'ContractDefinition') + .waitForElementContainsText('.contextview .name', 'Owner') + .click('.contextview [data-action="next"]') + .pause(1000) + .execute(() => { + return (document.getElementById('editorView') as any).getCursorPosition() + }, [], (result) => { + console.log('result', result) + browser.assert.equal(result.value, '1061') + }) + .click('.contextview [data-action="next"]') + .pause(1000) + .execute(() => { + return (document.getElementById('editorView') as any).getCursorPosition() + }, [], (result) => { + console.log('result', result) + browser.assert.equal(result.value, '153') + }) + .currentSelectedFileIs('2_Owner.sol') // make sure the current file has been properly changed + .click('.contextview [data-action="next"]') + .pause(1000) + .execute(() => { + return (document.getElementById('editorView') as any).getCursorPosition() + }, [], (result) => { + console.log('result', result) + browser.assert.equal(result.value, '211') + }) + .click('.contextview [data-action="next"]') + .currentSelectedFileIs('3_Ballot.sol') + .pause(1000) + .execute(() => { + return (document.getElementById('editorView') as any).getCursorPosition() + }, [], (result) => { + console.log('result', result) + browser.assert.equal(result.value, '1061') + }) + .click('.contextview [data-action="gotoref"]') // go to the declaration + .pause(1000) + .execute(() => { + return (document.getElementById('editorView') as any).getCursorPosition() + }, [], (result) => { + console.log('result', result) + browser.assert.equal(result.value, '153') + }) + .end() + } } const aceThemes = { @@ -234,4 +347,148 @@ contract Storage { } }` +const BallotWithARefToOwner = ` + + +// SPDX-License-Identifier: GPL-3.0 + +pragma solidity >=0.7.0 <0.9.0; + +import "./2_Owner.sol"; + +/** + * @title Ballot + * @dev Implements voting process along with vote delegation + */ +contract Ballot { + Owner c; + struct Voter { + uint weight; // weight is accumulated by delegation + bool voted; // if true, that person already voted + address delegate; // person delegated to + uint vote; // index of the voted proposal + } + + struct Proposal { + // If you can limit the length to a certain number of bytes, + // always use one of bytes1 to bytes32 because they are much cheaper + bytes32 name; // short name (up to 32 bytes) + uint voteCount; // number of accumulated votes + } + + address public chairperson; + + mapping(address => Voter) public voters; + + Proposal[] public proposals; + + /** + * @dev Create a new ballot to choose one of 'proposalNames'. + * @param proposalNames names of proposals + */ + constructor(bytes32[] memory proposalNames) { + c = new Owner(); + chairperson = msg.sender; + voters[chairperson].weight = 1; + + for (uint i = 0; i < proposalNames.length; i++) { + // 'Proposal({...})' creates a temporary + // Proposal object and 'proposals.push(...)' + // appends it to the end of 'proposals'. + proposals.push(Proposal({ + name: proposalNames[i], + voteCount: 0 + })); + } + } + + /** + * @dev Give 'voter' the right to vote on this ballot. May only be called by 'chairperson'. + * @param voter address of voter + */ + function giveRightToVote(address voter) public { + require( + msg.sender == chairperson, + "Only chairperson can give right to vote." + ); + require( + !voters[voter].voted, + "The voter already voted." + ); + require(voters[voter].weight == 0); + voters[voter].weight = 1; + } + + /** + * @dev Delegate your vote to the voter 'to'. + * @param to address to which vote is delegated + */ + function delegate(address to) public { + Voter storage sender = voters[msg.sender]; + require(!sender.voted, "You already voted."); + require(to != msg.sender, "Self-delegation is disallowed."); + + while (voters[to].delegate != address(0)) { + to = voters[to].delegate; + // We found a loop in the delegation, not allowed. + require(to != msg.sender, "Found loop in delegation."); + } + sender.voted = true; + sender.delegate = to; + Voter storage delegate_ = voters[to]; + if (delegate_.voted) { + // If the delegate already voted, + // directly add to the number of votes + proposals[delegate_.vote].voteCount += sender.weight; + } else { + // If the delegate did not vote yet, + // add to her weight. + delegate_.weight += sender.weight; + } + } + + /** + * @dev Give your vote (including votes delegated to you) to proposal 'proposals[proposal].name'. + * @param proposal index of proposal in the proposals array + */ + function vote(uint proposal) public { + Voter storage sender = voters[msg.sender]; + require(sender.weight != 0, "Has no right to vote"); + require(!sender.voted, "Already voted."); + sender.voted = true; + sender.vote = proposal; + + // If 'proposal' is out of the range of the array, + // this will throw automatically and revert all + // changes. + proposals[proposal].voteCount += sender.weight; + } + + /** + * @dev Computes the winning proposal taking all previous votes into account. + * @return winningProposal_ index of winning proposal in the proposals array + */ + function winningProposal() public view + returns (uint winningProposal_) + { + uint winningVoteCount = 0; + for (uint p = 0; p < proposals.length; p++) { + if (proposals[p].voteCount > winningVoteCount) { + winningVoteCount = proposals[p].voteCount; + winningProposal_ = p; + } + } + } + + /** + * @dev Calls winningProposal() function to get the index of the winner contained in the proposals array and then + * @return winnerName_ the name of the winner + */ + function winnerName() public view + returns (bytes32 winnerName_) + { + winnerName_ = proposals[winningProposal()].name; + } +} +` From 3704bdcc80e7c8e3071ccda3a40aa7834da58cf4 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 18 Jul 2022 10:33:50 +0200 Subject: [PATCH 080/179] rm exec script --- .../src/commands/executeScript.ts | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 apps/remix-ide-e2e/src/commands/executeScript.ts diff --git a/apps/remix-ide-e2e/src/commands/executeScript.ts b/apps/remix-ide-e2e/src/commands/executeScript.ts deleted file mode 100644 index dbb93e66db..0000000000 --- a/apps/remix-ide-e2e/src/commands/executeScript.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { NightwatchBrowser } from 'nightwatch' -import EventEmitter from 'events' - -class ExecuteScript extends EventEmitter { - command (this: NightwatchBrowser, script: string): NightwatchBrowser { - this.api - .clearEditableContent('*[data-id="terminalCliInput"]') - .click('*[data-id="terminalCli"]') - .setValue('*[data-id="terminalCliInput"]', [this.api.Keys.CONTROL, 'a', this.api.Keys.DELETE]) - .sendKeys('*[data-id="terminalCliInput"]', script) - .sendKeys('*[data-id="terminalCliInput"]', this.api.Keys.ENTER) - .sendKeys('*[data-id="terminalCliInput"]', this.api.Keys.ENTER) - .perform(() => { - this.emit('complete') - }) - return this - } -} - -module.exports = ExecuteScript From 82c259d30b53e3c7f816c1adf9fc4dcac2f27ab9 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 18 Jul 2022 10:42:06 +0200 Subject: [PATCH 081/179] rm rightclick --- apps/remix-ide-e2e/src/commands/rightClick.ts | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 apps/remix-ide-e2e/src/commands/rightClick.ts diff --git a/apps/remix-ide-e2e/src/commands/rightClick.ts b/apps/remix-ide-e2e/src/commands/rightClick.ts deleted file mode 100644 index 09fa8643b1..0000000000 --- a/apps/remix-ide-e2e/src/commands/rightClick.ts +++ /dev/null @@ -1,37 +0,0 @@ -import EventEmitter from 'events' -import { NightwatchBrowser } from 'nightwatch' - -class RightClick extends EventEmitter { - command (this: NightwatchBrowser, cssSelector: string) { - this.api.perform((done) => { - rightClick(this.api, cssSelector, () => { - done() - this.emit('complete') - }) - }) - return this - } -} - -function rightClick (browser: NightwatchBrowser, cssSelector: string, callback: VoidFunction) { - browser.execute(function (cssSelector: string) { - const element: any = document.querySelector(cssSelector) - const evt = element.ownerDocument.createEvent('MouseEvents') - const RIGHT_CLICK_BUTTON_CODE = 2 - - evt.initMouseEvent('contextmenu', true, true, - element.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, - false, false, false, RIGHT_CLICK_BUTTON_CODE, null) - if (Object.prototype.hasOwnProperty.call(document, 'createEventObject')) { - // dispatch for IE - return element.fireEvent('onclick', evt) - } else { - // dispatch for firefox + others - return !element.dispatchEvent(evt) - } - }, [cssSelector], function () { - callback() - }) -} - -module.exports = RightClick From 80494a5389f8ee0a1a76d0865a8a59ff40a1b738 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 18 Jul 2022 13:11:07 +0200 Subject: [PATCH 082/179] terminal filter doesn't work on any browser --- apps/remix-ide-e2e/src/commands/checkTerminalFilter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/commands/checkTerminalFilter.ts b/apps/remix-ide-e2e/src/commands/checkTerminalFilter.ts index ed8fa54cbd..2ebc4cd1f1 100644 --- a/apps/remix-ide-e2e/src/commands/checkTerminalFilter.ts +++ b/apps/remix-ide-e2e/src/commands/checkTerminalFilter.ts @@ -21,7 +21,7 @@ function checkFilter (browser: NightwatchBrowser, filter: string, test: string, const filterClass = '[data-id="terminalInputSearch"]' browser.setValue(filterClass, filter, function () { browser.execute(function () { - return document.querySelector('[data-id="terminalJournal"]').innerHTML === test || '' + return document.querySelector('[data-id="terminalJournal"]').innerHTML === test }, [], function (result) { browser.clearValue(filterClass).setValue(filterClass, '', function () { if (!result.value) { From 4a598d762e93ca826ab6b958234ff9ab8869f63a Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 18 Jul 2022 13:11:21 +0200 Subject: [PATCH 083/179] terminal filter test would never pass --- apps/remix-ide-e2e/src/tests/transactionExecution.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/transactionExecution.test.ts b/apps/remix-ide-e2e/src/tests/transactionExecution.test.ts index 635218881f..7df23ff1f3 100644 --- a/apps/remix-ide-e2e/src/tests/transactionExecution.test.ts +++ b/apps/remix-ide-e2e/src/tests/transactionExecution.test.ts @@ -23,8 +23,8 @@ module.exports = { status: 'true Transaction mined and execution succeed', 'decoded output': { 0: 'uint256: 8' } }) - .pause(500) - .checkTerminalFilter('0x12332162e2e31397dc1e07ed0a1cf08f728e9b4487c6f9ed79d2f39410c92782', '') + .pause(120000) + //.checkTerminalFilter('0x12332162e2e31397dc1e07ed0a1cf08f728e9b4487c6f9ed79d2f39410c92782', '') .clickFunction('g - transact (not payable)') .testFunction('last', { From 5e50fe4da687b77b70d2a684eabb9f956550759a Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 18 Jul 2022 13:32:05 +0200 Subject: [PATCH 084/179] flaky remixd --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/remixd.test.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4c24890cab..c4061c0d7c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: false + default: true orbs: browser-tools: circleci/browser-tools@1.2.3 jobs: diff --git a/apps/remix-ide-e2e/src/tests/remixd.test.ts b/apps/remix-ide-e2e/src/tests/remixd.test.ts index 6cf256e2cc..7389093e35 100644 --- a/apps/remix-ide-e2e/src/tests/remixd.test.ts +++ b/apps/remix-ide-e2e/src/tests/remixd.test.ts @@ -55,6 +55,7 @@ module.exports = { }, 'start Remixd': function (browser) { startRemixd(browser) + }, 'run Remixd tests #group4': function (browser) { runTests(browser) @@ -73,7 +74,7 @@ module.exports = { .setSolidityCompilerVersion('soljson-v0.5.0+commit.1d4f565a.js') .testContracts('test_import_node_modules.sol', sources[3]['test_import_node_modules.sol'], ['SafeMath']) }, - 'Import from node_modules and reference a github import #group2': function (browser) { + 'Import from node_modules and reference a github import #group2 #flaky': function (browser) { browser.waitForElementVisible('#icon-panel', 2000) .clickLaunchIcon('filePanel') .addFile('test_import_node_modules_with_github_import.sol', sources[4]['test_import_node_modules_with_github_import.sol']) @@ -131,6 +132,7 @@ function startRemixd (browser: NightwatchBrowser) { .waitForElementVisible('*[data-id="remixdConnect-modal-footer-ok-react"]', 2000) .pause(2000) .click('*[data-id="remixdConnect-modal-footer-ok-react"]') + .pause(10000) // .click('*[data-id="workspacesModalDialog-modal-footer-ok-react"]') } From 239dc510c2914c9b8d3f327a0970a9d7085c813a Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 18 Jul 2022 13:40:45 +0200 Subject: [PATCH 085/179] flaky tx listener --- apps/remix-ide-e2e/src/tests/remixd.test.ts | 2 +- apps/remix-ide-e2e/src/tests/txListener.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/remixd.test.ts b/apps/remix-ide-e2e/src/tests/remixd.test.ts index 7389093e35..8f4428b2f3 100644 --- a/apps/remix-ide-e2e/src/tests/remixd.test.ts +++ b/apps/remix-ide-e2e/src/tests/remixd.test.ts @@ -74,7 +74,7 @@ module.exports = { .setSolidityCompilerVersion('soljson-v0.5.0+commit.1d4f565a.js') .testContracts('test_import_node_modules.sol', sources[3]['test_import_node_modules.sol'], ['SafeMath']) }, - 'Import from node_modules and reference a github import #group2 #flaky': function (browser) { + 'Import from node_modules and reference a github import #group2': function (browser) { browser.waitForElementVisible('#icon-panel', 2000) .clickLaunchIcon('filePanel') .addFile('test_import_node_modules_with_github_import.sol', sources[4]['test_import_node_modules_with_github_import.sol']) diff --git a/apps/remix-ide-e2e/src/tests/txListener.test.ts b/apps/remix-ide-e2e/src/tests/txListener.test.ts index 41dc6882e7..a7ce136a2e 100644 --- a/apps/remix-ide-e2e/src/tests/txListener.test.ts +++ b/apps/remix-ide-e2e/src/tests/txListener.test.ts @@ -15,7 +15,7 @@ module.exports = { '@sources': function () { return sources }, - 'The sequence: Compiling / Deploying / Compiling another contract / calling the first contract - should display in the log the transaction with all the decoded information': function (browser: NightwatchBrowser) { + 'The sequence: Compiling / Deploying / Compiling another contract / calling the first contract - should display in the log the transaction with all the decoded information #flaky': function (browser: NightwatchBrowser) { // https://github.com/ethereum/remix-ide/issues/2864 browser .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) From 1b74d4e30abe29384f3625ca8f93a8c64d704963 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 18 Jul 2022 14:41:24 +0200 Subject: [PATCH 086/179] setvalue fix --- apps/remix-ide-e2e/src/commands/testFunction.ts | 5 ++++- apps/remix-ide-e2e/src/tests/txListener.test.ts | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/testFunction.ts b/apps/remix-ide-e2e/src/commands/testFunction.ts index 371fec9568..a144175894 100644 --- a/apps/remix-ide-e2e/src/commands/testFunction.ts +++ b/apps/remix-ide-e2e/src/commands/testFunction.ts @@ -22,7 +22,10 @@ class TestFunction extends EventEmitter { }) }) .perform((done) => { - browser.waitForElementVisible(`[data-id="block_tx${txHash}"]`, 60000) + browser + .waitForElementVisible(`[data-id="block_tx${txHash}"]`, 60000) + .moveToElement(`[data-id="block_tx${txHash}"]`, 0, 0) + .pause(2000) .click(`[data-id="block_tx${txHash}"]`) .pause(3000) .waitForElementVisible(`*[data-id="txLoggerTable${txHash}"]`, 60000) diff --git a/apps/remix-ide-e2e/src/tests/txListener.test.ts b/apps/remix-ide-e2e/src/tests/txListener.test.ts index a7ce136a2e..ed424459e3 100644 --- a/apps/remix-ide-e2e/src/tests/txListener.test.ts +++ b/apps/remix-ide-e2e/src/tests/txListener.test.ts @@ -9,13 +9,14 @@ const sources = [ ] module.exports = { + '@disabled': true, before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done) }, '@sources': function () { return sources }, - 'The sequence: Compiling / Deploying / Compiling another contract / calling the first contract - should display in the log the transaction with all the decoded information #flaky': function (browser: NightwatchBrowser) { + 'The sequence: Compiling / Deploying / Compiling another contract / calling the first contract - should display in the log the transaction with all the decoded information #group1 #flaky': function (browser: NightwatchBrowser) { // https://github.com/ethereum/remix-ide/issues/2864 browser .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) @@ -36,8 +37,7 @@ module.exports = { .clickLaunchIcon('solidity') .testContracts('Untitled1.sol', sources[1]['Untitled1.sol'], ['test']) .clickLaunchIcon('udapp') - .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '' }) - .pause(5000) + .clickFunction('delegate - transact (not payable)', { types: 'address to', values: '"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"' }) .testFunction('last', { status: 'false Transaction mined but execution failed', From e572ef6c94aef28ee8083cd8e3a53c288f0751e5 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 18 Jul 2022 14:49:09 +0200 Subject: [PATCH 087/179] undo flaky --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/txListener.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c4061c0d7c..4c24890cab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: true + default: false orbs: browser-tools: circleci/browser-tools@1.2.3 jobs: diff --git a/apps/remix-ide-e2e/src/tests/txListener.test.ts b/apps/remix-ide-e2e/src/tests/txListener.test.ts index ed424459e3..8a3b5d7999 100644 --- a/apps/remix-ide-e2e/src/tests/txListener.test.ts +++ b/apps/remix-ide-e2e/src/tests/txListener.test.ts @@ -16,7 +16,7 @@ module.exports = { '@sources': function () { return sources }, - 'The sequence: Compiling / Deploying / Compiling another contract / calling the first contract - should display in the log the transaction with all the decoded information #group1 #flaky': function (browser: NightwatchBrowser) { + 'The sequence: Compiling / Deploying / Compiling another contract / calling the first contract - should display in the log the transaction with all the decoded information #group1': function (browser: NightwatchBrowser) { // https://github.com/ethereum/remix-ide/issues/2864 browser .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) From 25c1b26771682ec1bb1309851ef6f4db9b536d4f Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 19 Jul 2022 15:46:05 +0200 Subject: [PATCH 088/179] e2e set group tag --- apps/remix-ide-e2e/src/tests/workspace.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 2bc0ea1811..d26c551e60 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -33,7 +33,7 @@ module.exports = { // WORKSPACE TEMPLATES E2E START - 'Should create Remix default workspace with files': function (browser: NightwatchBrowser) { + 'Should create Remix default workspace with files #group1': function (browser: NightwatchBrowser) { browser .clickLaunchIcon('filePanel') .click('*[data-id="workspaceCreate"]') @@ -90,7 +90,7 @@ module.exports = { .assert.elementPresent('*[data-id="treeViewLitreeViewItemREADME.txt"]') }, - 'Should create blank workspace with no files': function (browser: NightwatchBrowser) { + 'Should create blank workspace with no files #group1': function (browser: NightwatchBrowser) { browser .click('*[data-id="workspaceCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') @@ -111,7 +111,7 @@ module.exports = { }); }, - 'Should create ERC20 workspace with files': function (browser: NightwatchBrowser) { + 'Should create ERC20 workspace with files #group1': function (browser: NightwatchBrowser) { browser .click('*[data-id="workspaceCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') @@ -159,7 +159,7 @@ module.exports = { .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/SampleERC20_test.sol"]') }, - 'Should create ERC721 workspace with files': function (browser: NightwatchBrowser) { + 'Should create ERC721 workspace with files #group1': function (browser: NightwatchBrowser) { browser .click('*[data-id="workspaceCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') @@ -209,7 +209,7 @@ module.exports = { // WORKSPACE TEMPLATES E2E END - 'Should create two workspace and switch to the first one': function (browser: NightwatchBrowser) { + 'Should create two workspace and switch to the first one #group1': function (browser: NightwatchBrowser) { browser .click('*[data-id="workspaceCreate"]') // create workspace_name .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') From 84eb31666913076eb0717a88b3d32c92e52292f4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 19 Jul 2022 16:08:43 +0200 Subject: [PATCH 089/179] fix tests --- apps/remix-ide-e2e/src/tests/workspace.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index d26c551e60..7aac831055 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -272,6 +272,7 @@ module.exports = { 'Should clone a repository #group2': function (browser: NightwatchBrowser) { browser + .clickLaunchIcon('filePanel') .waitForElementVisible('[data-id="cloneGitRepository"]') .click('[data-id="cloneGitRepository"]') .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') From f23f65d14f41c91486ed94af42632fe3ed873e87 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 20 Jul 2022 09:40:05 +0200 Subject: [PATCH 090/179] fix test --- apps/remix-ide-e2e/src/commands/openFile.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/openFile.ts b/apps/remix-ide-e2e/src/commands/openFile.ts index ad5ec6d06e..74c4eda5a4 100644 --- a/apps/remix-ide-e2e/src/commands/openFile.ts +++ b/apps/remix-ide-e2e/src/commands/openFile.ts @@ -23,10 +23,10 @@ function openFile (browser: NightwatchBrowser, name: string, done: VoidFunction) browser.element('css selector', '[data-id="verticalIconsKindfilePanel"] img[data-id="selected"]', (result) => { if (result.status === 0) { done() - } else browser.clickLaunchIcon('filePanel').perform(done()) + } else browser.clickLaunchIcon('filePanel').perform(done) }) } else { - browser.clickLaunchIcon('filePanel').perform(done()) + browser.clickLaunchIcon('filePanel').perform(done) } }) From f5e5700d0c9ce6719204961b1b29d665eb7f674d Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 20 Jul 2022 10:04:23 +0200 Subject: [PATCH 091/179] fix e2e --- apps/remix-ide-e2e/src/commands/openFile.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/openFile.ts b/apps/remix-ide-e2e/src/commands/openFile.ts index 74c4eda5a4..8a40c200d5 100644 --- a/apps/remix-ide-e2e/src/commands/openFile.ts +++ b/apps/remix-ide-e2e/src/commands/openFile.ts @@ -23,10 +23,14 @@ function openFile (browser: NightwatchBrowser, name: string, done: VoidFunction) browser.element('css selector', '[data-id="verticalIconsKindfilePanel"] img[data-id="selected"]', (result) => { if (result.status === 0) { done() - } else browser.clickLaunchIcon('filePanel').perform(done) + } else browser.clickLaunchIcon('filePanel').perform(() => { + done() + }) }) } else { - browser.clickLaunchIcon('filePanel').perform(done) + browser.clickLaunchIcon('filePanel').perform(() => { + done() + }) } }) From 4e3bceb1d3dc7fb0aaab7e5941dc847462e51eac Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 12:33:48 +0200 Subject: [PATCH 092/179] update sol test --- apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index 7e61167107..880c891912 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -178,9 +178,9 @@ module.exports = { .click('*[data-id="workspaceCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') // eslint-disable-next-line dot-notation - .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_new' }) + .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_new') .waitForElementVisible('*[data-id="fileSystem-modal-footer-ok-react"]') - .execute(function () { (document.querySelector('[data-id="fileSystem-modal-footer-ok-react"]') as HTMLElement).click() }) + .click('*[data-id="fileSystem-modal-footer-ok-react"]') .currentWorkspaceIs('workspace_new') .waitForElementVisible('li[data-id="treeViewLitreeViewItem.deps/remix-tests/remix_tests.sol"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItem.deps/remix-tests/remix_accounts.sol"]') From 7facce05142a0fc1de0d280ad0d05a74ac7625b1 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 12:36:35 +0200 Subject: [PATCH 093/179] set flaky --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4c24890cab..c4061c0d7c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: false + default: true orbs: browser-tools: circleci/browser-tools@1.2.3 jobs: diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index 880c891912..a41a096f1e 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -164,7 +164,7 @@ module.exports = { .click('*[data-id="testTabGenerateTestFolder"]') }, - 'Changing current path when workspace changed and checking test files creation #group4': function (browser: NightwatchBrowser) { + 'Changing current path when workspace changed and checking test files creation #flaky #group4': function (browser: NightwatchBrowser) { browser .waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') .clickLaunchIcon('settings') From 84d71d762f7f367b579c7cb2fea0bec83bc1a361 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 12:58:36 +0200 Subject: [PATCH 094/179] sol test --- apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index a41a096f1e..57e25aabdb 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -178,7 +178,10 @@ module.exports = { .click('*[data-id="workspaceCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') // eslint-disable-next-line dot-notation - .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_new') + .execute(() => { + (document.querySelector('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]') as any).value = "workspace_new" + }, [], () => {}) + .pause(2000) .waitForElementVisible('*[data-id="fileSystem-modal-footer-ok-react"]') .click('*[data-id="fileSystem-modal-footer-ok-react"]') .currentWorkspaceIs('workspace_new') From 4b880d5e6689bac05236a1f295fae3735f89dfef Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 13:20:21 +0200 Subject: [PATCH 095/179] update browser tools --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c4061c0d7c..4106354766 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ parameters: type: boolean default: true orbs: - browser-tools: circleci/browser-tools@1.2.3 + browser-tools: circleci/browser-tools@1.3.0 jobs: build: docker: From 0914f580aaaeea5b18072f0da5bc6dd8732e5605 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 13:45:41 +0200 Subject: [PATCH 096/179] sol test --- .../src/tests/solidityUnittests.test.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index 57e25aabdb..b750a95f11 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -177,11 +177,18 @@ module.exports = { // creating a new workspace .click('*[data-id="workspaceCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') + .click('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]') + .setValue('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_new') // eslint-disable-next-line dot-notation - .execute(() => { - (document.querySelector('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]') as any).value = "workspace_new" - }, [], () => {}) + //.execute(() => { + // (document.querySelector('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]') as any).value = "workspace_new" + //}, [], () => {}) .pause(2000) + .getValue('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]', (result) => { + console.log(result) + browser.assert.equal(result.value, 'workspace_new') + }) + //.verify.attributeEquals('*[data-id="modalDialogCustomPromptTextCreate"]', 'value', 'workspace_new') .waitForElementVisible('*[data-id="fileSystem-modal-footer-ok-react"]') .click('*[data-id="fileSystem-modal-footer-ok-react"]') .currentWorkspaceIs('workspace_new') From 2d2c74e39bd388fc5565952dfef74a7bfea557eb Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 13:57:15 +0200 Subject: [PATCH 097/179] sol test --- apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index b750a95f11..a835a3dd06 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -191,6 +191,7 @@ module.exports = { //.verify.attributeEquals('*[data-id="modalDialogCustomPromptTextCreate"]', 'value', 'workspace_new') .waitForElementVisible('*[data-id="fileSystem-modal-footer-ok-react"]') .click('*[data-id="fileSystem-modal-footer-ok-react"]') + .pause(3000) .currentWorkspaceIs('workspace_new') .waitForElementVisible('li[data-id="treeViewLitreeViewItem.deps/remix-tests/remix_tests.sol"]') .waitForElementVisible('li[data-id="treeViewLitreeViewItem.deps/remix-tests/remix_accounts.sol"]') From 0d8de278934a7b2dfcd49e84d7a9812f711f339f Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 14:04:19 +0200 Subject: [PATCH 098/179] fake disable --- apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index a835a3dd06..a6f3229740 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -164,7 +164,7 @@ module.exports = { .click('*[data-id="testTabGenerateTestFolder"]') }, - 'Changing current path when workspace changed and checking test files creation #flaky #group4': function (browser: NightwatchBrowser) { + 'Changing current path when workspace changed and checking test files creation #group4': function (browser: NightwatchBrowser) { browser .waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') .clickLaunchIcon('settings') From 7a5ef2ae390f938f896aa8897832bb3dbdc454fb Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 14:06:00 +0200 Subject: [PATCH 099/179] fake disable --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4106354766..bccbf0146a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: true + default: false orbs: browser-tools: circleci/browser-tools@1.3.0 jobs: From d53c29ca257e8ea5505d7b02bde9f78bc1e5de05 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 14:16:34 +0200 Subject: [PATCH 100/179] debug file list --- apps/remix-ide/ci/browser_test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/ci/browser_test.sh b/apps/remix-ide/ci/browser_test.sh index 7a9b536f0c..5599e8f989 100755 --- a/apps/remix-ide/ci/browser_test.sh +++ b/apps/remix-ide/ci/browser_test.sh @@ -14,7 +14,8 @@ yarn run remixd & sleep 5 yarn run build:e2e - +grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort +grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort | circleci tests split TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort | circleci tests split ) for TESTFILE in $TESTFILES; do npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=$1 || TEST_EXITCODE=1 From 53a993d952dca3d04faf100014885081b8368f39 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 14:29:44 +0200 Subject: [PATCH 101/179] run and deploy --- apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts b/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts index dceb54a420..c8f2277ba2 100644 --- a/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts +++ b/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts @@ -80,7 +80,7 @@ module.exports = { .end() }, - 'Should connect to Goerli Test Network using MetaMask': '' + function (browser: NightwatchBrowser) { + 'Should connect to Goerli Test Network using MetaMask': !function (browser: NightwatchBrowser) { browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') .setupMetamask(passphrase, password) .click('.network-indicator__down-arrow') @@ -101,7 +101,7 @@ module.exports = { .switchBrowserTab(0) }, - 'Should deploy contract on Goerli Test Network using MetaMask': '' + function (browser: NightwatchBrowser) { + 'Should deploy contract on Goerli Test Network using MetaMask': !function (browser: NightwatchBrowser) { browser.waitForElementPresent('*[data-id="runTabSelectAccount"] option') .clickLaunchIcon('filePanel') .openFile('Greet.sol') @@ -118,7 +118,7 @@ module.exports = { .switchBrowserTab(0) }, - 'Should run low level interaction (fallback function) on Goerli Test Network using MetaMask': '' + function (browser: NightwatchBrowser) { + 'Should run low level interaction (fallback function) on Goerli Test Network using MetaMask': !function (browser: NightwatchBrowser) { browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') .waitForElementPresent('*[data-id="universalDappUiTitleExpander"]') .click('*[data-id="universalDappUiTitleExpander"]') @@ -135,7 +135,7 @@ module.exports = { .end() }, - 'Should connect to Ethereum Main Network using MetaMask': '' + function (browser: NightwatchBrowser) { + 'Should connect to Ethereum Main Network using MetaMask': !function (browser: NightwatchBrowser) { browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') .switchBrowserTab(2) .waitForElementPresent('.network-indicator__down-arrow') @@ -153,7 +153,7 @@ module.exports = { .assert.containsText('*[data-id="settingsNetworkEnv"]', 'Main (1) network') }, - 'Should deploy contract on Ethereum Main Network using MetaMask': '' + function (browser: NightwatchBrowser) { + 'Should deploy contract on Ethereum Main Network using MetaMask': !function (browser: NightwatchBrowser) { browser.waitForElementPresent('*[data-id="runTabSelectAccount"] option') .clickLaunchIcon('filePanel') .openFile('Greet.sol') @@ -173,7 +173,7 @@ module.exports = { * - Ropsten node for retrieving the trace and storage * */ - 'Should debug Ropsten transaction with source highlighting using the source verifier service and MetaMask': '' + function (browser: NightwatchBrowser) { + 'Should debug Ropsten transaction with source highlighting using the source verifier service and MetaMask': !function (browser: NightwatchBrowser) { browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) .switchBrowserTab(2) @@ -198,7 +198,7 @@ module.exports = { .assert.containsText('*[data-id="solidityLocals"]', 'to: 0x6C3CCC7FBA111707D5A1AAF2758E9D4F4AC5E7B1') }, - 'Call web3.eth.getAccounts() using Injected Provider (Metamask)': '' + function (browser: NightwatchBrowser) { + 'Call web3.eth.getAccounts() using Injected Provider (Metamask)': !function (browser: NightwatchBrowser) { browser .executeScriptInTerminal('web3.eth.getAccounts()') .pause(2000) From ef6160e0f5994c4b93c45b6f663284414ef557cb Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 14:42:32 +0200 Subject: [PATCH 102/179] cat the file --- apps/remix-ide/ci/browser_test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide/ci/browser_test.sh b/apps/remix-ide/ci/browser_test.sh index 5599e8f989..3efc2ea4c8 100755 --- a/apps/remix-ide/ci/browser_test.sh +++ b/apps/remix-ide/ci/browser_test.sh @@ -16,6 +16,7 @@ sleep 5 yarn run build:e2e grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort | circleci tests split +cat dist/apps/remix-ide-e2e/src/tests/runAndDeploy.test.js TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort | circleci tests split ) for TESTFILE in $TESTFILES; do npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=$1 || TEST_EXITCODE=1 From 95173a7194f5ebe0ee2bef41376217a863b88fb6 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 14:51:22 +0200 Subject: [PATCH 103/179] test files --- apps/remix-ide/ci/browser_test.sh | 5 + publish.sh | 1 + yarn.lock | 891 +++++++++++++++--------------- 3 files changed, 442 insertions(+), 455 deletions(-) create mode 100644 publish.sh diff --git a/apps/remix-ide/ci/browser_test.sh b/apps/remix-ide/ci/browser_test.sh index 3efc2ea4c8..6fd2d274df 100755 --- a/apps/remix-ide/ci/browser_test.sh +++ b/apps/remix-ide/ci/browser_test.sh @@ -14,7 +14,12 @@ yarn run remixd & sleep 5 yarn run build:e2e +grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort +echo ------- +grep -IRiL "\'\@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort +echo ------- grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort +echo ------- grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort | circleci tests split cat dist/apps/remix-ide-e2e/src/tests/runAndDeploy.test.js TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort | circleci tests split ) diff --git a/publish.sh b/publish.sh new file mode 100644 index 0000000000..f47b6ae632 --- /dev/null +++ b/publish.sh @@ -0,0 +1 @@ +node apps/remix-ide/ci/publishIpfs 2AtD42kl9FC1IOgEBWdPTq2cizT c07a85881fb6124579693a888181e85a \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index ead77d9fa4..edec7dc524 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3242,19 +3242,19 @@ npmlog "^4.1.2" write-file-atomic "^2.3.0" -"@monaco-editor/loader@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@monaco-editor/loader/-/loader-1.2.0.tgz#373fad69973384624e3d9b60eefd786461a76acd" - integrity sha512-cJVCG/T/KxXgzYnjKqyAgsKDbH9mGLjcXxN6AmwumBwa2rVFkwvGcUj1RJtD0ko4XqLqJxwqsN/Z/KURB5f1OQ== +"@monaco-editor/loader@^1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@monaco-editor/loader/-/loader-1.3.2.tgz#04effbb87052d19cd7d3c9d81c0635490f9bb6d8" + integrity sha512-BTDbpHl3e47r3AAtpfVFTlAi7WXv4UQ/xZmz8atKl4q7epQV5e7+JbigFDViWF71VBi4IIBdcWP57Hj+OWuc9g== dependencies: state-local "^1.0.6" -"@monaco-editor/react@^4.3.1": - version "4.3.1" - resolved "https://registry.yarnpkg.com/@monaco-editor/react/-/react-4.3.1.tgz#d65bcbf174c39b6d4e7fec43d0cddda82b70a12a" - integrity sha512-f+0BK1PP/W5I50hHHmwf11+Ea92E5H1VZXs+wvKplWUWOfyMa1VVwqkJrXjRvbcqHL+XdIGYWhWNdi4McEvnZg== +"@monaco-editor/react@4.4.5": + version "4.4.5" + resolved "https://registry.yarnpkg.com/@monaco-editor/react/-/react-4.4.5.tgz#beabe491efeb2457441a00d1c7651c653697f65b" + integrity sha512-IImtzU7sRc66OOaQVCG+5PFHkSWnnhrUWGBuH6zNmH2h0YgmAhcjHZQc/6MY9JWEbUtVF1WPBMJ9u1XuFbRrVA== dependencies: - "@monaco-editor/loader" "^1.2.0" + "@monaco-editor/loader" "^1.3.2" prop-types "^15.7.2" "@mrmlnc/readdir-enhanced@^2.2.1": @@ -3270,6 +3270,18 @@ resolved "https://registry.yarnpkg.com/@multiformats/base-x/-/base-x-4.0.1.tgz#95ff0fa58711789d53aefb2590a8b7a4e715d121" integrity sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw== +"@nightwatch/chai@5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@nightwatch/chai/-/chai-5.0.2.tgz#86b20908fc090dffd5c9567c0392bc6a494cc2e6" + integrity sha512-yzILJFCcE75OPoRfBlJ80Y3Ky06ljsdrK4Ld92yhmM477vxO2GEguwnd+ldl7pdSYTcg1gSJ1bPPQrA+/Hrn+A== + dependencies: + assertion-error "1.1.0" + check-error "1.0.2" + deep-eql "4.0.1" + loupe "2.3.4" + pathval "1.1.1" + type-detect "4.0.8" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -4289,10 +4301,12 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-7.0.2.tgz#b17f16cf933597e10d6d78eae3251e692ce8b0ce" integrity sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w== -"@types/nightwatch@1.3.4": - version "1.3.4" - resolved "https://registry.yarnpkg.com/@types/nightwatch/-/nightwatch-1.3.4.tgz#e6b5ce207a191dff37842e2b5d91f802ff8e04b0" - integrity sha512-qvP0Sa0MdFNnnqm8l2lJ3EvUJGsx6/0Hwn2yBsTkXopaNONP4oY3YmKpHL2CwCxDyc4s8/BGhqpNK63JaS+uhg== +"@types/nightwatch@^2.0.9": + version "2.0.9" + resolved "https://registry.yarnpkg.com/@types/nightwatch/-/nightwatch-2.0.9.tgz#c5d3ed42ead7a58563cac96ebc52f40f09897ea1" + integrity sha512-vA568B2hjedgtjNf/ZM1po9Y5GWz8+jox0748+YyqilWIxV5fXkpKFSUWk41Evoqn5WI3JENlNupzs2o6pHjRA== + dependencies: + "@types/selenium-webdriver" "*" "@types/node@*", "@types/node@>= 8", "@types/node@~8.9.4": version "8.9.5" @@ -4437,6 +4451,13 @@ dependencies: "@types/node" "*" +"@types/selenium-webdriver@*": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-4.1.1.tgz#aefb038f0462fd880f9c9581b8b3b71ce385719c" + integrity sha512-NxxZZek50ylIACiXebKQYHD3D4One3WXOasEXWazL6aTfYbZob7ClNKxUpg8I4/oWArX87oPWvj1cHKqfel3Hg== + dependencies: + "@types/ws" "*" + "@types/source-list-map@*": version "0.1.2" resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" @@ -4473,6 +4494,13 @@ "@types/source-list-map" "*" source-map "^0.6.1" +"@types/ws@*": + version "8.5.3" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.3.tgz#7d25a1ffbecd3c4f2d35068d0b283c037003274d" + integrity sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w== + dependencies: + "@types/node" "*" + "@types/ws@^7.2.4": version "7.4.7" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" @@ -4896,7 +4924,7 @@ agent-base@4, agent-base@^4.3.0: dependencies: es6-promisify "^5.0.0" -agent-base@6, agent-base@^6.0.0, agent-base@^6.0.2: +agent-base@6, agent-base@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== @@ -4995,11 +5023,6 @@ ansi-align@^3.0.0: dependencies: string-width "^4.1.0" -ansi-colors@3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" - integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== - ansi-colors@4.1.1, ansi-colors@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -5085,6 +5108,13 @@ ansi-styles@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== +ansi-to-html@^0.7.2: + version "0.7.2" + resolved "https://registry.yarnpkg.com/ansi-to-html/-/ansi-to-html-0.7.2.tgz#a92c149e4184b571eb29a0135ca001a8e2d710cb" + integrity sha512-v6MqmEpNlxF+POuyhKkidusCHWWkaLcGRURzivcU3I9tv7k4JVhFcnukrM5Rlk2rUywdZuzYAZ+kbZqWCnfN3g== + dependencies: + entities "^2.2.0" + ansi-wrap@0.1.0, ansi-wrap@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" @@ -5397,12 +5427,7 @@ assert@^1.1.1, assert@^1.4.0: object-assign "^4.1.1" util "0.10.3" -assertion-error@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.0.tgz#c7f85438fdd466bc7ca16ab90c81513797a5d23b" - integrity sha512-g/gZV+G476cnmtYI+Ko9d5khxSoCSoom/EaNmmCfwpOvBXEJ18qwFrxfP1/CsIqk2no1sAKKwxndV0tP7ROOFQ== - -assertion-error@^1.1.0: +assertion-error@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== @@ -5417,13 +5442,6 @@ ast-types-flow@^0.0.7: resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" integrity sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag== -ast-types@^0.13.2: - version "0.13.4" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.13.4.tgz#ee0d77b343263965ecc3fb62da16e7222b2b6782" - integrity sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w== - dependencies: - tslib "^2.0.1" - astral-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" @@ -6407,7 +6425,7 @@ bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" -bl@^4.0.0, bl@^4.0.3: +bl@^4.0.0, bl@^4.0.3, bl@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== @@ -6533,20 +6551,7 @@ borc@^2.1.2: json-text-sequence "~0.1.0" readable-stream "^3.6.0" -boxen@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.0.0.tgz#b2694baf1f605f708ff0177c12193b22f29aaaab" - integrity sha512-FZj5GYLLk8acj0Ufw0w7GjsfC1EbhjJ2okJY0sfSrVc9fb9tDVB+WaulBIaH6fz4iYw2ZWOrBmz06NXIB4a/eA== - dependencies: - ansi-align "^1.1.0" - camelcase "^4.0.0" - chalk "^1.1.1" - cli-boxes "^1.0.0" - string-width "^2.0.0" - term-size "^0.1.0" - widest-line "^1.0.0" - -boxen@^5.0.0: +boxen@5.1.2, boxen@^5.0.0: version "5.1.2" resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== @@ -6560,6 +6565,19 @@ boxen@^5.0.0: widest-line "^3.1.0" wrap-ansi "^7.0.0" +boxen@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.0.0.tgz#b2694baf1f605f708ff0177c12193b22f29aaaab" + integrity sha512-FZj5GYLLk8acj0Ufw0w7GjsfC1EbhjJ2okJY0sfSrVc9fb9tDVB+WaulBIaH6fz4iYw2ZWOrBmz06NXIB4a/eA== + dependencies: + ansi-align "^1.1.0" + camelcase "^4.0.0" + chalk "^1.1.1" + cli-boxes "^1.0.0" + string-width "^2.0.0" + term-size "^0.1.0" + widest-line "^1.0.0" + brace-expansion@^1.0.0: version "1.1.6" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9" @@ -7318,13 +7336,12 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" -chai-nightwatch@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/chai-nightwatch/-/chai-nightwatch-0.4.1.tgz#6846d6986f70cec63e5cadbe155350fcd5817ac4" - integrity sha512-s2put5cFhG8Hw+6Po3R8QZ0ctsDmcaIh7+l9Fu3RcLCfosfQffT3mcFSq2jmXEQk0pmwo/PuXvYMO87MRlyqxg== +chai-nightwatch@0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/chai-nightwatch/-/chai-nightwatch-0.5.3.tgz#980ecf63dde5a04e7f3524370682c7ff01178ffb" + integrity sha512-38ixH/mqpY6IwnZkz6xPqx8aB5/KVR+j6VPugcir3EGOsphnWXrPH/mUt8Jp+ninL6ghY0AaJDQ10hSfCPGy/g== dependencies: - assertion-error "1.0.0" - deep-eql "0.1.3" + assertion-error "1.1.0" chalk@4.1.0: version "4.1.0" @@ -7345,7 +7362,7 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.3.2, chalk@^2.4.1, chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.3.2, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -7398,6 +7415,11 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== +check-error@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== + chokidar@3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" @@ -7413,6 +7435,21 @@ chokidar@3.5.1: optionalDependencies: fsevents "~2.3.1" +chokidar@3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + "chokidar@>=3.0.0 <4.0.0", chokidar@^3.3.0, chokidar@^3.4.1, chokidar@^3.5.1, chokidar@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" @@ -7483,6 +7520,11 @@ chrome-trace-event@^1.0.2: resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== +ci-info@3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.0.tgz#b4ed1fb6818dea4803a55c623041f9165d2066b2" + integrity sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw== + ci-info@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" @@ -7598,7 +7640,7 @@ cli-cursor@^3.1.0: dependencies: restore-cursor "^3.1.0" -cli-spinners@^2.2.0: +cli-spinners@^2.5.0: version "2.6.1" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.6.1.tgz#adc954ebe281c37a6319bfa401e6dd2488ffb70d" integrity sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g== @@ -8730,7 +8772,7 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -data-uri-to-buffer@3, data-uri-to-buffer@^3.0.1: +data-uri-to-buffer@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz#594b8973938c5bc2c33046535785341abc4f3636" integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og== @@ -8778,13 +8820,6 @@ debug@3.1.0, debug@^3.1.0: dependencies: ms "2.0.0" -debug@3.2.6: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - debug@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" @@ -8799,6 +8834,13 @@ debug@4.3.1: dependencies: ms "2.1.2" +debug@4.3.3: + version "4.3.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" + integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== + dependencies: + ms "2.1.2" + debug@^3.1.1, debug@^3.2.6, debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" @@ -8865,12 +8907,12 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= -deep-eql@0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2" - integrity sha1-71WKyrjeJSBs1xOQbXTlaTDrafI= +deep-eql@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.0.1.tgz#2b65bc89491d193780c452edee2144a91bb0a445" + integrity sha512-D/Oxqobjr+kxaHsgiQBZq9b6iAWdEj5W/JdJm8deNduAPc9CwXQ3BJJCuEqlrPXcy45iOMkGPZ0T81Dnz7UDCA== dependencies: - type-detect "0.1.1" + type-detect "^4.0.0" deep-equal@^1.0.1, deep-equal@~1.1.1: version "1.1.1" @@ -8956,7 +8998,12 @@ deferred-leveldown@~5.3.0: abstract-leveldown "~6.2.1" inherits "^2.0.3" -define-properties@^1.1.2, define-properties@^1.1.3: +define-lazy-prop@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" + integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== + +define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== @@ -8990,16 +9037,6 @@ defined@^1.0.0, defined@~1.0.0: resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= -degenerator@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-3.0.1.tgz#7ef78ec0c8577a544477308ddf1d2d6e88d51f5b" - integrity sha512-LFsIFEeLPlKvAKXu7j3ssIG6RT0TbI7/GhsqrI0DnHASEQjXQ0LUSYcjJteGgRGmZbl1TnMSxpNQIAiJ7Du5TQ== - dependencies: - ast-types "^0.13.2" - escodegen "^1.8.1" - esprima "^4.0.0" - vm2 "^3.9.3" - del@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/del/-/del-4.1.1.tgz#9e8f117222ea44a31ff3a156c049b99052a9f0b4" @@ -9103,7 +9140,7 @@ dezalgo@^1.0.0, dezalgo@^1.0.1, dezalgo@~1.0.3: asap "^2.0.0" wrappy "1" -didyoumean@^1.2.1: +didyoumean@1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.2.tgz#989346ffe9e839b4555ecf5666edea0d3e8ad037" integrity sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw== @@ -9118,16 +9155,16 @@ diff3@0.0.3: resolved "https://registry.yarnpkg.com/diff3/-/diff3-0.0.3.tgz#d4e5c3a4cdf4e5fe1211ab42e693fcb4321580fc" integrity sha1-1OXDpM305f4SEatC5pP8tDIVgPw= -diff@3.5.0, diff@^3.1.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - diff@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== +diff@^3.1.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + diff@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" @@ -9334,10 +9371,10 @@ dot-prop@^5.1.0, dot-prop@^5.2.0: dependencies: is-obj "^2.0.0" -dotenv@7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-7.0.0.tgz#a2be3cd52736673206e8a85fb5210eea29628e7c" - integrity sha512-M3NhsLbV1i6HuGzBUH8vXrtxOk+tWmzWKDMbAVSUp3Zsjm7ywFeuwrUXhmhQyRK1q5B5GGy7hcXPbj3bnfZg2g== +dotenv@10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" + integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== dotenv@8.2.0: version "8.2.0" @@ -9444,7 +9481,7 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -ejs@^3.1.5, ejs@^3.1.6: +ejs@^3.1.5, ejs@^3.1.8: version "3.1.8" resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.8.tgz#758d32910c78047585c7ef1f92f9ee041c1c190b" integrity sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ== @@ -9574,7 +9611,7 @@ ent@~2.2.0: resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= -entities@^2.0.0, entities@^2.0.3: +entities@^2.0.0, entities@^2.0.3, entities@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== @@ -9584,7 +9621,7 @@ env-paths@^2.2.0: resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== -envinfo@^7.3.1, envinfo@^7.5.1: +envinfo@7.8.1, envinfo@^7.3.1: version "7.8.1" resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== @@ -9728,33 +9765,21 @@ escape-html@~1.0.3: resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - escape-string-regexp@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + escape-string-regexp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== -escodegen@^1.8.1: - version "1.14.3" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" - integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== - dependencies: - esprima "^4.0.1" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - escodegen@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" @@ -10019,7 +10044,7 @@ esrecurse@^4.1.0, esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.1.1: version "4.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== @@ -10695,11 +10720,6 @@ file-uri-to-path@1.0.0: resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== -file-uri-to-path@2: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-2.0.0.tgz#7b415aeba227d575851e0a5b0c640d7656403fba" - integrity sha512-hjPFI8oE/2iQPVe4gbrJ73Pp+Xfub2+WI2LlXDbsaJBwT5wuMh35WNWVYYTpnz895shtwfyutMFLFywpQAFdLg== - filelist@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.4.tgz#f78978a1e944775ff9e62e744424f215e58352b5" @@ -10798,13 +10818,6 @@ find-cache-dir@^3.3.1: make-dir "^3.0.2" pkg-dir "^4.1.0" -find-up@3.0.0, find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - find-up@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" @@ -10828,6 +10841,13 @@ find-up@^2.0.0, find-up@^2.1.0: dependencies: locate-path "^2.0.0" +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" @@ -10881,13 +10901,6 @@ flat-cache@^2.0.1: rimraf "2.6.3" write "1.0.3" -flat@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.1.tgz#a392059cc382881ff98642f5da4dde0a959f309b" - integrity sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA== - dependencies: - is-buffer "~2.0.3" - flat@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" @@ -11104,6 +11117,15 @@ fs-extra@^10.0.0: jsonfile "^6.0.1" universalify "^2.0.0" +fs-extra@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" + integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-extra@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291" @@ -11228,14 +11250,6 @@ fstream@^1.0.12: mkdirp ">=0.5 0" rimraf "2" -ftp@^0.3.10: - version "0.3.10" - resolved "https://registry.yarnpkg.com/ftp/-/ftp-0.3.10.tgz#9197d861ad8142f3e63d5a83bfe4c59f7330885d" - integrity sha1-kZfYYa2BQvPmPVqDv+TFn3MwiF0= - dependencies: - readable-stream "1.1.x" - xregexp "2.0.0" - function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -11301,6 +11315,11 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== + get-intrinsic@^1.0.2: version "1.1.2" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.2.tgz#336975123e05ad0b7ba41f152ee4aadbea6cf598" @@ -11387,18 +11406,6 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" -get-uri@3: - version "3.0.2" - resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-3.0.2.tgz#f0ef1356faabc70e1f9404fa3b66b2ba9bfc725c" - integrity sha512-+5s0SJbGoyiJTZZ2JTpFPLMPSch72KEqGOTvQsBqg0RBWvwhWUSYZFAtz3TPW0GXJuLBJPts1E241iHg+VRfhg== - dependencies: - "@tootallnate/once" "1" - data-uri-to-buffer "3" - debug "4" - file-uri-to-path "2" - fs-extra "^8.1.0" - ftp "^0.3.10" - get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -11563,18 +11570,6 @@ glob@7.0.x: once "^1.3.0" path-is-absolute "^1.0.0" -glob@7.1.3, glob@^7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - glob@7.1.4: version "7.1.4" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" @@ -11599,7 +11594,7 @@ glob@7.1.6: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.1.0, glob@^7.1.2, glob@^7.1.4, glob@^7.1.6: +glob@7.2.0, glob@^7.0.0, glob@^7.1.0, glob@^7.1.2, glob@^7.1.4, glob@^7.1.6: version "7.2.0" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== @@ -11623,6 +11618,30 @@ glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@~7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.2.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + glob@~7.1.7: version "7.1.7" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" @@ -11969,7 +11988,7 @@ has-symbol-support-x@^1.4.1: resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== -has-symbols@^1.0.0, has-symbols@^1.0.1, has-symbols@^1.0.2: +has-symbols@^1.0.1, has-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== @@ -12247,7 +12266,7 @@ http-proxy-agent@^2.1.0: agent-base "4" debug "3.1.0" -http-proxy-agent@^4.0.0, http-proxy-agent@^4.0.1: +http-proxy-agent@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== @@ -12336,14 +12355,6 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= -https-proxy-agent@5, https-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" - integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== - dependencies: - agent-base "6" - debug "4" - https-proxy-agent@^2.2.3: version "2.2.4" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" @@ -12352,6 +12363,14 @@ https-proxy-agent@^2.2.3: agent-base "^4.3.0" debug "^3.1.0" +https-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" + integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== + dependencies: + agent-base "6" + debug "4" + human-signals@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" @@ -12955,7 +12974,7 @@ is-buffer@^1.1.0, is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-buffer@^2.0.0, is-buffer@~2.0.3: +is-buffer@^2.0.0: version "2.0.5" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== @@ -13042,7 +13061,7 @@ is-directory@^0.3.1: resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= -is-docker@^2.0.0: +is-docker@^2.0.0, is-docker@^2.1.1: version "2.2.1" resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== @@ -13421,6 +13440,11 @@ is-unc-path@^1.0.0: dependencies: unc-path-regex "^0.1.2" +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + is-utf8@^0.2.0, is-utf8@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" @@ -13448,7 +13472,7 @@ is-wsl@^1.1.0: resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= -is-wsl@^2.1.1: +is-wsl@^2.1.1, is-wsl@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== @@ -14312,14 +14336,6 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@3.13.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - js-yaml@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.0.0.tgz#f426bc0ff4b4051926cd588c71113183409a121f" @@ -14327,6 +14343,13 @@ js-yaml@4.0.0: dependencies: argparse "^2.0.1" +js-yaml@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + js-yaml@^3.13.1, js-yaml@^3.9.0: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" @@ -14537,6 +14560,16 @@ jsprim@^1.2.2: array-includes "^3.1.3" object.assign "^4.1.2" +jszip@^3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.10.0.tgz#faf3db2b4b8515425e34effcdbb086750a346061" + integrity sha512-LDfVtOLtOxb9RXkYOwPyNBTQDL4eUbqahtoY6x07GiDJHwSYvn8sHHIw8wINImV3MqbMNve2gSuM1DDqEKk09Q== + dependencies: + lie "~3.3.0" + pako "~1.0.2" + readable-stream "~2.3.6" + setimmediate "^1.0.5" + jszip@^3.6.0: version "3.7.1" resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.7.1.tgz#bd63401221c15625a1228c556ca8a68da6fda3d9" @@ -15142,11 +15175,16 @@ lodash.debounce@^4.0.8: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= -lodash.defaultsdeep@^4.6.1: +lodash.defaultsdeep@4.6.1: version "4.6.1" resolved "https://registry.yarnpkg.com/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.1.tgz#512e9bd721d272d94e3d3a63653fa17516741ca6" integrity sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA== +lodash.escape@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-4.0.1.tgz#c9044690c21e04294beaa517712fded1fa88de98" + integrity sha512-nXEOnb/jK9g0DYMr1/Xvq6l5xMD7GDG55+GSYIYmS0G4tBk/hURD4JR9WCavs04t33WmJx9kCyp9vJ+mr4BOUw== + lodash.flattendeep@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" @@ -15201,7 +15239,7 @@ lodash.memoize@~3.0.3: resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" integrity sha1-LcvSwofLwKVcxCMovQxzYVDVPj8= -lodash.merge@^4.6.2: +lodash.merge@4.6.2, lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== @@ -15251,13 +15289,6 @@ lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== - dependencies: - chalk "^2.0.1" - log-symbols@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.0.0.tgz#69b3cc46d20f448eccdb75ea1fa733d9e821c920" @@ -15265,12 +15296,13 @@ log-symbols@4.0.0: dependencies: chalk "^4.0.0" -log-symbols@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" - integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== +log-symbols@4.1.0, log-symbols@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== dependencies: - chalk "^2.4.2" + chalk "^4.1.0" + is-unicode-supported "^0.1.0" logform@^2.2.0: version "2.3.0" @@ -15308,6 +15340,13 @@ loud-rejection@^1.0.0: currently-unhandled "^0.4.1" signal-exit "^3.0.0" +loupe@2.3.4: + version "2.3.4" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.4.tgz#7e0b9bffc76f148f9be769cb1321d3dcf3cb25f3" + integrity sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ== + dependencies: + get-func-name "^2.0.0" + lower-case@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" @@ -15899,6 +15938,13 @@ minimatch@*, minimatch@3.0.4: dependencies: brace-expansion "^1.1.7" +minimatch@4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-4.2.1.tgz#40d9d511a46bdc4e563c22c3080cde9c0d8299b4" + integrity sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g== + dependencies: + brace-expansion "^1.1.7" + minimatch@^3.0.0, minimatch@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" @@ -15906,7 +15952,7 @@ minimatch@^3.0.0, minimatch@^3.0.2: dependencies: brace-expansion "^1.0.0" -minimatch@^3.0.4: +minimatch@^3.0.4, minimatch@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -15947,6 +15993,11 @@ minimist@0.0.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= +minimist@1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== + minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5, minimist@~1.2.0, minimist@~1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" @@ -16105,13 +16156,6 @@ mkdirp@*, mkdirp@0.5.x, mkdirp@^0.5.3, mkdirp@^0.5.5: dependencies: minimist "^1.2.5" -mkdirp@0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.4.tgz#fd01504a6797ec5c9be81ff43d204961ed64a512" - integrity sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw== - dependencies: - minimist "^1.2.5" - "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" @@ -16129,34 +16173,35 @@ mkpath@1.0.0: resolved "https://registry.yarnpkg.com/mkpath/-/mkpath-1.0.0.tgz#ebb3a977e7af1c683ae6fda12b545a6ba6c5853d" integrity sha1-67Opd+evHGg65v2hK1Raa6bFhT0= -mocha@6.2.3: - version "6.2.3" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.2.3.tgz#e648432181d8b99393410212664450a4c1e31912" - integrity sha512-0R/3FvjIGH3eEuG17ccFPk117XL2rWxatr81a57D+r/x2uTYZRbdZ4oVidEUMh2W2TJDa7MdAb12Lm2/qrKajg== +mocha@9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.2.2.tgz#d70db46bdb93ca57402c809333e5a84977a88fb9" + integrity sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g== dependencies: - ansi-colors "3.2.3" + "@ungap/promise-all-settled" "1.1.2" + ansi-colors "4.1.1" browser-stdout "1.3.1" - debug "3.2.6" - diff "3.5.0" - escape-string-regexp "1.0.5" - find-up "3.0.0" - glob "7.1.3" + chokidar "3.5.3" + debug "4.3.3" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.2.0" growl "1.10.5" he "1.2.0" - js-yaml "3.13.1" - log-symbols "2.2.0" - minimatch "3.0.4" - mkdirp "0.5.4" - ms "2.1.1" - node-environment-flags "1.0.5" - object.assign "4.1.0" - strip-json-comments "2.0.1" - supports-color "6.0.0" - which "1.3.1" - wide-align "1.1.3" - yargs "13.3.2" - yargs-parser "13.1.2" - yargs-unparser "1.6.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "4.2.1" + ms "2.1.3" + nanoid "3.3.1" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + which "2.0.2" + workerpool "6.2.0" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" mocha@^8.0.1: version "8.4.0" @@ -16511,6 +16556,11 @@ nanoid@3.1.20: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.20.tgz#badc263c6b1dcf14b71efaa85f6ab4c1d6cfc788" integrity sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw== +nanoid@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35" + integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw== + nanoid@^3.0.2, nanoid@^3.1.23, nanoid@^3.1.3: version "3.1.29" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.29.tgz#214fb2d7a33e1a5bef4757b779dfaeb6a4e5aeb4" @@ -16570,11 +16620,6 @@ neo-async@^2.5.0, neo-async@^2.6.0, neo-async@^2.6.1: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -netmask@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/netmask/-/netmask-2.0.2.tgz#8b01a07644065d536383835823bc52004ebac5e7" - integrity sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg== - next-tick@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" @@ -16585,31 +16630,37 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -nightwatch@^1.7.11: - version "1.7.11" - resolved "https://registry.yarnpkg.com/nightwatch/-/nightwatch-1.7.11.tgz#b666425a8c901e17431d57fa2140a716f7894b1b" - integrity sha512-yV795EBXZ/myeoCvBtjC/QwvIprxF7SKh0XCeFnpoOtWXDb0yv+ATLRipKGfp+avyGtagqq38ucA4Uh6WPcnhQ== - dependencies: - assertion-error "^1.1.0" - chai-nightwatch "^0.4.0" - ci-info "^2.0.0" - didyoumean "^1.2.1" - dotenv "7.0.0" - ejs "^3.1.6" - envinfo "^7.5.1" +nightwatch@^2.2.2: + version "2.2.3" + resolved "https://registry.yarnpkg.com/nightwatch/-/nightwatch-2.2.3.tgz#07291c03130df5a39aa9ae2babd718048078866f" + integrity sha512-W2effHkwoSu+eSXsnkraiUW/CdO9B9+yiSqDeUZ3h9vL3WZmA/hfzC4ZQnrWzXJd4qvj2CsgCeKo9njSvlplog== + dependencies: + "@nightwatch/chai" "5.0.2" + ansi-to-html "^0.7.2" + assertion-error "1.1.0" + boxen "5.1.2" + chai-nightwatch "0.5.3" + ci-info "3.3.0" + didyoumean "1.2.2" + dotenv "10.0.0" + ejs "^3.1.8" + envinfo "7.8.1" + fs-extra "^10.1.0" + glob "^7.2.3" lodash.clone "3.0.3" - lodash.defaultsdeep "^4.6.1" - lodash.merge "^4.6.2" + lodash.defaultsdeep "4.6.1" + lodash.escape "^4.0.1" + lodash.merge "4.6.2" minimatch "3.0.4" - minimist "^1.2.5" + minimist "1.2.6" mkpath "1.0.0" - mocha "6.2.3" - ora "^4.0.3" - proxy-agent "^5.0.0" - request "^2.88.2" - request-promise "^4.2.5" - semver "^6.3.0" - strip-ansi "^6.0.0" + mocha "9.2.2" + open "^8.4.0" + ora "5.4.1" + selenium-webdriver "^4.3.1" + semver "7.3.5" + stacktrace-parser "^0.1.10" + strip-ansi "6.0.1" no-case@^2.2.0: version "2.3.2" @@ -16643,14 +16694,6 @@ node-emoji@^1.4.1: dependencies: lodash "^4.17.21" -node-environment-flags@1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.5.tgz#fa930275f5bf5dae188d6192b24b4c8bbac3d76a" - integrity sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ== - dependencies: - object.getownpropertydescriptors "^2.0.3" - semver "^5.7.0" - node-fetch-npm@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/node-fetch-npm/-/node-fetch-npm-2.0.4.tgz#6507d0e17a9ec0be3bec516958a497cec54bf5a4" @@ -17399,7 +17442,7 @@ object-is@^1.0.1: call-bind "^1.0.2" define-properties "^1.1.3" -object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.0.6, object-keys@^1.1.1: +object-keys@^1.0.12, object-keys@^1.0.6, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -17411,16 +17454,6 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - object.assign@^4.0.4, object.assign@^4.1.0, object.assign@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" @@ -17599,6 +17632,15 @@ open@^7.4.2: is-docker "^2.0.0" is-wsl "^2.1.1" +open@^8.4.0: + version "8.4.0" + resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8" + integrity sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q== + dependencies: + define-lazy-prop "^2.0.0" + is-docker "^2.1.1" + is-wsl "^2.2.0" + opener@^1.5.1: version "1.5.2" resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" @@ -17641,17 +17683,18 @@ options@>=0.0.5: resolved "https://registry.yarnpkg.com/options/-/options-0.0.6.tgz#ec22d312806bb53e731773e7cdaefcf1c643128f" integrity sha1-7CLTEoBrtT5zF3Pnza788cZDEo8= -ora@^4.0.3: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ora/-/ora-4.1.1.tgz#566cc0348a15c36f5f0e979612842e02ba9dddbc" - integrity sha512-sjYP8QyVWBpBZWD6Vr1M/KwknSw6kJOz41tvGMlwWeClHBtYKTbHMki1PsLZnxKpXMPbTKv9b3pjQu3REib96A== +ora@5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" + integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== dependencies: - chalk "^3.0.0" + bl "^4.1.0" + chalk "^4.1.0" cli-cursor "^3.1.0" - cli-spinners "^2.2.0" + cli-spinners "^2.5.0" is-interactive "^1.0.0" - log-symbols "^3.0.0" - mute-stream "0.0.8" + is-unicode-supported "^0.1.0" + log-symbols "^4.1.0" strip-ansi "^6.0.0" wcwidth "^1.0.1" @@ -17921,30 +17964,6 @@ p-waterfall@^1.0.0: dependencies: p-reduce "^1.0.0" -pac-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-5.0.0.tgz#b718f76475a6a5415c2efbe256c1c971c84f635e" - integrity sha512-CcFG3ZtnxO8McDigozwE3AqAw15zDvGH+OjXO4kzf7IkEKkQ4gxQ+3sdF50WmhQ4P/bVusXcqNE2S3XrNURwzQ== - dependencies: - "@tootallnate/once" "1" - agent-base "6" - debug "4" - get-uri "3" - http-proxy-agent "^4.0.1" - https-proxy-agent "5" - pac-resolver "^5.0.0" - raw-body "^2.2.0" - socks-proxy-agent "5" - -pac-resolver@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/pac-resolver/-/pac-resolver-5.0.0.tgz#1d717a127b3d7a9407a16d6e1b012b13b9ba8dc0" - integrity sha512-H+/A6KitiHNNW+bxBKREk2MCGSxljfqRX76NjummWEYIat7ldVXRU3dhRIE3iXZ0nvGBk6smv3nntxKkzRL8NA== - dependencies: - degenerator "^3.0.1" - ip "^1.1.5" - netmask "^2.0.1" - package-hash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/package-hash/-/package-hash-3.0.0.tgz#50183f2d36c9e3e528ea0a8605dff57ce976f88e" @@ -18296,6 +18315,11 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +pathval@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== + pbkdf2@^3.0.17, pbkdf2@^3.0.3: version "3.1.2" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" @@ -18977,25 +19001,6 @@ proxy-addr@~2.0.5: forwarded "0.2.0" ipaddr.js "1.9.1" -proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-5.0.0.tgz#d31405c10d6e8431fde96cba7a0c027ce01d633b" - integrity sha512-gkH7BkvLVkSfX9Dk27W6TyNOWWZWRilRfk1XxGNWOYJ2TuedAv1yFpCaU9QSBmBe716XOTNpYNOzhysyw8xn7g== - dependencies: - agent-base "^6.0.0" - debug "4" - http-proxy-agent "^4.0.0" - https-proxy-agent "^5.0.0" - lru-cache "^5.1.1" - pac-proxy-agent "^5.0.0" - proxy-from-env "^1.0.0" - socks-proxy-agent "^5.0.0" - -proxy-from-env@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" - integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== - prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" @@ -19223,7 +19228,7 @@ range-parser@^1.2.1, range-parser@~1.2.1: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.4.0, raw-body@^2.2.0: +raw-body@2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== @@ -19622,16 +19627,6 @@ read@1, read@~1.0.1, read@~1.0.7: string_decoder "~1.0.0" util-deprecate "~1.0.1" -readable-stream@1.1.x, readable-stream@~1.1.10: - version "1.1.14" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - "readable-stream@2 || 3", readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.0.6, readable-stream@^3.1.0, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" @@ -19654,6 +19649,16 @@ readable-stream@^2.0.1, readable-stream@^2.0.5, readable-stream@^2.3.3, readable string_decoder "~1.1.1" util-deprecate "~1.0.1" +readable-stream@~1.1.10: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + readdir-scoped-modules@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz#9fafa37d286be5d92cbaebdee030dc9b5f406747" @@ -19963,23 +19968,6 @@ replace-homedir@^1.0.0: is-absolute "^1.0.0" remove-trailing-separator "^1.1.0" -request-promise-core@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f" - integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw== - dependencies: - lodash "^4.17.19" - -request-promise@^4.2.5: - version "4.2.6" - resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.6.tgz#7e7e5b9578630e6f598e3813c0f8eb342a27f0a2" - integrity sha512-HCHI3DJJUakkOr8fNoCc73E5nU5bqITjOYFMDrKHYOXWXrgD/SBaC7LjwuPymUprRyuF06UK7hd/lMHkmUXglQ== - dependencies: - bluebird "^3.5.0" - request-promise-core "1.1.4" - stealthy-require "^1.1.1" - tough-cookie "^2.3.3" - request@2, request@^2.74.0, request@~2.81.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" @@ -20571,6 +20559,15 @@ selenium-standalone@^8.0.4: which "^2.0.2" yauzl "^2.10.0" +selenium-webdriver@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.3.1.tgz#5e9c6c4adee65e57776b5bd4c07c59b65b8f056d" + integrity sha512-TjH/ls1WKRQoFEHcqtn6UtwcLnA3yvx08v9cSSFYvyhp8hJWRtbe9ae2I8uXPisEZ2EaGKKoxBZ4EHv0BJM15g== + dependencies: + jszip "^3.10.0" + tmp "^0.2.1" + ws ">=8.7.0" + selenium@^2.20.0: version "2.20.0" resolved "https://registry.yarnpkg.com/selenium/-/selenium-2.20.0.tgz#f515b1a162de93c2ccef2fc0ca33f3b5543e38c8" @@ -20626,7 +20623,7 @@ semver@7.3.4: dependencies: lru-cache "^6.0.0" -semver@7.x, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: +semver@7.3.5, semver@7.x, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: version "7.3.5" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== @@ -20678,6 +20675,13 @@ serialize-javascript@5.0.1, serialize-javascript@^5.0.1: dependencies: randombytes "^2.1.0" +serialize-javascript@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + serialize-javascript@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" @@ -21007,15 +21011,6 @@ sockjs@^0.3.21: uuid "^3.4.0" websocket-driver "^0.7.4" -socks-proxy-agent@5, socks-proxy-agent@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz#032fb583048a29ebffec2e6a73fca0761f48177e" - integrity sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ== - dependencies: - agent-base "^6.0.2" - debug "4" - socks "^2.3.3" - socks-proxy-agent@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz#3c8991f3145b2799e70e11bd5fbc8b1963116386" @@ -21033,7 +21028,7 @@ socks-proxy-agent@^6.0.0: debug "^4.3.1" socks "^2.6.1" -socks@^2.3.3, socks@^2.6.1: +socks@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/socks/-/socks-2.6.1.tgz#989e6534a07cf337deb1b1c94aaa44296520d30e" integrity sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA== @@ -21347,6 +21342,13 @@ stackframe@^1.1.1: resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.2.0.tgz#52429492d63c62eb989804c11552e3d22e779303" integrity sha512-GrdeshiRmS1YLMYgzF16olf2jJ/IzxXY9lhKOskuVziubpTYcYqyOwYeJKzQkwy7uN0fYSsbsC4RQaXf9LCrYA== +stacktrace-parser@^0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" + integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== + dependencies: + type-fest "^0.7.1" + state-local@^1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/state-local/-/state-local-1.0.7.tgz#da50211d07f05748d53009bee46307a37db386d5" @@ -21365,11 +21367,6 @@ static-extend@^0.1.1, static-extend@^0.1.2: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= -stealthy-require@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" - integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= - stream-browserify@^2.0.0, stream-browserify@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" @@ -21587,6 +21584,13 @@ stringstream@~0.0.4: resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" integrity sha1-TkhM1N5aC7vuGORjB3EKioFiGHg= +strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^3.0.0, strip-ansi@^3.0.1, strip-ansi@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -21608,13 +21612,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -21668,16 +21665,16 @@ strip-indent@^3.0.0: dependencies: min-indent "^1.0.0" -strip-json-comments@2.0.1, strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - strip-json-comments@3.1.1, strip-json-comments@^3.0.1, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + strong-log-transformer@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz#0f5ed78d325e0421ac6f90f7f10e691d6ae3ae10" @@ -21750,13 +21747,6 @@ subarg@^1.0.0: dependencies: minimist "^1.1.0" -supports-color@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" - integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== - dependencies: - has-flag "^3.0.0" - supports-color@8.1.1, supports-color@^8.0.0: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" @@ -22262,7 +22252,7 @@ tmp@0.0.33, tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" -tmp@~0.2.1: +tmp@^0.2.1, tmp@~0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== @@ -22358,14 +22348,6 @@ touch@^3.1.0: dependencies: nopt "~1.0.10" -tough-cookie@^2.3.3, tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - tough-cookie@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.0.0.tgz#d822234eeca882f991f0f908824ad2622ddbece4" @@ -22382,6 +22364,14 @@ tough-cookie@~2.3.0: dependencies: punycode "^1.4.1" +tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + tr46@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" @@ -22539,7 +22529,7 @@ tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.3.0: +tslib@^2.0.0, tslib@^2.0.3, tslib@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== @@ -22606,12 +22596,7 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-detect@0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822" - integrity sha1-C6XsKohWQORw6k6FBZcZANrFiCI= - -type-detect@4.0.8: +type-detect@4.0.8, type-detect@^4.0.0: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== @@ -22641,6 +22626,11 @@ type-fest@^0.6.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== +type-fest@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" + integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== + type-fest@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" @@ -23331,11 +23321,6 @@ vm-browserify@^1.0.0, vm-browserify@^1.0.1: resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== -vm2@^3.9.3: - version "3.9.5" - resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.5.tgz#5288044860b4bbace443101fcd3bddb2a0aa2496" - integrity sha512-LuCAHZN75H9tdrAiLFf030oW7nJV5xwNMuk1ymOZwopmuK3d2H4L1Kv4+GFHgarKiLfXXLFU+7LDABHnwOkWng== - void-elements@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" @@ -23917,13 +23902,6 @@ which@1, which@^1.2.8, which@~1.2.14: dependencies: isexe "^2.0.0" -which@1.3.1, which@^1.0.5, which@^1.2.14, which@^1.2.9, which@^1.3.0, which@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - which@2.0.2, which@^2.0.1, which@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" @@ -23931,6 +23909,13 @@ which@2.0.2, which@^2.0.1, which@^2.0.2: dependencies: isexe "^2.0.0" +which@^1.0.5, which@^1.2.14, which@^1.2.9, which@^1.3.0, which@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + wide-align@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" @@ -24048,6 +24033,11 @@ workerpool@6.1.0: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.0.tgz#a8e038b4c94569596852de7a8ea4228eefdeb37b" integrity sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg== +workerpool@6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" + integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== + wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -24160,6 +24150,11 @@ ws@7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +ws@>=8.7.0: + version "8.8.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.8.1.tgz#5dbad0feb7ade8ecc99b830c1d77c913d4955ff0" + integrity sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA== + ws@^1.1.1: version "1.1.5" resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.5.tgz#cbd9e6e75e09fc5d2c90015f21f0c40875e0dd51" @@ -24271,11 +24266,6 @@ xmlhttprequest@^1.8.0: resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" integrity sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw= -xregexp@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" - integrity sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM= - xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" @@ -24326,14 +24316,6 @@ yaml@^1.10.0, yaml@^1.10.2, yaml@^1.7.2: resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== -yargs-parser@13.1.2, yargs-parser@^13.1.0, yargs-parser@^13.1.2: - version "13.1.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" - integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@20.0.0, yargs-parser@20.x: version "20.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.0.0.tgz#c65a1daaa977ad63cebdd52159147b789a4e19a9" @@ -24352,6 +24334,14 @@ yargs-parser@^11.1.1: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^13.1.0, yargs-parser@^13.1.2: + version "13.1.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" + integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs-parser@^15.0.1: version "15.0.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-15.0.3.tgz#316e263d5febe8b38eef61ac092b33dfcc9b1115" @@ -24388,15 +24378,6 @@ yargs-parser@^8.0.0: dependencies: camelcase "^4.1.0" -yargs-unparser@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" - integrity sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== - dependencies: - flat "^4.1.0" - lodash "^4.17.15" - yargs "^13.3.0" - yargs-unparser@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" @@ -24424,22 +24405,6 @@ yargs@13.2.4: y18n "^4.0.0" yargs-parser "^13.1.0" -yargs@13.3.2, yargs@^13.3.0, yargs@^13.3.2: - version "13.3.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" - integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.2" - yargs@15.4.1: version "15.4.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" @@ -24506,6 +24471,22 @@ yargs@^12.0.0, yargs@^12.0.5: y18n "^3.2.1 || ^4.0.0" yargs-parser "^11.1.1" +yargs@^13.3.2: + version "13.3.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" + integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== + dependencies: + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.2" + yargs@^14.2.2: version "14.2.3" resolved "https://registry.yarnpkg.com/yargs/-/yargs-14.2.3.tgz#1a1c3edced1afb2a2fea33604bc6d1d8d688a414" From 160005a3bc09d3090d3de78cd91f14fccebcea18 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 14:57:25 +0200 Subject: [PATCH 104/179] change test script --- apps/remix-ide/ci/browser_test.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/apps/remix-ide/ci/browser_test.sh b/apps/remix-ide/ci/browser_test.sh index 6fd2d274df..f621c18f8a 100755 --- a/apps/remix-ide/ci/browser_test.sh +++ b/apps/remix-ide/ci/browser_test.sh @@ -14,15 +14,7 @@ yarn run remixd & sleep 5 yarn run build:e2e -grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort -echo ------- -grep -IRiL "\'\@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort -echo ------- -grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort -echo ------- -grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort | circleci tests split -cat dist/apps/remix-ide-e2e/src/tests/runAndDeploy.test.js -TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort | circleci tests split ) +TESTFILES=$(grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | sort | circleci tests split ) for TESTFILE in $TESTFILES; do npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=$1 || TEST_EXITCODE=1 done From 4c2a090fa7aad2be8b3ca61da2fc599a2c4cac2e Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 15:11:37 +0200 Subject: [PATCH 105/179] flaky test --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/workspace.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bccbf0146a..213f7ce53d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: false + default: flaky orbs: browser-tools: circleci/browser-tools@1.3.0 jobs: diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 7aac831055..17b03d1d50 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -159,7 +159,7 @@ module.exports = { .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/SampleERC20_test.sol"]') }, - 'Should create ERC721 workspace with files #group1': function (browser: NightwatchBrowser) { + 'Should create ERC721 workspace with files #group1 #flaky': function (browser: NightwatchBrowser) { browser .click('*[data-id="workspaceCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') From d16854a9e6085f688c77a5fbca2ddc448314995a Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 20 Jul 2022 15:12:11 +0200 Subject: [PATCH 106/179] Delete publish.sh --- publish.sh | 1 - 1 file changed, 1 deletion(-) delete mode 100644 publish.sh diff --git a/publish.sh b/publish.sh deleted file mode 100644 index f47b6ae632..0000000000 --- a/publish.sh +++ /dev/null @@ -1 +0,0 @@ -node apps/remix-ide/ci/publishIpfs 2AtD42kl9FC1IOgEBWdPTq2cizT c07a85881fb6124579693a888181e85a \ No newline at end of file From f6e6024257b340ab3c63641391256c7c10549565 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 15:19:14 +0200 Subject: [PATCH 107/179] flaky set --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 213f7ce53d..4106354766 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: flaky + default: true orbs: browser-tools: circleci/browser-tools@1.3.0 jobs: From 210e37db1e35655e2f8b4caab5ea91bf0f961314 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 15:29:59 +0200 Subject: [PATCH 108/179] add pause --- apps/remix-ide-e2e/src/commands/switchWorkspace.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide-e2e/src/commands/switchWorkspace.ts b/apps/remix-ide-e2e/src/commands/switchWorkspace.ts index 6219ddd218..86922de9bd 100644 --- a/apps/remix-ide-e2e/src/commands/switchWorkspace.ts +++ b/apps/remix-ide-e2e/src/commands/switchWorkspace.ts @@ -6,6 +6,7 @@ class switchWorkspace extends EventEmitter { this.api.waitForElementVisible('[data-id="workspacesSelect"]') .click('[data-id="workspacesSelect"]') .waitForElementVisible(`[data-id="dropdown-item-${workspaceName}"]`) + .pause(2000) .click(`[data-id="dropdown-item-${workspaceName}"]`) .perform((done) => { done() From 48bfc8b4924c8f6727b82f8cc9164896c7abc196 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 15:44:22 +0200 Subject: [PATCH 109/179] add pause --- apps/remix-ide-e2e/src/tests/workspace.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 17b03d1d50..dd6be3893b 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -129,7 +129,7 @@ module.exports = { .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') // check js and ts files are not transformed .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') - + .pause(5000) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1, 'Incorrect content') From d93feef7d0d35c1f945cd93f8c42a655c668cb09 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 15:50:43 +0200 Subject: [PATCH 110/179] mv done --- apps/remix-ide-e2e/src/commands/getEditorValue.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/getEditorValue.ts b/apps/remix-ide-e2e/src/commands/getEditorValue.ts index 0c00a0450d..fb6c78e31e 100644 --- a/apps/remix-ide-e2e/src/commands/getEditorValue.ts +++ b/apps/remix-ide-e2e/src/commands/getEditorValue.ts @@ -9,11 +9,10 @@ class GetEditorValue extends EventEmitter { return elem.currentContent() }, [], (result) => { - done() const value = typeof result.value === 'string' ? result.value : null - callback(value) this.emit('complete') + done() }) }) return this From 165734e086050a434c1abf1764344a5198d295bc Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 16:05:12 +0200 Subject: [PATCH 111/179] try create --- .../remix-ide-e2e/src/tests/workspace.test.ts | 202 +++++++++--------- 1 file changed, 98 insertions(+), 104 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index dd6be3893b..f5e6aa73f5 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -52,31 +52,31 @@ module.exports = { .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') // check js and ts files are not transformed .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') - + .getEditorValue((content) => { browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1, - 'Incorrect content') + 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .pause(100) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1, - 'Incorrect content') + 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .pause(2000) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, from?: string, gas?: number): Promise => {`) !== -1, - 'Incorrect content') + 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .pause(100) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => {`) !== -1, - 'Incorrect content') + 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests"]') .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/storage.test.js"]') @@ -84,7 +84,7 @@ module.exports = { .pause(100) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`const { expect } = require("chai");`) !== -1, - 'Incorrect content') + 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/Ballot_test.sol"]') .assert.elementPresent('*[data-id="treeViewLitreeViewItemREADME.txt"]') @@ -106,8 +106,8 @@ module.exports = { .execute(function () { const fileList = document.querySelector('*[data-id="treeViewUltreeViewMenu"]') return fileList.getElementsByTagName('li').length; - }, [], function(result){ - browser.assert.equal(result.value, 0, 'Incorrect number of files'); + }, [], function (result) { + browser.assert.equal(result.value, 0, 'Incorrect number of files'); }); }, @@ -132,28 +132,28 @@ module.exports = { .pause(5000) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1, - 'Incorrect content') + 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .pause(100) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1, - 'Incorrect content') + 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .pause(100) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, from?: string, gas?: number): Promise => {`) !== -1, - 'Incorrect content') + 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .pause(100) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => {`) !== -1, - 'Incorrect content') + 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests"]') .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/SampleERC20_test.sol"]') @@ -177,31 +177,31 @@ module.exports = { .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') // check js and ts files are not transformed .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') - + .getEditorValue((content) => { browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1, - 'Incorrect content') + 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .pause(100) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1, - 'Incorrect content') + 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .pause(100) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, from?: string, gas?: number): Promise => {`) !== -1, - 'Incorrect content') + 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .pause(100) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => {`) !== -1, - 'Incorrect content') + 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests"]') .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/SampleERC721_test.sol"]') @@ -211,26 +211,20 @@ module.exports = { 'Should create two workspace and switch to the first one #group1': function (browser: NightwatchBrowser) { browser - .click('*[data-id="workspaceCreate"]') // create workspace_name + .click('*[data-id="workspaceCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') - .waitForElementVisible('[data-id="fileSystemModalDialogModalFooter-react"] > button') - .click('*[data-id="modalDialogCustomPromptTextCreate"]') - .clearValue('*[data-id="modalDialogCustomPromptTextCreate"]') - .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_name') + .click('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]') + .setValue('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_name') .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .pause(1000) .addFile('test.sol', { content: 'test' }) .waitForElementVisible('*[data-id="treeViewLitreeViewItemtest.sol"]') - .click('*[data-id="workspaceCreate"]') // create workspace_name_1 + .click('*[data-id="workspaceCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') - .waitForElementVisible('[data-id="fileSystemModalDialogModalFooter-react"] > button') - .click('*[data-id="modalDialogCustomPromptTextCreate"]') - .clearValue('*[data-id="modalDialogCustomPromptTextCreate"]') - .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_name_1') - .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') - .click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') + .click('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]') + .setValue('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_name_1') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .pause(2000) .waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]') @@ -268,85 +262,85 @@ module.exports = { .waitForElementNotPresent(`[data-id="dropdown-item-workspace_name_1"]`) }, - // CLONE REPOSITORY E2E START + // CLONE REPOSITORY E2E START + + 'Should clone a repository #group2': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('filePanel') + .waitForElementVisible('[data-id="cloneGitRepository"]') + .click('[data-id="cloneGitRepository"]') + .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') + .click('[data-id="fileSystemModalDialogModalBody-react"]') + .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') + .setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix') + .click('[data-id="fileSystem-modal-footer-ok-react"]') + .waitForElementPresent('.fa-spinner') + .pause(5000) + .waitForElementNotPresent('.fa-spinner') + .waitForElementVisible('*[data-id="treeViewLitreeViewItem.git"]') + .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix') + }, - 'Should clone a repository #group2': function (browser: NightwatchBrowser) { - browser - .clickLaunchIcon('filePanel') - .waitForElementVisible('[data-id="cloneGitRepository"]') - .click('[data-id="cloneGitRepository"]') - .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') - .click('[data-id="fileSystemModalDialogModalBody-react"]') - .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') - .setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix') - .click('[data-id="fileSystem-modal-footer-ok-react"]') - .waitForElementPresent('.fa-spinner') - .pause(5000) - .waitForElementNotPresent('.fa-spinner') - .waitForElementVisible('*[data-id="treeViewLitreeViewItem.git"]') - .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix') - }, + 'Should display dgit icon for cloned workspace #group2': function (browser: NightwatchBrowser) { + browser + .switchWorkspace('default_workspace') + .waitForElementNotVisible('[data-id="workspacesSelect"] .fa-code-branch') + .switchWorkspace('awesome-remix') + .waitForElementVisible('[data-id="workspacesSelect"] .fa-code-branch') + }, - 'Should display dgit icon for cloned workspace #group2': function (browser: NightwatchBrowser) { - browser - .switchWorkspace('default_workspace') - .waitForElementNotVisible('[data-id="workspacesSelect"] .fa-code-branch') - .switchWorkspace('awesome-remix') - .waitForElementVisible('[data-id="workspacesSelect"] .fa-code-branch') - }, - - 'Should display non-clashing names for duplicate clone #group2': '' + function (browser: NightwatchBrowser) { - browser - .waitForElementVisible('[data-id="cloneGitRepository"]') - .click('[data-id="cloneGitRepository"]') - .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') - .click('[data-id="fileSystemModalDialogModalBody-react"]') - .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') - .setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix') - .click('[data-id="fileSystem-modal-footer-ok-react"]') - .pause(5000) - .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix1') - .waitForElementVisible('[data-id="cloneGitRepository"]') - .click('[data-id="cloneGitRepository"]') - .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') - .click('[data-id="fileSystemModalDialogModalBody-react"]') - .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') - .setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix') - .click('[data-id="fileSystem-modal-footer-ok-react"]') - .pause(5000) - .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix2') - .waitForElementVisible('[data-id="cloneGitRepository"]') - .click('[data-id="cloneGitRepository"]') - .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') - .click('[data-id="fileSystemModalDialogModalBody-react"]') - .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') - .setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix') - .click('[data-id="fileSystem-modal-footer-ok-react"]') - .pause(5000) - .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix3') - .switchWorkspace('awesome-remix') - .switchWorkspace('awesome-remix1') - .switchWorkspace('awesome-remix2') - .switchWorkspace('awesome-remix3') - }, + 'Should display non-clashing names for duplicate clone #group2': '' + function (browser: NightwatchBrowser) { + browser + .waitForElementVisible('[data-id="cloneGitRepository"]') + .click('[data-id="cloneGitRepository"]') + .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') + .click('[data-id="fileSystemModalDialogModalBody-react"]') + .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') + .setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix') + .click('[data-id="fileSystem-modal-footer-ok-react"]') + .pause(5000) + .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix1') + .waitForElementVisible('[data-id="cloneGitRepository"]') + .click('[data-id="cloneGitRepository"]') + .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') + .click('[data-id="fileSystemModalDialogModalBody-react"]') + .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') + .setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix') + .click('[data-id="fileSystem-modal-footer-ok-react"]') + .pause(5000) + .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix2') + .waitForElementVisible('[data-id="cloneGitRepository"]') + .click('[data-id="cloneGitRepository"]') + .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') + .click('[data-id="fileSystemModalDialogModalBody-react"]') + .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') + .setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix') + .click('[data-id="fileSystem-modal-footer-ok-react"]') + .pause(5000) + .waitForElementContainsText('[data-id="workspacesSelect"]', 'awesome-remix3') + .switchWorkspace('awesome-remix') + .switchWorkspace('awesome-remix1') + .switchWorkspace('awesome-remix2') + .switchWorkspace('awesome-remix3') + }, - 'Should display error message in modal for failed clone #group2': function (browser: NightwatchBrowser) { - browser - .waitForElementVisible('[data-id="cloneGitRepository"]') - .click('[data-id="cloneGitRepository"]') - .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') - .click('[data-id="fileSystemModalDialogModalBody-react"]') - .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') - .setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/non-existent-repo') - .click('[data-id="fileSystem-modal-footer-ok-react"]') - .pause(5000) - .waitForElementVisible('[data-id="cloneGitRepositoryModalDialogModalBody-react"]') - .waitForElementContainsText('[data-id="cloneGitRepositoryModalDialogModalBody-react"]', 'An error occurred: Please check that you have the correct URL for the repo. If the repo is private, you need to add your github credentials (with the valid token permissions) in Settings plugin') - .click('[data-id="cloneGitRepository-modal-footer-ok-react"]') - .end() - }, + 'Should display error message in modal for failed clone #group2': function (browser: NightwatchBrowser) { + browser + .waitForElementVisible('[data-id="cloneGitRepository"]') + .click('[data-id="cloneGitRepository"]') + .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') + .click('[data-id="fileSystemModalDialogModalBody-react"]') + .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') + .setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/non-existent-repo') + .click('[data-id="fileSystem-modal-footer-ok-react"]') + .pause(5000) + .waitForElementVisible('[data-id="cloneGitRepositoryModalDialogModalBody-react"]') + .waitForElementContainsText('[data-id="cloneGitRepositoryModalDialogModalBody-react"]', 'An error occurred: Please check that you have the correct URL for the repo. If the repo is private, you need to add your github credentials (with the valid token permissions) in Settings plugin') + .click('[data-id="cloneGitRepository-modal-footer-ok-react"]') + .end() + }, - // CLONE REPOSITORY E2E END + // CLONE REPOSITORY E2E END tearDown: sauce } From ce7b7519007928730e7c1047d3425855464bee32 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 16:10:49 +0200 Subject: [PATCH 112/179] pause --- apps/remix-ide-e2e/src/tests/workspace.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index f5e6aa73f5..78c583f6ab 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -225,6 +225,9 @@ module.exports = { .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .click('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]') .setValue('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_name_1') + .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') + .click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') + .pause(500) .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .pause(2000) .waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]') From 7e1f4914e08f2cae95a0096caa628b5dcdd57f00 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 20 Jul 2022 16:12:08 +0200 Subject: [PATCH 113/179] pause more --- apps/remix-ide-e2e/src/tests/workspace.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 78c583f6ab..13e7c6b238 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -227,7 +227,7 @@ module.exports = { .setValue('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_name_1') .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') - .pause(500) + .pause(2000) .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') .pause(2000) .waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]') From 2e15299f9fae4fb2b7f4a7c6c82b193fd7d6264c Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 21 Jul 2022 10:40:51 +0200 Subject: [PATCH 114/179] set flaky --- apps/remix-ide-e2e/src/tests/workspace.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 13e7c6b238..86dcd9b43a 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -209,7 +209,7 @@ module.exports = { // WORKSPACE TEMPLATES E2E END - 'Should create two workspace and switch to the first one #group1': function (browser: NightwatchBrowser) { + 'Should create two workspace and switch to the first one #group1 #flaky': function (browser: NightwatchBrowser) { browser .click('*[data-id="workspaceCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') @@ -234,6 +234,7 @@ module.exports = { .pause(2000) .switchWorkspace('workspace_name') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') + .currentWorkspaceIs('workspace_name') }, 'Should rename a workspace #group1': function (browser: NightwatchBrowser) { @@ -248,9 +249,11 @@ module.exports = { .click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .switchWorkspace('workspace_name_1') .pause(2000) + .currentWorkspaceIs('workspace_name_1') .waitForElementNotPresent('*[data-id="treeViewLitreeViewItemtest.sol"]') .switchWorkspace('workspace_name_renamed') .pause(2000) + .currentWorkspaceIs('workspace_name_renamed') .waitForElementVisible('*[data-id="treeViewLitreeViewItemtest.sol"]') }, From dbab51174e62b4432454a18940fa4d189251bca6 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 21 Jul 2022 10:58:56 +0200 Subject: [PATCH 115/179] screenshorts --- apps/remix-ide-e2e/src/commands/switchWorkspace.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/remix-ide-e2e/src/commands/switchWorkspace.ts b/apps/remix-ide-e2e/src/commands/switchWorkspace.ts index 86922de9bd..14bce554d3 100644 --- a/apps/remix-ide-e2e/src/commands/switchWorkspace.ts +++ b/apps/remix-ide-e2e/src/commands/switchWorkspace.ts @@ -3,11 +3,15 @@ import EventEmitter from 'events' class switchWorkspace extends EventEmitter { command (this: NightwatchBrowser, workspaceName: string): NightwatchBrowser { + const timestamp = new Date().getTime() this.api.waitForElementVisible('[data-id="workspacesSelect"]') .click('[data-id="workspacesSelect"]') + .saveScreenshot(`./reports/screenshots/workspace_group1.test/1_switchWorkspace${timestamp}.png`) .waitForElementVisible(`[data-id="dropdown-item-${workspaceName}"]`) .pause(2000) .click(`[data-id="dropdown-item-${workspaceName}"]`) + .pause(3000) + .saveScreenshot(`./reports/screenshots/workspace_group1.test/2_afterSwitchWorkspace${timestamp}.png`) .perform((done) => { done() this.emit('complete') From 1aed77f79ed8adb607dfc72a3485fa12b7537c2f Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 12:51:19 +0200 Subject: [PATCH 116/179] rm screens --- apps/remix-ide-e2e/src/commands/switchWorkspace.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/switchWorkspace.ts b/apps/remix-ide-e2e/src/commands/switchWorkspace.ts index 14bce554d3..5fbcba6b04 100644 --- a/apps/remix-ide-e2e/src/commands/switchWorkspace.ts +++ b/apps/remix-ide-e2e/src/commands/switchWorkspace.ts @@ -6,12 +6,12 @@ class switchWorkspace extends EventEmitter { const timestamp = new Date().getTime() this.api.waitForElementVisible('[data-id="workspacesSelect"]') .click('[data-id="workspacesSelect"]') - .saveScreenshot(`./reports/screenshots/workspace_group1.test/1_switchWorkspace${timestamp}.png`) + //.saveScreenshot(`./reports/screenshots/workspace_group1.test/1_switchWorkspace${timestamp}.png`) .waitForElementVisible(`[data-id="dropdown-item-${workspaceName}"]`) .pause(2000) .click(`[data-id="dropdown-item-${workspaceName}"]`) .pause(3000) - .saveScreenshot(`./reports/screenshots/workspace_group1.test/2_afterSwitchWorkspace${timestamp}.png`) + //.saveScreenshot(`./reports/screenshots/workspace_group1.test/2_afterSwitchWorkspace${timestamp}.png`) .perform((done) => { done() this.emit('complete') From 8ffe88fee4c220e077ccfaaabfdd0b96130eb5cc Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 12:59:50 +0200 Subject: [PATCH 117/179] do no use assert --- .../remix-ide-e2e/src/tests/workspace.test.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 86dcd9b43a..fba2d8c3f4 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -123,10 +123,10 @@ module.exports = { .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .pause(100) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/SampleERC20.sol"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/SampleERC20.sol"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') // check js and ts files are not transformed .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') .pause(5000) @@ -134,29 +134,29 @@ module.exports = { browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1, 'Incorrect content') }) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') - .pause(100) + .pause(4000) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1, 'Incorrect content') }) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .pause(100) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, from?: string, gas?: number): Promise => {`) !== -1, 'Incorrect content') }) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .pause(100) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => {`) !== -1, 'Incorrect content') }) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/SampleERC20_test.sol"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests/SampleERC20_test.sol"]') }, 'Should create ERC721 workspace with files #group1 #flaky': function (browser: NightwatchBrowser) { From 2a9843957fd1f8d1c3a823507d4b1790874f6390 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 13:10:11 +0200 Subject: [PATCH 118/179] log the content --- apps/remix-ide-e2e/src/select_tests.sh | 7 ++++++- apps/remix-ide-e2e/src/tests/workspace.test.ts | 12 ++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide-e2e/src/select_tests.sh b/apps/remix-ide-e2e/src/select_tests.sh index ee1c4e38be..ae6a7aeb60 100644 --- a/apps/remix-ide-e2e/src/select_tests.sh +++ b/apps/remix-ide-e2e/src/select_tests.sh @@ -3,7 +3,7 @@ # Bash Menu Script Example PS3='Select a browser: ' -BROWSERS=( "chrome" "firefox" "exit" ) +BROWSERS=( "chrome" "chrome headless" "firefox" "exit" ) select opt in "${BROWSERS[@]}" do case $opt in @@ -12,6 +12,11 @@ do BROWSER="chromeDesktop" break ;; + "chrome headless") + echo "Chrome headless selected" + BROWSER="chrome" + break + ;; "firefox") echo "Firefox selected" BROWSER="firefoxDesktop" diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index fba2d8c3f4..b3d97a1982 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -177,29 +177,33 @@ module.exports = { .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') // check js and ts files are not transformed .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') - + .pause(4000) .getEditorValue((content) => { + console.log(content) browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1, 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') - .pause(100) + .pause(4000) .getEditorValue((content) => { + console.log(content) browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1, 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') - .pause(100) + .pause(4000) .getEditorValue((content) => { + console.log(content) browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, from?: string, gas?: number): Promise => {`) !== -1, 'Incorrect content') }) .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') - .pause(100) + .pause(4000) .getEditorValue((content) => { + console.log(content) browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => {`) !== -1, 'Incorrect content') }) From 7d074f79eb19b60dc22d5841ab68a189b7b5a816 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 13:11:39 +0200 Subject: [PATCH 119/179] log content --- .../remix-ide-e2e/src/tests/workspace.test.ts | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index b3d97a1982..17cf74e572 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -131,6 +131,7 @@ module.exports = { .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') .pause(5000) .getEditorValue((content) => { + console.log(content) browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1, 'Incorrect content') }) @@ -138,20 +139,23 @@ module.exports = { .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .pause(4000) .getEditorValue((content) => { + console.log(content) browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1, 'Incorrect content') }) .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') - .pause(100) + .pause(4000) .getEditorValue((content) => { + console.log(content) browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, from?: string, gas?: number): Promise => {`) !== -1, 'Incorrect content') }) .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') - .pause(100) + .pause(4000) .getEditorValue((content) => { + console.log(content) browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => {`) !== -1, 'Incorrect content') }) @@ -171,10 +175,10 @@ module.exports = { .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .pause(100) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/SampleERC721.sol"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/SampleERC721.sol"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') // check js and ts files are not transformed .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') .pause(4000) @@ -183,7 +187,7 @@ module.exports = { browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1, 'Incorrect content') }) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .pause(4000) .getEditorValue((content) => { @@ -191,7 +195,7 @@ module.exports = { browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1, 'Incorrect content') }) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .pause(4000) .getEditorValue((content) => { @@ -199,7 +203,7 @@ module.exports = { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, from?: string, gas?: number): Promise => {`) !== -1, 'Incorrect content') }) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .pause(4000) .getEditorValue((content) => { @@ -207,8 +211,8 @@ module.exports = { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => {`) !== -1, 'Incorrect content') }) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/SampleERC721_test.sol"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests/SampleERC721_test.sol"]') }, // WORKSPACE TEMPLATES E2E END From c7e5a68ff95b494c3666adbedb242fdd39ed9ca0 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 13:17:59 +0200 Subject: [PATCH 120/179] rm consoles --- .../remix-ide-e2e/src/tests/workspace.test.ts | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 17cf74e572..89dd2b3a67 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -130,32 +130,28 @@ module.exports = { // check js and ts files are not transformed .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') .pause(5000) - .getEditorValue((content) => { - console.log(content) + .getEditorValue((content) => { browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1, 'Incorrect content') }) .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .pause(4000) - .getEditorValue((content) => { - console.log(content) + .getEditorValue((content) => { browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1, 'Incorrect content') }) .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .pause(4000) - .getEditorValue((content) => { - console.log(content) + .getEditorValue((content) => { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, from?: string, gas?: number): Promise => {`) !== -1, 'Incorrect content') }) .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .pause(4000) - .getEditorValue((content) => { - console.log(content) + .getEditorValue((content) => { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => {`) !== -1, 'Incorrect content') }) @@ -182,32 +178,28 @@ module.exports = { // check js and ts files are not transformed .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') .pause(4000) - .getEditorValue((content) => { - console.log(content) + .getEditorValue((content) => { browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1, 'Incorrect content') }) .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .pause(4000) - .getEditorValue((content) => { - console.log(content) + .getEditorValue((content) => { browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1, 'Incorrect content') }) .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .pause(4000) - .getEditorValue((content) => { - console.log(content) + .getEditorValue((content) => { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, from?: string, gas?: number): Promise => {`) !== -1, 'Incorrect content') }) .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .pause(4000) - .getEditorValue((content) => { - console.log(content) + .getEditorValue((content) => { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => {`) !== -1, 'Incorrect content') }) From 6cb6e3f18dd9eefb1fe550ddddaf5edaf1c51d14 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 13:26:19 +0200 Subject: [PATCH 121/179] rm asserts --- .../remix-ide-e2e/src/tests/workspace.test.ts | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 89dd2b3a67..057f4e253d 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -44,12 +44,12 @@ module.exports = { .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .pause(1000) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') // check js and ts files are not transformed .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]') @@ -57,37 +57,37 @@ module.exports = { browser.assert.ok(content.indexOf(`import { deploy } from './web3-lib'`) !== -1, 'Incorrect content') }) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/deploy_with_ethers.ts"]') .pause(100) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`import { deploy } from './ethers-lib'`) !== -1, 'Incorrect content') }) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/web3-lib.ts"]') .pause(2000) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, from?: string, gas?: number): Promise => {`) !== -1, 'Incorrect content') }) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .click('*[data-id="treeViewLitreeViewItemscripts/ethers-lib.ts"]') .pause(100) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`export const deploy = async (contractName: string, args: Array, accountIndex?: number): Promise => {`) !== -1, 'Incorrect content') }) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/storage.test.js"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests/storage.test.js"]') .click('*[data-id="treeViewLitreeViewItemtests/storage.test.js"]') .pause(100) .getEditorValue((content) => { browser.assert.ok(content.indexOf(`const { expect } = require("chai");`) !== -1, 'Incorrect content') }) - .assert.elementPresent('*[data-id="treeViewLitreeViewItemtests/Ballot_test.sol"]') - .assert.elementPresent('*[data-id="treeViewLitreeViewItemREADME.txt"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests/Ballot_test.sol"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemREADME.txt"]') }, 'Should create blank workspace with no files #group1': function (browser: NightwatchBrowser) { @@ -102,7 +102,7 @@ module.exports = { .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .pause(100) - .assert.elementPresent('*[data-id="treeViewUltreeViewMenu"]') + .waitForElementVisible('*[data-id="treeViewUltreeViewMenu"]') .execute(function () { const fileList = document.querySelector('*[data-id="treeViewUltreeViewMenu"]') return fileList.getElementsByTagName('li').length; From a93d7c98d50f8b38e7cc90e1be48f2aee94ec5df Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 14:23:45 +0200 Subject: [PATCH 122/179] treeViewUltreeViewMenu --- apps/remix-ide-e2e/src/tests/workspace.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 057f4e253d..3e6a591324 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -102,7 +102,7 @@ module.exports = { .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) .pause(100) - .waitForElementVisible('*[data-id="treeViewUltreeViewMenu"]') + .waitForElementPresent('*[data-id="treeViewUltreeViewMenu"]') .execute(function () { const fileList = document.querySelector('*[data-id="treeViewUltreeViewMenu"]') return fileList.getElementsByTagName('li').length; From a5c3324de7334b252a687c9216077b9bfc9c897c Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 14:32:16 +0200 Subject: [PATCH 123/179] turn off flaky --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/workspace.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4106354766..bccbf0146a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: true + default: false orbs: browser-tools: circleci/browser-tools@1.3.0 jobs: diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 3e6a591324..3e15a18248 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -159,7 +159,7 @@ module.exports = { .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests/SampleERC20_test.sol"]') }, - 'Should create ERC721 workspace with files #group1 #flaky': function (browser: NightwatchBrowser) { + 'Should create ERC721 workspace with files #group1': function (browser: NightwatchBrowser) { browser .click('*[data-id="workspaceCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') @@ -209,7 +209,7 @@ module.exports = { // WORKSPACE TEMPLATES E2E END - 'Should create two workspace and switch to the first one #group1 #flaky': function (browser: NightwatchBrowser) { + 'Should create two workspace and switch to the first one #group1': function (browser: NightwatchBrowser) { browser .click('*[data-id="workspaceCreate"]') .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') From 51135ada0352655eb4640772f5cba1590efdeb53 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 14:33:34 +0200 Subject: [PATCH 124/179] rm console --- apps/remix-ide-e2e/src/commands/openFile.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/commands/openFile.ts b/apps/remix-ide-e2e/src/commands/openFile.ts index 8a40c200d5..7f7e7b2026 100644 --- a/apps/remix-ide-e2e/src/commands/openFile.ts +++ b/apps/remix-ide-e2e/src/commands/openFile.ts @@ -5,7 +5,6 @@ class OpenFile extends EventEmitter { command (this: NightwatchBrowser, name: string) { this.api.perform((done) => { openFile(this.api, name, () => { - console.log('doing done') done() this.emit('complete') }) From 516f42b93633828bb036a36fb5b594221b893157 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 14:34:12 +0200 Subject: [PATCH 125/179] rm screens --- apps/remix-ide-e2e/src/commands/switchWorkspace.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/switchWorkspace.ts b/apps/remix-ide-e2e/src/commands/switchWorkspace.ts index 5fbcba6b04..34083e9385 100644 --- a/apps/remix-ide-e2e/src/commands/switchWorkspace.ts +++ b/apps/remix-ide-e2e/src/commands/switchWorkspace.ts @@ -6,12 +6,10 @@ class switchWorkspace extends EventEmitter { const timestamp = new Date().getTime() this.api.waitForElementVisible('[data-id="workspacesSelect"]') .click('[data-id="workspacesSelect"]') - //.saveScreenshot(`./reports/screenshots/workspace_group1.test/1_switchWorkspace${timestamp}.png`) .waitForElementVisible(`[data-id="dropdown-item-${workspaceName}"]`) .pause(2000) .click(`[data-id="dropdown-item-${workspaceName}"]`) .pause(3000) - //.saveScreenshot(`./reports/screenshots/workspace_group1.test/2_afterSwitchWorkspace${timestamp}.png`) .perform((done) => { done() this.emit('complete') From c276465f6e232bfd6bf8a685d74aab570fc2da34 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 14:36:22 +0200 Subject: [PATCH 126/179] rm time --- apps/remix-ide-e2e/src/commands/switchWorkspace.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/switchWorkspace.ts b/apps/remix-ide-e2e/src/commands/switchWorkspace.ts index 34083e9385..558178b07d 100644 --- a/apps/remix-ide-e2e/src/commands/switchWorkspace.ts +++ b/apps/remix-ide-e2e/src/commands/switchWorkspace.ts @@ -3,7 +3,6 @@ import EventEmitter from 'events' class switchWorkspace extends EventEmitter { command (this: NightwatchBrowser, workspaceName: string): NightwatchBrowser { - const timestamp = new Date().getTime() this.api.waitForElementVisible('[data-id="workspacesSelect"]') .click('[data-id="workspacesSelect"]') .waitForElementVisible(`[data-id="dropdown-item-${workspaceName}"]`) @@ -18,4 +17,4 @@ class switchWorkspace extends EventEmitter { } } -module.exports = switchWorkspace +module.exports = switchWorkspace \ No newline at end of file From 78decb1aff7951d37f9de068b38c4fb5f8b4da73 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 14:41:29 +0200 Subject: [PATCH 127/179] set done --- apps/remix-ide-e2e/src/helpers/init.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/helpers/init.ts b/apps/remix-ide-e2e/src/helpers/init.ts index 8bc3ab8eda..ddf8c13917 100644 --- a/apps/remix-ide-e2e/src/helpers/init.ts +++ b/apps/remix-ide-e2e/src/helpers/init.ts @@ -22,7 +22,7 @@ export default function (browser: NightwatchBrowser, callback: VoidFunction, url }, [loadPlugin]) .refresh() .pause(6000) - .perform(done) + .perform(done()) }) .maximizeWindow() .fullscreenWindow(() => { From bba545916ef1d1e6fb0e7beefa21554af444926d Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 15:29:02 +0200 Subject: [PATCH 128/179] update nightwatch --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a0a8f0f101..ce58893e45 100644 --- a/package.json +++ b/package.json @@ -307,7 +307,7 @@ "mkdirp": "^0.5.1", "mocha": "^8.0.1", "nanohtml": "^1.6.3", - "nightwatch": "^2.2.2", + "nightwatch": "^2.3", "nodemon": "^2.0.4", "notify-error": "^1.2.0", "npm-link-local": "^1.1.0", diff --git a/yarn.lock b/yarn.lock index edec7dc524..a38f919a6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16630,10 +16630,10 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -nightwatch@^2.2.2: - version "2.2.3" - resolved "https://registry.yarnpkg.com/nightwatch/-/nightwatch-2.2.3.tgz#07291c03130df5a39aa9ae2babd718048078866f" - integrity sha512-W2effHkwoSu+eSXsnkraiUW/CdO9B9+yiSqDeUZ3h9vL3WZmA/hfzC4ZQnrWzXJd4qvj2CsgCeKo9njSvlplog== +nightwatch@^2.3: + version "2.3.0" + resolved "https://registry.yarnpkg.com/nightwatch/-/nightwatch-2.3.0.tgz#3f883b7ef0a34e98754028783d82c3641869a608" + integrity sha512-JouglJuxReLoCWfwud6U6mKTqTlEapJZYEvFzsBZ8CDJ77jzaiBLkgbpSJ6nt51kHJRH+xZtdTTiKFNjX0vS8w== dependencies: "@nightwatch/chai" "5.0.2" ansi-to-html "^0.7.2" From e00f37c5458cfbf696d7b3c07f3e4a650b05f971 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 15:34:45 +0200 Subject: [PATCH 129/179] update types --- package.json | 2 +- yarn.lock | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ce58893e45..169b18f4ab 100644 --- a/package.json +++ b/package.json @@ -161,7 +161,7 @@ "@remixproject/plugin-utils": "^0.3.31", "@remixproject/plugin-webview": "^0.3.31", "@remixproject/plugin-ws": "^0.3.31", - "@types/nightwatch": "^2.0.9", + "@types/nightwatch": "^2.3.1", "ansi-gray": "^0.1.1", "async": "^2.6.2", "axios": ">=0.26.0", diff --git a/yarn.lock b/yarn.lock index a38f919a6a..41af48718d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4146,6 +4146,11 @@ resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.2.tgz#f65d3d6389e01eeb458bd54dc8f52b95a9463bc8" integrity sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w== +"@types/chai@*": + version "4.3.1" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.1.tgz#e2c6e73e0bdeb2521d00756d099218e9f5d90a04" + integrity sha512-/zPMqDkzSZ8t3VtxOa4KPq7uzzW978M9Tvh+j7GHKuo6k6GTLxPJ4J5gE5cjfJ26pnXst0N5Hax8Sr0T2Mi9zQ== + "@types/chai@^4.2.11": version "4.2.22" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.22.tgz#47020d7e4cf19194d43b5202f35f75bd2ad35ce7" @@ -4301,12 +4306,14 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-7.0.2.tgz#b17f16cf933597e10d6d78eae3251e692ce8b0ce" integrity sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w== -"@types/nightwatch@^2.0.9": - version "2.0.9" - resolved "https://registry.yarnpkg.com/@types/nightwatch/-/nightwatch-2.0.9.tgz#c5d3ed42ead7a58563cac96ebc52f40f09897ea1" - integrity sha512-vA568B2hjedgtjNf/ZM1po9Y5GWz8+jox0748+YyqilWIxV5fXkpKFSUWk41Evoqn5WI3JENlNupzs2o6pHjRA== +"@types/nightwatch@^2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@types/nightwatch/-/nightwatch-2.3.1.tgz#36cb1f2408f910c06e3de5b0365f6f6a606b1c69" + integrity sha512-K0Cr9e2YPC2g5aWnkcyo7w9kvhfNrMiKOCigJyuo3usl3kass1h3ktqHUwwUGupmTm02luzxf1aqNvg0Qfr/sw== dependencies: + "@types/chai" "*" "@types/selenium-webdriver" "*" + devtools-protocol "^0.0.1025565" "@types/node@*", "@types/node@>= 8", "@types/node@~8.9.4": version "8.9.5" @@ -9132,6 +9139,11 @@ detective@^5.2.0: defined "^1.0.0" minimist "^1.1.1" +devtools-protocol@^0.0.1025565: + version "0.0.1025565" + resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1025565.tgz#0b3da0d3714c556aad06b0ec60f4fde68a701a90" + integrity sha512-0s5sbGQR/EfYQhd8EpZgphpndsv+CufTlaeUyA6vYXCA0H5kMAsHCS/cHtUFWoKJCO125hpoKicQCfpxRj4oqw== + dezalgo@^1.0.0, dezalgo@^1.0.1, dezalgo@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.3.tgz#7f742de066fc748bc8db820569dddce49bf0d456" From 6a89b2e895760d4e33d17c8913a785e993e28e60 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 16:00:06 +0200 Subject: [PATCH 130/179] element key --- apps/remix-ide-e2e/src/commands/journalChildIncludes.ts | 4 ++-- apps/remix-ide-e2e/src/commands/testFunction.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/journalChildIncludes.ts b/apps/remix-ide-e2e/src/commands/journalChildIncludes.ts index 689be3bf34..d5a23a3968 100644 --- a/apps/remix-ide-e2e/src/commands/journalChildIncludes.ts +++ b/apps/remix-ide-e2e/src/commands/journalChildIncludes.ts @@ -1,4 +1,4 @@ -import { NightwatchBrowser } from 'nightwatch' +import { ELEMENT_KEY, NightwatchBrowser } from 'nightwatch' import EventEmitter from 'events' /* @@ -11,7 +11,7 @@ class JournalChildIncludes extends EventEmitter { 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]] + const jsonWebElementId = jsonWebElement[ELEMENT_KEY] || jsonWebElement[Object.keys(jsonWebElement)[0]] browser.elementIdText(jsonWebElementId, (jsonElement) => { const text = jsonElement.value diff --git a/apps/remix-ide-e2e/src/commands/testFunction.ts b/apps/remix-ide-e2e/src/commands/testFunction.ts index a144175894..5429a79537 100644 --- a/apps/remix-ide-e2e/src/commands/testFunction.ts +++ b/apps/remix-ide-e2e/src/commands/testFunction.ts @@ -1,4 +1,4 @@ -import { NightwatchBrowser, NightwatchTestFunctionExpectedInput } from 'nightwatch' +import { ELEMENT_KEY, NightwatchBrowser, NightwatchTestFunctionExpectedInput } from 'nightwatch' import EventEmitter from 'events' const deepequal = require('deep-equal') @@ -32,7 +32,7 @@ class TestFunction extends EventEmitter { // fetch and format transaction logs as key => pair object .elements('css selector', `*[data-shared="key_${txHash}"]`, (res) => { Array.isArray(res.value) && res.value.forEach(function (jsonWebElement) { - const jsonWebElementId: string = jsonWebElement.ELEMENT || jsonWebElement[Object.keys(jsonWebElement)[0]] + const jsonWebElementId: string = jsonWebElement[ELEMENT_KEY] || jsonWebElement[Object.keys(jsonWebElement)[0]] browser.elementIdText(jsonWebElementId, (jsonElement) => { const key = typeof jsonElement.value === 'string' ? jsonElement.value.trim() : null @@ -43,7 +43,7 @@ class TestFunction extends EventEmitter { }) .elements('css selector', `*[data-shared="pair_${txHash}"]`, (res) => { Array.isArray(res.value) && res.value.forEach(function (jsonWebElement, index) { - const jsonWebElementId = jsonWebElement.ELEMENT || jsonWebElement[Object.keys(jsonWebElement)[0]] + const jsonWebElementId = jsonWebElement[ELEMENT_KEY] || jsonWebElement[Object.keys(jsonWebElement)[0]] browser.elementIdText(jsonWebElementId, (jsonElement) => { let value = jsonElement.value From 96b0d777a530cd408f33522726404286b4707669 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Aug 2022 16:49:25 +0200 Subject: [PATCH 131/179] rm commented code --- apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index a6f3229740..a62a2fe932 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -179,16 +179,11 @@ module.exports = { .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .click('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]') .setValue('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_new') - // eslint-disable-next-line dot-notation - //.execute(() => { - // (document.querySelector('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]') as any).value = "workspace_new" - //}, [], () => {}) .pause(2000) .getValue('*[data-id="fileSystemModalDialogContainer-react"] input[data-id="modalDialogCustomPromptTextCreate"]', (result) => { console.log(result) browser.assert.equal(result.value, 'workspace_new') }) - //.verify.attributeEquals('*[data-id="modalDialogCustomPromptTextCreate"]', 'value', 'workspace_new') .waitForElementVisible('*[data-id="fileSystem-modal-footer-ok-react"]') .click('*[data-id="fileSystem-modal-footer-ok-react"]') .pause(3000) From cb61f2cf1251579de48ca477ff9d7bfa68170c65 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 4 Aug 2022 09:41:12 +0200 Subject: [PATCH 132/179] fix test --- apps/remix-ide-e2e/src/tests/fileExplorer.test.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts b/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts index 0a15009a89..49a1cf8686 100644 --- a/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts +++ b/apps/remix-ide-e2e/src/tests/fileExplorer.test.ts @@ -99,15 +99,16 @@ module.exports = { }) }, - 'Should open local filesystem explorer #group2': !function (browser: NightwatchBrowser) { - browser.waitForElementVisible('div[data-id="remixIdeSidePanel"]') + 'Should open local filesystem explorer #group2': function (browser: NightwatchBrowser) { + browser + .waitForElementVisible('div[data-id="remixIdeSidePanel"]') .clickLaunchIcon('filePanel') .waitForElementVisible('*[data-id="filePanelFileExplorerTree"]') .click('[data-id="remixUIWorkspaceExplorer"]') .waitForElementPresent('*[data-id="fileExplorerFileUpload"]') - .setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile1) - .setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile2) - .setValue('*[data-id="fileExplorerFileUpload"]', testData.testFile3) + .uploadFile('*[data-id="fileExplorerFileUpload"]', testData.testFile1) + .uploadFile('*[data-id="fileExplorerFileUpload"]', testData.testFile2) + .uploadFile('*[data-id="fileExplorerFileUpload"]', testData.testFile3) .waitForElementVisible('[data-id="treeViewLitreeViewItemeditor.test.js"]') .waitForElementVisible('[data-id="treeViewLitreeViewItemfileExplorer.test.js"]') .waitForElementVisible('[data-id="treeViewLitreeViewItemgeneralSettings.test.js"]') From 3e35af3e6d71db692aa9e5d281fcf4f09892320a Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 4 Aug 2022 10:04:06 +0200 Subject: [PATCH 133/179] fix execute --- apps/remix-ide-e2e/src/tests/file_decorator.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/file_decorator.test.ts b/apps/remix-ide-e2e/src/tests/file_decorator.test.ts index 9b47bbc61f..3483853cad 100644 --- a/apps/remix-ide-e2e/src/tests/file_decorator.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_decorator.test.ts @@ -17,7 +17,7 @@ module.exports = { .openFile('contracts/3_Ballot.sol') .addFile('scripts/decorators.ts', { content: testScriptSet }) .pause(2000) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .pause(4000) .useXpath() .waitForElementContainsText('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-error-contracts/2_Owner.sol"]', '2') @@ -38,7 +38,7 @@ module.exports = { .useCss() .addFile('scripts/clearballot.ts', { content: testScriptClearBallot }) .pause(2000) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .pause(4000) .waitForElementNotPresent('[data-id="file-decoration-custom-contracts/3_Ballot.sol"]', 10000) }, @@ -46,7 +46,7 @@ module.exports = { browser .addFile('scripts/clearall.ts', { content: testScriptClear }) .pause(2000) - .executeScript('remix.exeCurrent()') + .executeScriptInTerminal('remix.exeCurrent()') .pause(4000) .waitForElementNotPresent('[data-id="file-decoration-error-contracts/2_Owner.sol"]', 10000) .waitForElementNotPresent('[data-id="file-decoration-warning-contracts/1_Storage.sol"]', 10000) From 2e90c213cb6337f1bf734b805baf79f9e286d1b0 Mon Sep 17 00:00:00 2001 From: lianahus Date: Thu, 4 Aug 2022 10:11:56 +0200 Subject: [PATCH 134/179] labels' spaceing fixed --- libs/remix-ui/settings/src/lib/github-settings.tsx | 6 +++--- .../settings/src/lib/remix-ui-settings.tsx | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libs/remix-ui/settings/src/lib/github-settings.tsx b/libs/remix-ui/settings/src/lib/github-settings.tsx index e7c9c3f2ce..243598d6ec 100644 --- a/libs/remix-ui/settings/src/lib/github-settings.tsx +++ b/libs/remix-ui/settings/src/lib/github-settings.tsx @@ -51,7 +51,7 @@ export function GithubSettings (props: GithubSettingsProps) {

Go to github token page (link below) to create a new token and save it in Remix. Make sure this token has only \'create gist\' permission.

https://github.com/settings/tokens

- +
handleChangeTokenState(e)} value={ githubToken } />
@@ -60,13 +60,13 @@ export function GithubSettings (props: GithubSettingsProps) {
- +
handleChangeUserNameState(e)} value={ githubUserName } />
- +
handleChangeEmailState(e)} value={ githubEmail } />
diff --git a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx index 19655dd281..912da468f3 100644 --- a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx +++ b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx @@ -248,12 +248,12 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
{ swarmSettingsTitle }
-
+
-
+
@@ -312,27 +312,27 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
{ ipfsSettingsText }
-
+
-
+
-
+
-
+
-
+
From b1fd1efc7f1a5aed8feb6ff369746e40caa42c96 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 4 Aug 2022 10:12:08 +0200 Subject: [PATCH 135/179] add filedecorator to required --- apps/remix-ide/src/remixAppManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index 1bebbc7083..fcf96659ec 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -11,7 +11,7 @@ const requiredModules = [ // services + layout views + system views 'filePanel', 'terminal', 'settings', 'pluginManager', 'tabs', 'udapp', 'dGitProvider', 'solidity', 'solidity-logic', 'gistHandler', 'layout', 'notification', 'permissionhandler', 'walkthrough', 'storage', 'restorebackupzip', 'link-libraries', 'deploy-libraries', 'openzeppelin-proxy', 'hardhat-provider', 'ganache-provider', 'foundry-provider', 'basic-http-provider', 'injected-optimism-provider', 'injected-arbitrum-one-provider', - 'compileAndRun', 'search', 'recorder'] + 'compileAndRun', 'search', 'recorder', 'fileDecorator'] // dependentModules shouldn't be manually activated (e.g hardhat is activated by remixd) const dependentModules = ['hardhat', 'truffle', 'slither'] From 4676ba47a963cfe9f97b59fbc8909a63a359b3cd Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 8 Aug 2022 09:47:48 +0200 Subject: [PATCH 136/179] fix metamask loading and notification --- apps/remix-ide/src/blockchain/execution-context.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/blockchain/execution-context.js b/apps/remix-ide/src/blockchain/execution-context.js index 1fe181acfb..5e91c6569c 100644 --- a/apps/remix-ide/src/blockchain/execution-context.js +++ b/apps/remix-ide/src/blockchain/execution-context.js @@ -156,7 +156,7 @@ export class ExecutionContext { return cb() } else { if (injectedProvider && injectedProvider._metamask && injectedProvider._metamask.isUnlocked) { - if (!await injectedProvider._metamask.isUnlocked()) this.call('notification', 'toast', 'Please make sure the injected provider is unlocked (e.g Metamask).') + if (!await injectedProvider._metamask.isUnlocked()) infoCb('Please make sure the injected provider is unlocked (e.g Metamask).') } this.askPermission() this.executionContext = context diff --git a/package.json b/package.json index 169b18f4ab..ca78b75c73 100644 --- a/package.json +++ b/package.json @@ -211,7 +211,7 @@ "time-stamp": "^2.2.0", "ts-loader": "^9.2.6", "tslib": "^2.3.0", - "web3": "^1.5.1", + "web3": "^1.7.5", "winston": "^3.3.3", "ws": "^7.3.0" }, From 7ac1481a09d6f041559eadd3ab2b6c8f16a40440 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 8 Aug 2022 09:59:02 +0200 Subject: [PATCH 137/179] lock file --- yarn.lock | 677 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 448 insertions(+), 229 deletions(-) diff --git a/yarn.lock b/yarn.lock index 41af48718d..d544d2119c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1781,7 +1781,7 @@ lru-cache "^5.1.1" semaphore-async-await "^1.5.1" -"@ethereumjs/common@^2.3.0", "@ethereumjs/common@^2.4.0", "@ethereumjs/common@^2.5.0", "@ethereumjs/common@^2.6.0": +"@ethereumjs/common@^2.5.0", "@ethereumjs/common@^2.6.0": version "2.6.0" resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.6.0.tgz#feb96fb154da41ee2cc2c5df667621a440f36348" integrity sha512-Cq2qS0FTu6O2VU1sgg+WyU9Ps0M6j/BEMHN+hRaECXCV/r0aI78u4N6p52QW/BDVhwWZpCdrvG8X7NJdzlpNUA== @@ -1800,7 +1800,7 @@ ethereumjs-util "^7.1.1" miller-rabin "^4.0.0" -"@ethereumjs/tx@^3.2.1", "@ethereumjs/tx@^3.3.2", "@ethereumjs/tx@^3.4.0": +"@ethereumjs/tx@^3.3.2", "@ethereumjs/tx@^3.4.0": version "3.4.0" resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.4.0.tgz#7eb1947eefa55eb9cf05b3ca116fb7a3dbd0bce7" integrity sha512-WWUwg1PdjHKZZxPPo274ZuPsJCWV3SqATrEKQP1n2DrVYVP1aZIYpo/mFaA0BDoE0tIQmBeimRCEA0Lgil+yYw== @@ -1845,21 +1845,6 @@ web-streams-polyfill "^3.1.0" ws "^7.5.0" -"@ethersproject/abi@5.0.7": - version "5.0.7" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.7.tgz#79e52452bd3ca2956d0e1c964207a58ad1a0ee7b" - integrity sha512-Cqktk+hSIckwP/W8O47Eef60VwmoSC/L3lY0+dIBhQPCNn9E4V7rwmm2aFrNRRDJfFlGuZ1khkQUOc3oBX+niw== - dependencies: - "@ethersproject/address" "^5.0.4" - "@ethersproject/bignumber" "^5.0.7" - "@ethersproject/bytes" "^5.0.4" - "@ethersproject/constants" "^5.0.4" - "@ethersproject/hash" "^5.0.4" - "@ethersproject/keccak256" "^5.0.3" - "@ethersproject/logger" "^5.0.5" - "@ethersproject/properties" "^5.0.3" - "@ethersproject/strings" "^5.0.4" - "@ethersproject/abi@5.5.0", "@ethersproject/abi@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.5.0.tgz#fb52820e22e50b854ff15ce1647cc508d6660613" @@ -1875,6 +1860,21 @@ "@ethersproject/properties" "^5.5.0" "@ethersproject/strings" "^5.5.0" +"@ethersproject/abi@^5.6.3": + version "5.6.4" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.4.tgz#f6e01b6ed391a505932698ecc0d9e7a99ee60362" + integrity sha512-TTeZUlCeIHG6527/2goZA6gW5F8Emoc7MrZDC7hhP84aRGvW3TEdTnZR08Ls88YXM1m2SuK42Osw/jSi3uO8gg== + dependencies: + "@ethersproject/address" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/constants" "^5.6.1" + "@ethersproject/hash" "^5.6.1" + "@ethersproject/keccak256" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.1" + "@ethersproject/abstract-provider@5.5.1", "@ethersproject/abstract-provider@^5.5.0": version "5.5.1" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz#2f1f6e8a3ab7d378d8ad0b5718460f85649710c5" @@ -1888,6 +1888,19 @@ "@ethersproject/transactions" "^5.5.0" "@ethersproject/web" "^5.5.0" +"@ethersproject/abstract-provider@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.6.1.tgz#02ddce150785caf0c77fe036a0ebfcee61878c59" + integrity sha512-BxlIgogYJtp1FS8Muvj8YfdClk3unZH0vRMVX791Z9INBNT/kuACZ9GzaY1Y4yFq+YSy6/w4gzj3HCRKrK9hsQ== + dependencies: + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/networks" "^5.6.3" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/transactions" "^5.6.2" + "@ethersproject/web" "^5.6.1" + "@ethersproject/abstract-signer@5.5.0", "@ethersproject/abstract-signer@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz#590ff6693370c60ae376bf1c7ada59eb2a8dd08d" @@ -1899,7 +1912,18 @@ "@ethersproject/logger" "^5.5.0" "@ethersproject/properties" "^5.5.0" -"@ethersproject/address@5.5.0", "@ethersproject/address@^5.0.4", "@ethersproject/address@^5.5.0": +"@ethersproject/abstract-signer@^5.6.2": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.6.2.tgz#491f07fc2cbd5da258f46ec539664713950b0b33" + integrity sha512-n1r6lttFBG0t2vNiI3HoWaS/KdOt8xyDjzlP2cuevlWLG6EX0OwcKLyG/Kp/cuwNxdy/ous+R/DEMdTUwWQIjQ== + dependencies: + "@ethersproject/abstract-provider" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + +"@ethersproject/address@5.5.0", "@ethersproject/address@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.5.0.tgz#bcc6f576a553f21f3dd7ba17248f81b473c9c78f" integrity sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw== @@ -1910,6 +1934,17 @@ "@ethersproject/logger" "^5.5.0" "@ethersproject/rlp" "^5.5.0" +"@ethersproject/address@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.6.1.tgz#ab57818d9aefee919c5721d28cd31fd95eff413d" + integrity sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q== + dependencies: + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/keccak256" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/rlp" "^5.6.1" + "@ethersproject/base64@5.5.0", "@ethersproject/base64@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.5.0.tgz#881e8544e47ed976930836986e5eb8fab259c090" @@ -1917,6 +1952,13 @@ dependencies: "@ethersproject/bytes" "^5.5.0" +"@ethersproject/base64@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.6.1.tgz#2c40d8a0310c9d1606c2c37ae3092634b41d87cb" + integrity sha512-qB76rjop6a0RIYYMiB4Eh/8n+Hxu2NIZm8S/Q7kNo5pmZfXhHGHmS4MinUainiBC54SCyRnwzL+KZjj8zbsSsw== + dependencies: + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/basex@5.5.0", "@ethersproject/basex@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.5.0.tgz#e40a53ae6d6b09ab4d977bd037010d4bed21b4d3" @@ -1925,7 +1967,7 @@ "@ethersproject/bytes" "^5.5.0" "@ethersproject/properties" "^5.5.0" -"@ethersproject/bignumber@5.5.0", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.5.0": +"@ethersproject/bignumber@5.5.0", "@ethersproject/bignumber@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.5.0.tgz#875b143f04a216f4f8b96245bde942d42d279527" integrity sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg== @@ -1934,20 +1976,43 @@ "@ethersproject/logger" "^5.5.0" bn.js "^4.11.9" -"@ethersproject/bytes@5.5.0", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.5.0": +"@ethersproject/bignumber@^5.6.2": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.6.2.tgz#72a0717d6163fab44c47bcc82e0c550ac0315d66" + integrity sha512-v7+EEUbhGqT3XJ9LMPsKvXYHFc8eHxTowFCG/HgJErmq4XHJ2WR7aeyICg3uTOAQ7Icn0GFHAohXEhxQHq4Ubw== + dependencies: + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + bn.js "^5.2.1" + +"@ethersproject/bytes@5.5.0", "@ethersproject/bytes@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog== dependencies: "@ethersproject/logger" "^5.5.0" -"@ethersproject/constants@5.5.0", "@ethersproject/constants@^5.0.4", "@ethersproject/constants@^5.5.0": +"@ethersproject/bytes@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.6.1.tgz#24f916e411f82a8a60412344bf4a813b917eefe7" + integrity sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g== + dependencies: + "@ethersproject/logger" "^5.6.0" + +"@ethersproject/constants@5.5.0", "@ethersproject/constants@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.5.0.tgz#d2a2cd7d94bd1d58377d1d66c4f53c9be4d0a45e" integrity sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ== dependencies: "@ethersproject/bignumber" "^5.5.0" +"@ethersproject/constants@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.6.1.tgz#e2e974cac160dd101cf79fdf879d7d18e8cb1370" + integrity sha512-QSq9WVnZbxXYFftrjSjZDUshp6/eKp6qrtdBtUCm0QxCV5z1fG/w3kdlcsjMCQuQHUnAclKoK7XpXMezhRDOLg== + dependencies: + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/contracts@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.5.0.tgz#b735260d4bd61283a670a82d5275e2a38892c197" @@ -1964,7 +2029,7 @@ "@ethersproject/properties" "^5.5.0" "@ethersproject/transactions" "^5.5.0" -"@ethersproject/hash@5.5.0", "@ethersproject/hash@^5.0.4", "@ethersproject/hash@^5.5.0": +"@ethersproject/hash@5.5.0", "@ethersproject/hash@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.5.0.tgz#7cee76d08f88d1873574c849e0207dcb32380cc9" integrity sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg== @@ -1978,6 +2043,20 @@ "@ethersproject/properties" "^5.5.0" "@ethersproject/strings" "^5.5.0" +"@ethersproject/hash@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.6.1.tgz#224572ea4de257f05b4abf8ae58b03a67e99b0f4" + integrity sha512-L1xAHurbaxG8VVul4ankNX5HgQ8PNCTrnVXEiFnE9xoRnaUcgfD12tZINtDinSllxPLCtGwguQxJ5E6keE84pA== + dependencies: + "@ethersproject/abstract-signer" "^5.6.2" + "@ethersproject/address" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/keccak256" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.1" + "@ethersproject/hdnode@5.5.0", "@ethersproject/hdnode@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.5.0.tgz#4a04e28f41c546f7c978528ea1575206a200ddf6" @@ -2015,7 +2094,7 @@ aes-js "3.0.0" scrypt-js "3.0.1" -"@ethersproject/keccak256@5.5.0", "@ethersproject/keccak256@^5.0.3", "@ethersproject/keccak256@^5.5.0": +"@ethersproject/keccak256@5.5.0", "@ethersproject/keccak256@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.5.0.tgz#e4b1f9d7701da87c564ffe336f86dcee82983492" integrity sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg== @@ -2023,11 +2102,24 @@ "@ethersproject/bytes" "^5.5.0" js-sha3 "0.8.0" -"@ethersproject/logger@5.5.0", "@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.5.0": +"@ethersproject/keccak256@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.6.1.tgz#b867167c9b50ba1b1a92bccdd4f2d6bd168a91cc" + integrity sha512-bB7DQHCTRDooZZdL3lk9wpL0+XuG3XLGHLh3cePnybsO3V0rdCAOQGpn/0R3aODmnTOOkCATJiD2hnL+5bwthA== + dependencies: + "@ethersproject/bytes" "^5.6.1" + js-sha3 "0.8.0" + +"@ethersproject/logger@5.5.0", "@ethersproject/logger@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== +"@ethersproject/logger@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.6.0.tgz#d7db1bfcc22fd2e4ab574cba0bb6ad779a9a3e7a" + integrity sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg== + "@ethersproject/networks@5.5.0", "@ethersproject/networks@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.5.0.tgz#babec47cab892c51f8dd652ce7f2e3e14283981a" @@ -2035,6 +2127,13 @@ dependencies: "@ethersproject/logger" "^5.5.0" +"@ethersproject/networks@^5.6.3": + version "5.6.4" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.4.tgz#51296d8fec59e9627554f5a8a9c7791248c8dc07" + integrity sha512-KShHeHPahHI2UlWdtDMn2lJETcbtaJge4k7XSjDR9h79QTd6yQJmv6Cp2ZA4JdqWnhszAOLSuJEd9C0PRw7hSQ== + dependencies: + "@ethersproject/logger" "^5.6.0" + "@ethersproject/pbkdf2@5.5.0", "@ethersproject/pbkdf2@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.5.0.tgz#e25032cdf02f31505d47afbf9c3e000d95c4a050" @@ -2043,13 +2142,20 @@ "@ethersproject/bytes" "^5.5.0" "@ethersproject/sha2" "^5.5.0" -"@ethersproject/properties@5.5.0", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.5.0": +"@ethersproject/properties@5.5.0", "@ethersproject/properties@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.5.0.tgz#61f00f2bb83376d2071baab02245f92070c59995" integrity sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA== dependencies: "@ethersproject/logger" "^5.5.0" +"@ethersproject/properties@^5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.6.0.tgz#38904651713bc6bdd5bdd1b0a4287ecda920fa04" + integrity sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg== + dependencies: + "@ethersproject/logger" "^5.6.0" + "@ethersproject/providers@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.5.0.tgz#bc2876a8fe5e0053ed9828b1f3767ae46e43758b" @@ -2091,6 +2197,14 @@ "@ethersproject/bytes" "^5.5.0" "@ethersproject/logger" "^5.5.0" +"@ethersproject/rlp@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.6.1.tgz#df8311e6f9f24dcb03d59a2bac457a28a4fe2bd8" + integrity sha512-uYjmcZx+DKlFUk7a5/W9aQVaoEC7+1MOBgNtvNg13+RnuUwT4F0zTovC0tmay5SmRslb29V1B7Y5KCri46WhuQ== + dependencies: + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/sha2@5.5.0", "@ethersproject/sha2@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.5.0.tgz#a40a054c61f98fd9eee99af2c3cc6ff57ec24db7" @@ -2112,6 +2226,18 @@ elliptic "6.5.4" hash.js "1.1.7" +"@ethersproject/signing-key@^5.6.2": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.6.2.tgz#8a51b111e4d62e5a62aee1da1e088d12de0614a3" + integrity sha512-jVbu0RuP7EFpw82vHcL+GP35+KaNruVAZM90GxgQnGqB6crhBqW/ozBfFvdeImtmb4qPko0uxXjn8l9jpn0cwQ== + dependencies: + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + bn.js "^5.2.1" + elliptic "6.5.4" + hash.js "1.1.7" + "@ethersproject/solidity@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.5.0.tgz#2662eb3e5da471b85a20531e420054278362f93f" @@ -2124,7 +2250,7 @@ "@ethersproject/sha2" "^5.5.0" "@ethersproject/strings" "^5.5.0" -"@ethersproject/strings@5.5.0", "@ethersproject/strings@^5.0.4", "@ethersproject/strings@^5.5.0": +"@ethersproject/strings@5.5.0", "@ethersproject/strings@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.5.0.tgz#e6784d00ec6c57710755699003bc747e98c5d549" integrity sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ== @@ -2133,7 +2259,16 @@ "@ethersproject/constants" "^5.5.0" "@ethersproject/logger" "^5.5.0" -"@ethersproject/transactions@5.5.0", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.5.0": +"@ethersproject/strings@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.6.1.tgz#dbc1b7f901db822b5cafd4ebf01ca93c373f8952" + integrity sha512-2X1Lgk6Jyfg26MUnsHiT456U9ijxKUybz8IM1Vih+NJxYtXhmvKBcHOmvGqpFSVJ0nQ4ZCoIViR8XlRw1v/+Cw== + dependencies: + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/constants" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + +"@ethersproject/transactions@5.5.0", "@ethersproject/transactions@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.5.0.tgz#7e9bf72e97bcdf69db34fe0d59e2f4203c7a2908" integrity sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA== @@ -2148,6 +2283,21 @@ "@ethersproject/rlp" "^5.5.0" "@ethersproject/signing-key" "^5.5.0" +"@ethersproject/transactions@^5.6.2": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.6.2.tgz#793a774c01ced9fe7073985bb95a4b4e57a6370b" + integrity sha512-BuV63IRPHmJvthNkkt9G70Ullx6AcM+SDc+a8Aw/8Yew6YwT51TcBKEp1P4oOQ/bP25I18JJr7rcFRgFtU9B2Q== + dependencies: + "@ethersproject/address" "^5.6.1" + "@ethersproject/bignumber" "^5.6.2" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/constants" "^5.6.1" + "@ethersproject/keccak256" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/rlp" "^5.6.1" + "@ethersproject/signing-key" "^5.6.2" + "@ethersproject/units@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.5.0.tgz#104d02db5b5dc42cc672cc4587bafb87a95ee45e" @@ -2189,6 +2339,17 @@ "@ethersproject/properties" "^5.5.0" "@ethersproject/strings" "^5.5.0" +"@ethersproject/web@^5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.6.1.tgz#6e2bd3ebadd033e6fe57d072db2b69ad2c9bdf5d" + integrity sha512-/vSyzaQlNXkO1WV+RneYKqCJwualcUdx/Z3gseVovZP0wIlOFcCE1hkRhKBH8ImKbGQbMl9EAAyJFrJu7V0aqA== + dependencies: + "@ethersproject/base64" "^5.6.1" + "@ethersproject/bytes" "^5.6.1" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.1" + "@ethersproject/wordlists@5.5.0", "@ethersproject/wordlists@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.5.0.tgz#aac74963aa43e643638e5172353d931b347d584f" @@ -3904,6 +4065,11 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.2.0.tgz#667bfc6186ae7c9e0b45a08960c551437176e1ca" integrity sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw== +"@sindresorhus/is@^4.6.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" + integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== + "@sinonjs/commons@^1.7.0": version "1.8.3" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" @@ -4035,6 +4201,13 @@ dependencies: defer-to-connect "^2.0.0" +"@szmarczak/http-timer@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-5.0.1.tgz#c7c1bf1141cdd4751b0399c8fc7b8b664cd5be3a" + integrity sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw== + dependencies: + defer-to-connect "^2.0.1" + "@testing-library/dom@^7.17.1": version "7.31.2" resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.31.2.tgz#df361db38f5212b88555068ab8119f5d841a8c4a" @@ -4117,7 +4290,7 @@ dependencies: "@babel/types" "^7.3.0" -"@types/bn.js@^4.11.3", "@types/bn.js@^4.11.5": +"@types/bn.js@^4.11.3": version "4.11.6" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== @@ -4131,7 +4304,7 @@ dependencies: "@types/node" "*" -"@types/cacheable-request@^6.0.1": +"@types/cacheable-request@^6.0.1", "@types/cacheable-request@^6.0.2": version "6.0.2" resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.2.tgz#c324da0197de0a98a2312156536ae262429ff6b9" integrity sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA== @@ -4817,6 +4990,11 @@ abort-controller@^3.0.0: dependencies: event-target-shim "^5.0.0" +abortcontroller-polyfill@^1.7.3: + version "1.7.3" + resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.3.tgz#1b5b487bd6436b5b764fd52a612509702c3144b5" + integrity sha512-zetDJxd89y3X99Kvo4qFx8GKlt6GsvN3UcRZHwU6iFA/0KiOmhkTVhe8oRoTBiTVPZu09x3vCra47+w8Yz1+2Q== + abstract-leveldown@^6.2.1: version "6.3.0" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz#d25221d1e6612f820c35963ba4bd739928f6026a" @@ -6500,6 +6678,11 @@ bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== +bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + body-parser@1.19.0, body-parser@^1.16.0: version "1.19.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" @@ -7121,6 +7304,11 @@ cacheable-lookup@^5.0.3: resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== +cacheable-lookup@^6.0.4: + version "6.1.0" + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-6.1.0.tgz#0330a543471c61faa4e9035db583aad753b36385" + integrity sha512-KJ/Dmo1lDDhmW2XDPMo+9oiy/CeqosPguPCrgcVzKyZrL6pM1gU2GmPY/xo6OQPTUaA/c0kwHuywB4E6nmT9ww== + cacheable-request@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" @@ -8248,11 +8436,6 @@ cookie@0.4.0: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== -cookiejar@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.3.tgz#fc7a6216e408e74414b90230050842dacda75acc" - integrity sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ== - copy-concurrently@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.3.tgz#45fb7866249a1ca889aa5708e6cbd273e75bb250" @@ -8444,7 +8627,7 @@ cross-blob@^2.0.1: blob-polyfill "^5.0.20210201" fetch-blob "^2.1.2" -cross-fetch@^3.1.5: +cross-fetch@^3.1.4, cross-fetch@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== @@ -8992,7 +9175,7 @@ defer-to-connect@^1.0.1: resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== -defer-to-connect@^2.0.0: +defer-to-connect@^2.0.0, defer-to-connect@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== @@ -9732,7 +9915,7 @@ es6-iterator@^2.0.1, es6-iterator@^2.0.3, es6-iterator@~2.0.3: es5-ext "^0.10.35" es6-symbol "^3.1.1" -es6-promise@^4.0.3: +es6-promise@^4.0.3, es6-promise@^4.2.8: version "4.2.8" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== @@ -11012,6 +11195,11 @@ fork-ts-checker-webpack-plugin@^3.1.1: tapable "^1.0.0" worker-rpc "^0.1.0" +form-data-encoder@1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.1.tgz#ac80660e4f87ee0d3d3c3638b7da8278ddb8ec96" + integrity sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg== + form-data@^2.5.0: version "2.5.1" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4" @@ -11405,7 +11593,7 @@ get-stream@^5.1.0: dependencies: pump "^3.0.0" -get-stream@^6.0.0: +get-stream@^6.0.0, get-stream@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== @@ -11776,22 +11964,24 @@ glogg@^1.0.0: dependencies: sparkles "^1.0.0" -got@9.6.0, got@^9.6.0: - version "9.6.0" - resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" - integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== +got@12.1.0: + version "12.1.0" + resolved "https://registry.yarnpkg.com/got/-/got-12.1.0.tgz#099f3815305c682be4fd6b0ee0726d8e4c6b0af4" + integrity sha512-hBv2ty9QN2RdbJJMK3hesmSkFTjVIHyIDDbssCKnSmq62edGgImJWD10Eb1k77TiV1bxloxqcFAVK8+9pkhOig== dependencies: - "@sindresorhus/is" "^0.14.0" - "@szmarczak/http-timer" "^1.1.2" - cacheable-request "^6.0.0" - decompress-response "^3.3.0" - duplexer3 "^0.1.4" - get-stream "^4.1.0" - lowercase-keys "^1.0.1" - mimic-response "^1.0.1" - p-cancelable "^1.0.0" - to-readable-stream "^1.0.0" - url-parse-lax "^3.0.0" + "@sindresorhus/is" "^4.6.0" + "@szmarczak/http-timer" "^5.0.1" + "@types/cacheable-request" "^6.0.2" + "@types/responselike" "^1.0.0" + cacheable-lookup "^6.0.4" + cacheable-request "^7.0.2" + decompress-response "^6.0.0" + form-data-encoder "1.7.1" + get-stream "^6.0.1" + http2-wrapper "^2.1.10" + lowercase-keys "^3.0.0" + p-cancelable "^3.0.0" + responselike "^2.0.0" got@^11.8.2: version "11.8.3" @@ -11847,6 +12037,23 @@ got@^7.1.0: url-parse-lax "^1.0.0" url-to-options "^1.0.1" +got@^9.6.0: + version "9.6.0" + resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" + integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== + dependencies: + "@sindresorhus/is" "^0.14.0" + "@szmarczak/http-timer" "^1.1.2" + cacheable-request "^6.0.0" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^4.1.0" + lowercase-keys "^1.0.1" + mimic-response "^1.0.1" + p-cancelable "^1.0.0" + to-readable-stream "^1.0.0" + url-parse-lax "^3.0.0" + graceful-fs@^4.0.0, graceful-fs@^4.1.15, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.4: version "4.2.8" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" @@ -12362,6 +12569,14 @@ http2-wrapper@^1.0.0-beta.5.2: quick-lru "^5.1.1" resolve-alpn "^1.0.0" +http2-wrapper@^2.1.10: + version "2.1.11" + resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-2.1.11.tgz#d7c980c7ffb85be3859b6a96c800b2951ae257ef" + integrity sha512-aNAk5JzLturWEUiuhAN73Jcbq96R7rTitAoXV54FYMatvihnpD2+6PUgU4ce3D/m5VDbw+F5CsyKSF176ptitQ== + dependencies: + quick-lru "^5.1.1" + resolve-alpn "^1.2.0" + https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" @@ -15381,6 +15596,11 @@ lowercase-keys@^2.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== +lowercase-keys@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-3.0.0.tgz#c5e7d442e37ead247ae9db117a9d0a467c89d4f2" + integrity sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ== + lru-cache@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-3.2.0.tgz#71789b3b7f5399bec8565dda38aa30d2a097efee" @@ -17803,6 +18023,11 @@ p-cancelable@^2.0.0: resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== +p-cancelable@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-3.0.0.tgz#63826694b54d61ca1c20ebcb6d3ecf5e14cd8050" + integrity sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw== + p-defer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" @@ -20069,7 +20294,7 @@ reset@^0.1.0: resolved "https://registry.yarnpkg.com/reset/-/reset-0.1.0.tgz#9fc7314171995ae6cb0b7e58b06ce7522af4bafb" integrity sha1-n8cxQXGZWubLC35YsGznUir0uvs= -resolve-alpn@^1.0.0: +resolve-alpn@^1.0.0, resolve-alpn@^1.2.0: version "1.2.1" resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== @@ -23437,215 +23662,216 @@ web-streams-polyfill@^3.1.0: resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz#a6b74026b38e4885869fb5c589e90b95ccfc7965" integrity sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA== -web3-bzz@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.6.0.tgz#584b51339f21eedff159abc9239b4b7ef6ded840" - integrity sha512-ugYV6BsinwhIi0CsLWINBz4mqN9wR9vNG0WmyEbdECjxcPyr6vkaWt4qi0zqlUxEnYAwGj4EJXNrbjPILntQTQ== +web3-bzz@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.7.5.tgz#edeb262c3a6619109763077a94172513cf07cdde" + integrity sha512-Z53sY0YK/losqjJncmL4vP0zZI9r6tiXg6o7R6e1JD2Iy7FH3serQvU+qXmPjqEBzsnhf8wTG+YcBPB3RHpr0Q== dependencies: "@types/node" "^12.12.6" - got "9.6.0" + got "12.1.0" swarm-js "^0.1.40" -web3-core-helpers@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.6.0.tgz#77e161b6ba930a4008a0df804ab379e0aa7e1e7f" - integrity sha512-H/IAH/0mrgvad/oxVKiAMC7qDzMrPPe/nRKmJOoIsupRg9/frvL62kZZiHhqVD1HMyyswbQFC69QRl7JqWzvxg== +web3-core-helpers@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.7.5.tgz#e97b3ecac787ade4b9390807a86aca78ed97872b" + integrity sha512-lDDjTks6Q6aNUO87RYrY2xub3UWTKr/RIWxpHJODEqkLxZS1dWdyliJ6aIx3031VQwsNT5HE7NvABe/t0p3iDQ== dependencies: - web3-eth-iban "1.6.0" - web3-utils "1.6.0" + web3-eth-iban "1.7.5" + web3-utils "1.7.5" -web3-core-method@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.6.0.tgz#ebe4ea51f5a4fa809bb68185576186359d3982e9" - integrity sha512-cHekyEil4mtcCOk6Q1Zh4y+2o5pTwsLIxP6Bpt4BRtZgdsyPiadYJpkLAVT/quch5xN7Qs5ZwG5AvRCS3VwD2g== +web3-core-method@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.7.5.tgz#ffe8883c169468f0e4d13509377f2d8876d9b7be" + integrity sha512-ApTvq1Llzlbxmy0n4L7QaE6NodIsR80VJqk8qN4kLg30SGznt/pNJFebryLI2kpyDmxSgj1TjEWzmHJBp6FhYg== dependencies: - "@ethereumjs/common" "^2.4.0" - "@ethersproject/transactions" "^5.0.0-beta.135" - web3-core-helpers "1.6.0" - web3-core-promievent "1.6.0" - web3-core-subscriptions "1.6.0" - web3-utils "1.6.0" + "@ethersproject/transactions" "^5.6.2" + web3-core-helpers "1.7.5" + web3-core-promievent "1.7.5" + web3-core-subscriptions "1.7.5" + web3-utils "1.7.5" -web3-core-promievent@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.6.0.tgz#8b6053ae83cb47164540167fc361469fc604d2dd" - integrity sha512-ZzsevjMXWkhqW9dnVfTfb1OUcK7jKcKPvPIbQ4boJccNgvNZPZKlo8xB4pkAX38n4c59O5mC7Lt/z2QL/M5CeQ== +web3-core-promievent@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.7.5.tgz#56a9b06a20e20a0a89d2ab7f88d44c8ae01d5b62" + integrity sha512-uZ1VRErVuhiLtHlyt3oEH/JSvAf6bWPndChHR9PG7i1Zfqm6ZVCeM91ICTPmiL8ddsGQOxASpnJk4vhApcTIww== dependencies: eventemitter3 "4.0.4" -web3-core-requestmanager@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.6.0.tgz#8ef3a3b89cd08983bd94574f9c5893f70a8a6aea" - integrity sha512-CY5paPdiDXKTXPWaEUZekDfUXSuoE2vPxolwqzsvKwFWH5+H1NaXgrc+D5HpufgSvTXawTw0fy7IAicg8+PWqA== +web3-core-requestmanager@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.7.5.tgz#be18fc99642689aeb2e016fa43fb47bb9e8c94ce" + integrity sha512-3KpfxW/wVH4mgwWEsSJGHKrtRVoijWlDxtUrm17xgtqRNZ2mFolifKnHAUKa0fY48C9CrxmcCiMIi3W4G6WYRw== dependencies: util "^0.12.0" - web3-core-helpers "1.6.0" - web3-providers-http "1.6.0" - web3-providers-ipc "1.6.0" - web3-providers-ws "1.6.0" + web3-core-helpers "1.7.5" + web3-providers-http "1.7.5" + web3-providers-ipc "1.7.5" + web3-providers-ws "1.7.5" -web3-core-subscriptions@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.6.0.tgz#8c23b15b434a7c9f937652ecca45d7108e2c54df" - integrity sha512-kY9WZUY/m1URSOv3uTLshoZD9ZDiFKReIzHuPUkxFpD5oYNmr1/aPQNPCrrMxKODR7UVX/D90FxWwCYqHhLaxQ== +web3-core-subscriptions@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.7.5.tgz#c0e25610768ea9d9f9107b4ac74b6b6573125e00" + integrity sha512-YK6utQ7Wwjbe4XZOIA8quWGBPi1lFDS1A+jQYwxKKrCvm6BloBNc3FhvrcSYlDhLe/kOy8+2Je8i9amndgT4ww== dependencies: eventemitter3 "4.0.4" - web3-core-helpers "1.6.0" + web3-core-helpers "1.7.5" -web3-core@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.6.0.tgz#144eb00f651c9812faf7176abd7ee99d5f45e212" - integrity sha512-o0WsLrJ2yD+HAAc29lGMWJef/MutTyuzpJC0UzLJtIAQJqtpDalzWINEu4j8XYXGk34N/V6vudtzRPo23QEE6g== +web3-core@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.7.5.tgz#8ee2ca490230a30ca970cb9f308eb65b76405e1d" + integrity sha512-UgOWXZr1fR/3cUQJKWbfMwRxj1/N7o6RSd/dHqdXBlOD+62EjNZItFmLRg5veq5kp9YfXzrNw9bnDkXfsL+nKQ== dependencies: - "@types/bn.js" "^4.11.5" + "@types/bn.js" "^5.1.0" "@types/node" "^12.12.6" bignumber.js "^9.0.0" - web3-core-helpers "1.6.0" - web3-core-method "1.6.0" - web3-core-requestmanager "1.6.0" - web3-utils "1.6.0" + web3-core-helpers "1.7.5" + web3-core-method "1.7.5" + web3-core-requestmanager "1.7.5" + web3-utils "1.7.5" -web3-eth-abi@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.6.0.tgz#4225608f61ebb0607d80849bb2b20f910780253d" - integrity sha512-fImomGE9McuTMJLwK8Tp0lTUzXqCkWeMm00qPVIwpJ/h7lCw9UFYV9+4m29wSqW6FF+FIZKwc6UBEf9dlx3orA== +web3-eth-abi@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.7.5.tgz#db9d6dbcc043a6e922252f3228686e9bbd50d7c9" + integrity sha512-qWHvF7sayxql9BD1yqK9sZRLBQ66eJzGeaU53Y1PRq2iFPrhY6NUWxQ3c3ps0rg+dyObvRbloviWpKXcS4RE/A== dependencies: - "@ethersproject/abi" "5.0.7" - web3-utils "1.6.0" + "@ethersproject/abi" "^5.6.3" + web3-utils "1.7.5" -web3-eth-accounts@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.6.0.tgz#530927f4c5b78df93b3ea1203abbb467de29cd04" - integrity sha512-2f6HS4KIH4laAsNCOfbNX3dRiQosqSY2TRK86C8jtAA/QKGdx+5qlPfYzbI2RjG81iayb2+mVbHIaEaBGZ8sGw== +web3-eth-accounts@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.7.5.tgz#b37ee3aeebcc6bce3337636aeb272cbba0ece547" + integrity sha512-AzMLoTj3RGwKpyp3x3TtHrEeU4VpR99iMOD6NKrWSDumS6QEi0lCo+y7QZhdTlINw3iIA3SFIdvbAOO4NCHSDg== dependencies: - "@ethereumjs/common" "^2.3.0" - "@ethereumjs/tx" "^3.2.1" + "@ethereumjs/common" "^2.5.0" + "@ethereumjs/tx" "^3.3.2" crypto-browserify "3.12.0" eth-lib "0.2.8" ethereumjs-util "^7.0.10" scrypt-js "^3.0.1" uuid "3.3.2" - web3-core "1.6.0" - web3-core-helpers "1.6.0" - web3-core-method "1.6.0" - web3-utils "1.6.0" + web3-core "1.7.5" + web3-core-helpers "1.7.5" + web3-core-method "1.7.5" + web3-utils "1.7.5" -web3-eth-contract@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.6.0.tgz#deb946867ad86d32bcbba899d733b681b25ea674" - integrity sha512-ZUtO77zFnxuFtrc+D+iJ3AzNgFXAVcKnhEYN7f1PNz/mFjbtE6dJ+ujO0mvMbxIZF02t9IZv0CIXRpK0rDvZAw== - dependencies: - "@types/bn.js" "^4.11.5" - web3-core "1.6.0" - web3-core-helpers "1.6.0" - web3-core-method "1.6.0" - web3-core-promievent "1.6.0" - web3-core-subscriptions "1.6.0" - web3-eth-abi "1.6.0" - web3-utils "1.6.0" - -web3-eth-ens@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.6.0.tgz#af13852168d56fa71b9198eb097e96fb93831c2a" - integrity sha512-AG24PNv9qbYHSpjHcU2pViOII0jvIR7TeojJ2bxXSDqfcgHuRp3NZGKv6xFvT4uNI4LEQHUhSC7bzHoNF5t8CA== +web3-eth-contract@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.7.5.tgz#a032419579bcec062513a3d089ad0e89ac63d731" + integrity sha512-qab7NPJRKRlTs58ozsqK8YIEwWpxIm3vD/okSIKBGkFx5gIHWW+vGmMh5PDSfefLJM9rCd+T+Lc0LYvtME7uqg== + dependencies: + "@types/bn.js" "^5.1.0" + web3-core "1.7.5" + web3-core-helpers "1.7.5" + web3-core-method "1.7.5" + web3-core-promievent "1.7.5" + web3-core-subscriptions "1.7.5" + web3-eth-abi "1.7.5" + web3-utils "1.7.5" + +web3-eth-ens@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.7.5.tgz#fa0e287f5e6fae20531117b7467e21b482d58cab" + integrity sha512-k1Q0msdRv/wac2egpZBIwG3n/sa/KdrVmVJvFm471gLTL4xfUizV5qJjkDVf+ikf9JyDvWJTs5eWNUUbOFIw/A== dependencies: content-hash "^2.5.2" eth-ens-namehash "2.0.8" - web3-core "1.6.0" - web3-core-helpers "1.6.0" - web3-core-promievent "1.6.0" - web3-eth-abi "1.6.0" - web3-eth-contract "1.6.0" - web3-utils "1.6.0" - -web3-eth-iban@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.6.0.tgz#edbe46cedc5b148d53fa455edea6b4eef53b2be7" - integrity sha512-HM/bKBS/e8qg0+Eh7B8C/JVG+GkR4AJty17DKRuwMtrh78YsonPj7GKt99zS4n5sDLFww1Imu/ZIk3+K5uJCjw== + web3-core "1.7.5" + web3-core-helpers "1.7.5" + web3-core-promievent "1.7.5" + web3-eth-abi "1.7.5" + web3-eth-contract "1.7.5" + web3-utils "1.7.5" + +web3-eth-iban@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.7.5.tgz#1a50efa42cabf1b731396d38bef6a8bf92b5ee1f" + integrity sha512-mn2W5t/1IpL8OZvzAabLKT4kvwRnZSJ9K0tctndl9sDNWkfITYQibEEhUaNNA50Q5fJKgVudHI/m0gwIVTyG8Q== dependencies: - bn.js "^4.11.9" - web3-utils "1.6.0" + bn.js "^5.2.1" + web3-utils "1.7.5" -web3-eth-personal@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.6.0.tgz#b75a61c0737b8b8bcc11d05db2ed7bfce7e4b262" - integrity sha512-8ohf4qAwbShf4RwES2tLHVqa+pHZnS5Q6tV80sU//bivmlZeyO1W4UWyNn59vu9KPpEYvLseOOC6Muxuvr8mFQ== +web3-eth-personal@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.7.5.tgz#615a3ddcf97aeea93e2a4569753c033fd7a495c5" + integrity sha512-txh2P/eN8I4AOUKFi9++KKddoD0tWfCuu9Y1Kc41jSRbk6smO88Fum0KWNmYFYhSCX2qiknS1DfqsONl3igoKQ== dependencies: "@types/node" "^12.12.6" - web3-core "1.6.0" - web3-core-helpers "1.6.0" - web3-core-method "1.6.0" - web3-net "1.6.0" - web3-utils "1.6.0" + web3-core "1.7.5" + web3-core-helpers "1.7.5" + web3-core-method "1.7.5" + web3-net "1.7.5" + web3-utils "1.7.5" -web3-eth@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.6.0.tgz#4c9d5fb4eccf9f8744828281757e6ea76af58cbd" - integrity sha512-qJMvai//r0be6I9ghU24/152f0zgJfYC23TMszN3Y6jse1JtjCBP2TlTibFcvkUN1RRdIUY5giqO7ZqAYAmp7w== - dependencies: - web3-core "1.6.0" - web3-core-helpers "1.6.0" - web3-core-method "1.6.0" - web3-core-subscriptions "1.6.0" - web3-eth-abi "1.6.0" - web3-eth-accounts "1.6.0" - web3-eth-contract "1.6.0" - web3-eth-ens "1.6.0" - web3-eth-iban "1.6.0" - web3-eth-personal "1.6.0" - web3-net "1.6.0" - web3-utils "1.6.0" - -web3-net@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.6.0.tgz#2c28f8787073110a7c2310336889d2dad647e500" - integrity sha512-LFfG95ovTT2sNHkO1TEfsaKpYcxOSUtbuwHQ0K3G0e5nevKDJkPEFIqIcob40yiwcWoqEjENJP9Bjk8CRrZ99Q== +web3-eth@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.7.5.tgz#36906f50a6c35570cbc08871a33caa83dc131c9c" + integrity sha512-BucjvqZyDWYkGlsFX+OnOBub0YutlC1KZiNGibdmvtNX0NQK+8iw1uzAoL9yTTwCSszL7lnkFe8N+HCOl9B4Dw== + dependencies: + web3-core "1.7.5" + web3-core-helpers "1.7.5" + web3-core-method "1.7.5" + web3-core-subscriptions "1.7.5" + web3-eth-abi "1.7.5" + web3-eth-accounts "1.7.5" + web3-eth-contract "1.7.5" + web3-eth-ens "1.7.5" + web3-eth-iban "1.7.5" + web3-eth-personal "1.7.5" + web3-net "1.7.5" + web3-utils "1.7.5" + +web3-net@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.7.5.tgz#87fbc00a9ca40515bf60c847c0092498887cfdc8" + integrity sha512-xwuCb2YWw49PmW81AJQ/G+Xi2ikRsYyZXSgyPt4LmZuKjiqg/6kSdK8lZvUi3Pi3wM+QDBXbpr73M/WEkW0KvA== dependencies: - web3-core "1.6.0" - web3-core-method "1.6.0" - web3-utils "1.6.0" + web3-core "1.7.5" + web3-core-method "1.7.5" + web3-utils "1.7.5" -web3-providers-http@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.6.0.tgz#8db4e589abf7197f5d65b12af1bf9726c45f4160" - integrity sha512-sNxHFNv3lnxpmULt34AS6M36IYB/Hzm2Et4yPNzdP1XE644D8sQBZQZaJQdTaza5HfrlwoqU6AOK935armqGuA== +web3-providers-http@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.7.5.tgz#144bb0c29007d1b766bafb0e20f80be050c7aa80" + integrity sha512-vPgr4Kzy0M3CHtoP/Bh7qwK/D9h2fhjpoqctdMWVJseOfeTgfOphCKN0uwV8w2VpZgDPXA8aeTdBx5OjmDdStA== dependencies: - web3-core-helpers "1.6.0" - xhr2-cookies "1.1.0" + abortcontroller-polyfill "^1.7.3" + cross-fetch "^3.1.4" + es6-promise "^4.2.8" + web3-core-helpers "1.7.5" -web3-providers-ipc@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.6.0.tgz#6a3410fd47a67c4a36719fb97f99534ae12aac98" - integrity sha512-ETYdfhpGiGoWpmmSJnONvnPfd3TPivHEGjXyuX+L5FUsbMOVZj9MFLNIS19Cx/YGL8UWJ/8alLJoTcWSIdz/aA== +web3-providers-ipc@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.7.5.tgz#5b0f9b4f7340416953b8816d2e42e3f548d47372" + integrity sha512-aNHx+RAROzO+apDEzy8Zncj78iqWBadIXtpmFDg7uiTn8i+oO+IcP1Yni7jyzkltsysVJHgHWG4kPx50ANCK3Q== dependencies: oboe "2.1.5" - web3-core-helpers "1.6.0" + web3-core-helpers "1.7.5" -web3-providers-ws@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.6.0.tgz#dc15dc18c30089efda992015fd5254bd2b77af5f" - integrity sha512-eNRmlhOPCpuVYwBrKBBQRLGPFb4U1Uo44r9EWV69Cpo4gP6XeBTl6nkawhLz6DS0fq79apyPfItJVuSfAy77pA== +web3-providers-ws@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.7.5.tgz#196b9e56a4a48f9bee54def56875ea53dec7c711" + integrity sha512-9uJNVVkIGC8PmM9kNbgPth56HDMSSsxZh3ZEENdwO3LNWemaADiQYUDCsD/dMVkn0xsGLHP5dgAy4Q5msqySLg== dependencies: eventemitter3 "4.0.4" - web3-core-helpers "1.6.0" + web3-core-helpers "1.7.5" websocket "^1.0.32" -web3-shh@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.6.0.tgz#838a3435dce1039f669a48e53e948062de197931" - integrity sha512-ymN0OFL81WtEeSyb+PFpuUv39fR3frGwsZnIg5EVPZvrOIdaDSFcGSLDmafUt0vKSubvLMVYIBOCskRD6YdtEQ== +web3-shh@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.7.5.tgz#742e27f5c44bea6d7adef3a49b085e0fcd6aa621" + integrity sha512-aCIWJyLMH5H76OybU4ZpUCJ93yNOPATGhJ+KboRPU8QZDzS2CcVhtEzyl27bbvw+rSnVroMLqBgTXBB4mmKI7A== dependencies: - web3-core "1.6.0" - web3-core-method "1.6.0" - web3-core-subscriptions "1.6.0" - web3-net "1.6.0" + web3-core "1.7.5" + web3-core-method "1.7.5" + web3-core-subscriptions "1.7.5" + web3-net "1.7.5" -web3-utils@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.6.0.tgz#1975c5ee5b7db8a0836eb7004848a7cd962d1ddc" - integrity sha512-bgCAWAeQnJF035YTFxrcHJ5mGEfTi/McsjqldZiXRwlHK7L1PyOqvXiQLE053dlzvy1kdAxWl/sSSfLMyNUAXg== +web3-utils@1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.7.5.tgz#081a952ac6e0322e25ac97b37358a43c7372ef6a" + integrity sha512-9AqNOziQky4wNQadEwEfHiBdOZqopIHzQQVzmvvv6fJwDSMhP+khqmAZC7YTiGjs0MboyZ8tWNivqSO1699XQw== dependencies: - bn.js "^4.11.9" + bn.js "^5.2.1" ethereum-bloom-filters "^1.0.6" ethereumjs-util "^7.1.0" ethjs-unit "0.1.6" @@ -23653,18 +23879,18 @@ web3-utils@1.6.0: randombytes "^2.1.0" utf8 "3.0.0" -web3@^1.5.1: - version "1.6.0" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.6.0.tgz#d8fa0cd9e7bf252f9fe43bb77dc42bc6671affde" - integrity sha512-rWpXnO88MiVX5yTRqMBCVKASxc7QDkXZZUl1D48sKlbX4dt3BAV+nVMVUKCBKiluZ5Bp8pDrVCUdPx/jIYai5Q== +web3@^1.7.5: + version "1.7.5" + resolved "https://registry.yarnpkg.com/web3/-/web3-1.7.5.tgz#4e185d2058195b5775109b3f27cdea65a34a036e" + integrity sha512-3jHZTWyXt975AOXgnZKayiSWDLpoSKk9fZtLk1hURQtt7AdSbXPT8AK9ooBCm0Dt3GYaOeNcHGaiHC3gtyqhLg== dependencies: - web3-bzz "1.6.0" - web3-core "1.6.0" - web3-eth "1.6.0" - web3-eth-personal "1.6.0" - web3-net "1.6.0" - web3-shh "1.6.0" - web3-utils "1.6.0" + web3-bzz "1.7.5" + web3-core "1.7.5" + web3-eth "1.7.5" + web3-eth-personal "1.7.5" + web3-net "1.7.5" + web3-shh "1.7.5" + web3-utils "1.7.5" webidl-conversions@^3.0.0: version "3.0.1" @@ -24233,13 +24459,6 @@ xhr-request@^1.0.1, xhr-request@^1.1.0: url-set-query "^1.0.0" xhr "^2.0.4" -xhr2-cookies@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz#7d77449d0999197f155cb73b23df72505ed89d48" - integrity sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg= - dependencies: - cookiejar "^2.1.1" - xhr@^2.0.4, xhr@^2.3.3, xhr@^2.5.0: version "2.6.0" resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.6.0.tgz#b69d4395e792b4173d6b7df077f0fc5e4e2b249d" From 23a088d18b0d6d8c5c4c9fbf126429d9f619337b Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 8 Aug 2022 12:11:39 +0200 Subject: [PATCH 138/179] fix handling basefeepergas --- .../debugger-ui/src/lib/vm-debugger/global-variables.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx index 98713182cd..7cd7dc58de 100644 --- a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx @@ -1,6 +1,7 @@ import React from 'react' // eslint-disable-line import DropdownPanel from './dropdown-panel' // eslint-disable-line import { BN } from 'ethereumjs-util' +import Web3 from 'web3' export const GlobalVariables = ({ block, receipt, tx }) => { // see https://docs.soliditylang.org/en/latest/units-and-global-variables.html#block-and-transaction-properties @@ -17,7 +18,7 @@ export const GlobalVariables = ({ block, receipt, tx }) => { 'tx.origin': tx.from } if (block.baseFeePerGas) { - globals['block.basefee'] = (new BN(block.baseFeePerGas.replace('0x', ''), 'hex')).toString(10) + ` Wei (${block.baseFeePerGas})` + globals['block.basefee'] = (Web3.utils.toBN(block.baseFeePerGas)) + ` Wei (${block.baseFeePerGas})` //(new BN(block.baseFeePerGas.replace('0x', ''), 'hex')).toString(10) + ` Wei (${block.baseFeePerGas})` } return ( From 9cd0326b87ec55eced5e8b74d0fc5e9c27250af0 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Aug 2022 14:59:31 +0200 Subject: [PATCH 139/179] update vyper compiler URL --- apps/vyper/src/app/app.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/vyper/src/app/app.tsx b/apps/vyper/src/app/app.tsx index e11684d409..a6ce7c9db9 100644 --- a/apps/vyper/src/app/app.tsx +++ b/apps/vyper/src/app/app.tsx @@ -59,7 +59,7 @@ const App: React.FC = () => { function compilerUrl() { return state.environment === 'remote' - ? 'https://vyper.live/compile' + ? 'https://vyper.remixproject.org/compile' : state.localUrl } From 9d5288580d54c147a03a68fda3ada8f2c04b01c8 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 8 Aug 2022 15:21:27 +0200 Subject: [PATCH 140/179] Update global-variables.tsx --- .../debugger-ui/src/lib/vm-debugger/global-variables.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx index 7cd7dc58de..413ef52b35 100644 --- a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx @@ -18,7 +18,7 @@ export const GlobalVariables = ({ block, receipt, tx }) => { 'tx.origin': tx.from } if (block.baseFeePerGas) { - globals['block.basefee'] = (Web3.utils.toBN(block.baseFeePerGas)) + ` Wei (${block.baseFeePerGas})` //(new BN(block.baseFeePerGas.replace('0x', ''), 'hex')).toString(10) + ` Wei (${block.baseFeePerGas})` + globals['block.basefee'] = (Web3.utils.toBN(block.baseFeePerGas)) + ` Wei (${block.baseFeePerGas})` } return ( From 4b59f5bf905c4af776e0a52866009f1f95f8e985 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 8 Aug 2022 15:23:14 +0200 Subject: [PATCH 141/179] to string --- .../debugger-ui/src/lib/vm-debugger/global-variables.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx index 7cd7dc58de..2f87545d91 100644 --- a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx @@ -18,7 +18,7 @@ export const GlobalVariables = ({ block, receipt, tx }) => { 'tx.origin': tx.from } if (block.baseFeePerGas) { - globals['block.basefee'] = (Web3.utils.toBN(block.baseFeePerGas)) + ` Wei (${block.baseFeePerGas})` //(new BN(block.baseFeePerGas.replace('0x', ''), 'hex')).toString(10) + ` Wei (${block.baseFeePerGas})` + globals['block.basefee'] = Web3.utils.toBN(block.baseFeePerGas).toString(10) + ` Wei (${block.baseFeePerGas})` //(new BN(block.baseFeePerGas.replace('0x', ''), 'hex')).toString(10) + ` Wei (${block.baseFeePerGas})` } return ( From fc0cf81fb6abaaded1c9468b96bf693f1b3e4f64 Mon Sep 17 00:00:00 2001 From: ryestew Date: Mon, 8 Aug 2022 16:11:34 +0200 Subject: [PATCH 142/179] update security message --- libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx b/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx index 2690dfc840..7266b0d90c 100644 --- a/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx +++ b/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx @@ -237,7 +237,7 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
- Scam Alert: Beware of online videos promoting "liquidity front runner bots". + Scam Alert: There are video tutorials going around that provide urls other than remix.ethereum.org, and could be scams. Also, beware of online videos promoting "liquidity front runner bots". Learn more
From 9393f4dcad720520c0d0fa0130f82831a50f03c6 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Aug 2022 12:47:17 +0200 Subject: [PATCH 143/179] fix logging to the terminal --- apps/remix-ide-e2e/src/tests/terminal.test.ts | 40 ++++++++++++++++++- .../terminal/src/lib/remix-ui-terminal.tsx | 12 +++++- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/terminal.test.ts b/apps/remix-ide-e2e/src/tests/terminal.test.ts index e7d76869e0..f944b453f9 100644 --- a/apps/remix-ide-e2e/src/tests/terminal.test.ts +++ b/apps/remix-ide-e2e/src/tests/terminal.test.ts @@ -200,7 +200,31 @@ module.exports = { .sendKeys('body', [browser.Keys.CONTROL, browser.Keys.SHIFT, 's']) .pause(15000) .journalLastChildIncludes('147') - } + }, + + 'Should run a script which log transaction and block using web3.js and ethers #group7': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('udapp') + .switchEnvironment('External Http Provider') + .waitForElementPresent('[data-id="basic-http-provider-modal-footer-ok-react"]') + .execute(() => { + (document.querySelector('*[data-id="basic-http-providerModalDialogContainer-react"] input[data-id="modalDialogCustomPromp"]') as any).focus() + }, [], () => {}) + .setValue('[data-id="modalDialogCustomPromp"]', 'https://remix-goerli.ethdevops.io') + .modalFooterOKClick('basic-http-provider') + .clickLaunchIcon('filePanel') + .openFile('README.txt') + .addFile('scripts/log_tx_block.js', { content: scriptBlockAndTransaction } ) + .pause(1000) + .executeScriptInTerminal('remix.execute(\'scripts/log_tx_block.js\')') + .pause(10000) + // check if the input of the transaction is being logged (web3 call) + .journalChildIncludes('0x775526410000000000000000000000000000000000000000000000000000000000000060464c0335b2f1609abd9de25141c0a3b49db516fc7375970dc737c32b986e88e3000000000000000000000000000000000000000000000000000000000000039e000000000000000000000000000000000000000000000000000000000000000602926b30b10e7a514d92bc71e085f5bff2687fac2856ae43ef7621bf1756fa370516d310bec5727543089be9a4d5f68471174ee528e95a2520b0ca36c2b6c6eb0000000000000000000000000000000000000000000000000000000000046f49036f5e4ea4dd042801c8841e3db8e654124305da0f11824fc1db60c405dbb39f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000') + // check if the logsBloom is being logged (web3 call) + .journalChildIncludes('0x00000000000000000000000000100000000000000000020000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000040000000060000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000100000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000001') + // check if the logsBloom is being logged (ethers.js call) + .journalChildIncludes('"hex":"0x025cd8"') + } } const asyncAwait = ` @@ -605,3 +629,17 @@ const scriptAutoExec = { })() ` } + +const scriptBlockAndTransaction = ` +// Right click on the script name and hit "Run" to execute +(async () => { + try { + web3.eth.getTransaction('0x022ccd55747677ac50f8d9dfd1bf5b843fa2f36438a28c1d0a0958e057bb3e2a').then(console.log) + web3.eth.getBlock('7367447').then(console.log); + let ethersProvider = new ethers.providers.Web3Provider(web3Provider) + ethersProvider.getBlock(7367447).then(console.log) + } catch (e) { + console.log(e.message) + } +})() +` 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 f8eae05bb5..d8cbe6d610 100644 --- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx +++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx @@ -543,17 +543,25 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { }) } else if (Array.isArray(x.message)) { return x.message.map((msg, i) => { + if (!msg) msg = 'null' if (React.isValidElement(msg)) { return (
{ msg }
) } else if (typeof msg === 'object') { + let stringified + try { + stringified = JSON.stringify(msg) + } catch (e) { + console.error(e) + stringified = '< value not displayable >' + } return ( -
{ msg.value && typeof msg.value !== 'object' ? parse(msg.value) : JSON.stringify(msg) }
+
{ stringified }
) } else { return ( -
{msg? msg.toString() : null}
+
{msg ? msg.toString() : null}
) } }) From 5b779bcbc5b14ba9d6e8b96e4dde97b7ca6e1980 Mon Sep 17 00:00:00 2001 From: David Disu Date: Fri, 5 Aug 2022 11:16:25 +0100 Subject: [PATCH 144/179] Exit process if error is found --- libs/remix-tests/src/run.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/remix-tests/src/run.ts b/libs/remix-tests/src/run.ts index d428b2d6f2..db6f21780e 100644 --- a/libs/remix-tests/src/run.ts +++ b/libs/remix-tests/src/run.ts @@ -64,7 +64,7 @@ commander // If path is for a file, file name must have `_test.sol` suffix if (!isDirectory && !testsPath.endsWith('_test.sol')) { log.error('Test filename should end with "_test.sol"') - process.exit() + process.exit(1) } // Console message @@ -85,7 +85,7 @@ commander const compString = releases ? releases[compVersion] : null if (!compString) { log.error(`No compiler found in releases with version ${compVersion}`) - process.exit() + process.exit(1) } else { compilerConfig.currentCompilerUrl = compString.replace('soljson-', '').replace('.js', '') log.info(`Compiler version set to ${compVersion}. Latest version is ${latestRelease}`) @@ -105,7 +105,7 @@ commander if (commander.runs) { if (!commander.optimize) { log.error('Optimization should be enabled for runs') - process.exit() + process.exit(1) } compilerConfig.runs = commander.runs log.info(`Runs set to ${compilerConfig.runs}`) @@ -116,12 +116,14 @@ commander await provider.init() web3.setProvider(provider) extend(web3) - runTestFiles(path.resolve(testsPath), isDirectory, web3, compilerConfig) + runTestFiles(path.resolve(testsPath), isDirectory, web3, compilerConfig, (error) => { + if (error) process.exit(1) + }) }) if (!process.argv.slice(2).length) { log.error('Please specify a file or directory path') - process.exit() + process.exit(1) } commander.parse(process.argv) From 932baed8402e95896bdc5acff6655ce7acabc813 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 3 Aug 2022 15:12:08 +0100 Subject: [PATCH 145/179] fix css bug --- .../run-tab/src/lib/components/recorderCardUI.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx index 8cbb9ef0de..f8dadd5949 100644 --- a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx @@ -28,16 +28,16 @@ export function RecorderUI (props: RecorderProps) { return (
-
+
-
{props.count}
+
{props.count}
Save transactions (deployed contracts and function executions) and replay them in another environment.
e.g Transactions created in Remix VM can be replayed in the Injected Provider.
}> - +
@@ -56,7 +56,7 @@ export function RecorderUI (props: RecorderProps) { }> -
+
@@ -72,7 +72,7 @@ export function RecorderUI (props: RecorderProps) { }> -
+
) From 5a8ffd6755c43df61bf8add31279af92d1864e5f Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 3 Aug 2022 15:18:12 +0100 Subject: [PATCH 146/179] fix caret position --- libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx index f8dadd5949..e9c3250010 100644 --- a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx @@ -40,7 +40,7 @@ export function RecorderUI (props: RecorderProps) {
-
+
From 37cdd147a38041296b321e971d69af29b73d6c46 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 3 Aug 2022 15:34:39 +0100 Subject: [PATCH 147/179] finish fix --- libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx index e9c3250010..6108a7f1b8 100644 --- a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx @@ -25,6 +25,7 @@ export function RecorderUI (props: RecorderProps) { setToggleExpander(!toggleExpander) } + return (
From 2dc77da228c453adb4742480caa31cb5311ce247 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 3 Aug 2022 20:48:56 +0100 Subject: [PATCH 148/179] fix firefox failing sidePanelTest --- apps/remix-ide-e2e/src/tests/pluginManager.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/pluginManager.test.ts b/apps/remix-ide-e2e/src/tests/pluginManager.test.ts index 48f3ae29d8..ab89372ad6 100644 --- a/apps/remix-ide-e2e/src/tests/pluginManager.test.ts +++ b/apps/remix-ide-e2e/src/tests/pluginManager.test.ts @@ -109,7 +109,7 @@ module.exports = { 'Should load back installed plugins after reload': function (browser: NightwatchBrowser) { browser - .waitForElementVisible('*[data-id="remixIdeSidePanel"]') + .waitForElementVisible('*[data-id="remixIdeSidePanel"]',3000) .waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]') .getInstalledPlugins((plugins) => { browser.refresh() From 8b9aa8a0a7c2f05ea76cd407b7db0b57de6a4f5a Mon Sep 17 00:00:00 2001 From: dark64 Date: Wed, 3 Aug 2022 12:13:46 +0200 Subject: [PATCH 149/179] add zokrates syntax highlighting for monaco --- libs/remix-ui/editor/src/lib/cairoSyntax.ts | 133 ---------------- .../editor/src/lib/remix-ui-editor.tsx | 20 ++- .../remix-ui/editor/src/lib/syntaxes/cairo.ts | 132 ++++++++++++++++ .../lib/{syntax.ts => syntaxes/solidity.ts} | 4 +- .../editor/src/lib/syntaxes/zokrates.ts | 144 ++++++++++++++++++ 5 files changed, 292 insertions(+), 141 deletions(-) delete mode 100644 libs/remix-ui/editor/src/lib/cairoSyntax.ts create mode 100644 libs/remix-ui/editor/src/lib/syntaxes/cairo.ts rename libs/remix-ui/editor/src/lib/{syntax.ts => syntaxes/solidity.ts} (99%) create mode 100644 libs/remix-ui/editor/src/lib/syntaxes/zokrates.ts diff --git a/libs/remix-ui/editor/src/lib/cairoSyntax.ts b/libs/remix-ui/editor/src/lib/cairoSyntax.ts deleted file mode 100644 index c467b32a64..0000000000 --- a/libs/remix-ui/editor/src/lib/cairoSyntax.ts +++ /dev/null @@ -1,133 +0,0 @@ -/* eslint-disable */ -export const cairoConf = { - comments: { - lineComment: '#' - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'], - ['%{', '%}'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '%{', close: '%}' }, - { open: "'", close: "'", notIn: ['string', 'comment'] } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '%{', close: '%}' }, - { open: "'", close: "'" } - ] -} - - -export const cairoLang = { - defaultToken: '', - tokenPostfix: '.cairo', - - brackets: [ - { token: 'delimiter.curly', open: '{', close: '}' }, - { token: 'delimiter.parenthesis', open: '(', close: ')' }, - { token: 'delimiter.square', open: '[', close: ']' }, - { token: 'delimiter.curly', open: '%{', close: '%}' } - ], - - keywords: [ - // control - 'if', - 'else', - 'end', - - // meta - 'alloc_locals', - 'as', - 'assert', - 'cast', - 'const', - 'dw', - 'felt', - 'from', - 'func', - 'import', - 'let', - 'local', - 'member', - 'nondet', - 'return', - 'static_assert', - 'struct', - 'tempvar', - 'with_attr', - 'with', - - // register - 'ap', - 'fp', - - // opcode - 'call', - 'jmp', - 'ret', - 'abs', - 'rel' - ], - - operators: ['=', ':', '==', '++', '+', '-', '*', '**', '/', '&', '%', '_'], - - // we include these common regular expressions - symbols: /[=>](?!@symbols)/, '@brackets'], - [ - /@symbols/, - { - cases: { - '@operators': 'delimiter', - '@default': '' - } - } - ], - - // numbers - [/(@numberHex)/, 'number.hex'], - [/(@numberDecimal)/, 'number'], - - // strings - [/'[^']*'/, 'string'] - ], - - whitespace: [ - [/\s+/, 'white'], - [/(^#.*$)/, 'comment'] - ] - } -} 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 0b5b950180..30e8323faf 100644 --- a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx +++ b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx @@ -2,8 +2,9 @@ import React, { useState, useRef, useEffect, useReducer } from 'react' // eslint import { RemixUiEditorContextView, astNode } from '@remix-ui/editor-context-view' import Editor, { loader } from '@monaco-editor/react' import { reducerActions, reducerListener, initialState } from './actions/editor' -import { language, conf } from './syntax' -import { cairoLang, cairoConf } from './cairoSyntax' +import { solidityTokensProvider, solidityLanguageConfig } from './syntaxes/solidity' +import { cairoTokensProvider, cairoLanguageConfig } from './syntaxes/cairo' +import { zokratesTokensProvider, zokratesLanguageConfig } from './syntaxes/zokrates' import './remix-ui-editor.css' import { loadTypes } from './web-types' @@ -255,6 +256,8 @@ export const EditorUI = (props: EditorUIProps) => { monacoRef.current.editor.setModelLanguage(file.model, 'remix-solidity') } else if (file.language === 'cairo') { monacoRef.current.editor.setModelLanguage(file.model, 'remix-cairo') + } else if (file.language === 'zokrates') { + monacoRef.current.editor.setModelLanguage(file.model, 'remix-zokrates') } }, [props.currentFile]) @@ -464,12 +467,17 @@ export const EditorUI = (props: EditorUIProps) => { // Register a new language monacoRef.current.languages.register({ id: 'remix-solidity' }) monacoRef.current.languages.register({ id: 'remix-cairo' }) + monacoRef.current.languages.register({ id: 'remix-zokrates' }) + // Register a tokens provider for the language - monacoRef.current.languages.setMonarchTokensProvider('remix-solidity', language) - monacoRef.current.languages.setLanguageConfiguration('remix-solidity', conf) + monacoRef.current.languages.setMonarchTokensProvider('remix-solidity', solidityTokensProvider) + monacoRef.current.languages.setLanguageConfiguration('remix-solidity', solidityLanguageConfig) + + monacoRef.current.languages.setMonarchTokensProvider('remix-cairo', cairoTokensProvider) + monacoRef.current.languages.setLanguageConfiguration('remix-cairo', cairoLanguageConfig) - monacoRef.current.languages.setMonarchTokensProvider('remix-cairo', cairoLang) - monacoRef.current.languages.setLanguageConfiguration('remix-cairo', cairoConf) + monacoRef.current.languages.setMonarchTokensProvider('remix-zokrates', zokratesTokensProvider) + monacoRef.current.languages.setLanguageConfiguration('remix-zokrates', zokratesLanguageConfig) loadTypes(monacoRef.current) } diff --git a/libs/remix-ui/editor/src/lib/syntaxes/cairo.ts b/libs/remix-ui/editor/src/lib/syntaxes/cairo.ts new file mode 100644 index 0000000000..f6550946d3 --- /dev/null +++ b/libs/remix-ui/editor/src/lib/syntaxes/cairo.ts @@ -0,0 +1,132 @@ +/* eslint-disable */ +export const cairoLanguageConfig = { + comments: { + lineComment: "#", + }, + brackets: [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["%{", "%}"], + ], + autoClosingPairs: [ + { open: "{", close: "}" }, + { open: "[", close: "]" }, + { open: "(", close: ")" }, + { open: "%{", close: "%}" }, + { open: "'", close: "'", notIn: ["string", "comment"] }, + ], + surroundingPairs: [ + { open: "{", close: "}" }, + { open: "[", close: "]" }, + { open: "(", close: ")" }, + { open: "%{", close: "%}" }, + { open: "'", close: "'" }, + ], +} + +export const cairoTokensProvider = { + defaultToken: "", + tokenPostfix: ".cairo", + + brackets: [ + { token: "delimiter.curly", open: "{", close: "}" }, + { token: "delimiter.parenthesis", open: "(", close: ")" }, + { token: "delimiter.square", open: "[", close: "]" }, + { token: "delimiter.curly", open: "%{", close: "%}" }, + ], + + keywords: [ + // control + "if", + "else", + "end", + + // meta + "alloc_locals", + "as", + "assert", + "cast", + "const", + "dw", + "felt", + "from", + "func", + "import", + "let", + "local", + "member", + "nondet", + "return", + "static_assert", + "struct", + "tempvar", + "with_attr", + "with", + + // register + "ap", + "fp", + + // opcode + "call", + "jmp", + "ret", + "abs", + "rel", + ], + + operators: ["=", ":", "==", "++", "+", "-", "*", "**", "/", "&", "%", "_"], + + // we include these common regular expressions + symbols: /[=>](?!@symbols)/, "@brackets"], + [ + /@symbols/, + { + cases: { + "@operators": "delimiter", + "@default": "", + }, + }, + ], + + // numbers + [/(@numberHex)/, "number.hex"], + [/(@numberDecimal)/, "number"], + + // strings + [/'[^']*'/, "string"], + ], + + whitespace: [ + [/\s+/, "white"], + [/(^#.*$)/, "comment"], + ], + }, +} diff --git a/libs/remix-ui/editor/src/lib/syntax.ts b/libs/remix-ui/editor/src/lib/syntaxes/solidity.ts similarity index 99% rename from libs/remix-ui/editor/src/lib/syntax.ts rename to libs/remix-ui/editor/src/lib/syntaxes/solidity.ts index 121dced50f..dfb388fda4 100644 --- a/libs/remix-ui/editor/src/lib/syntax.ts +++ b/libs/remix-ui/editor/src/lib/syntaxes/solidity.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -export const conf = { +export const solidityLanguageConfig = { comments: { lineComment: '//', blockComment: ['/*', '*/'] @@ -19,7 +19,7 @@ export const conf = { ] } -export const language = { +export const solidityTokensProvider = { defaultToken: '', tokenPostfix: '.sol', diff --git a/libs/remix-ui/editor/src/lib/syntaxes/zokrates.ts b/libs/remix-ui/editor/src/lib/syntaxes/zokrates.ts new file mode 100644 index 0000000000..89a72ff361 --- /dev/null +++ b/libs/remix-ui/editor/src/lib/syntaxes/zokrates.ts @@ -0,0 +1,144 @@ +/* eslint-disable */ +export const zokratesLanguageConfig = { + 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'] }, + { open: '<', close: '>', notIn: ['string', 'comment'] } + ] +} + +export const zokratesTokensProvider = { + defaultToken: "", + tokenPostfix: ".zok", + + keywords: [ + "log", + "assert", + "as", + "bool", + "const", + "def", + "else", + "false", + "field", + "for", + "if", + "import", + "from", + "in", + "mut", + "private", + "public", + "return", + "struct", + "true", + "type", + "u8", + "u16", + "u32", + "u64", + ], + + typeKeywords: ["bool", "field", "u8", "u16", "u32", "u64"], + + operators: [ + "=", + ">", + "<", + "!", + "?", + ":", + "==", + "<=", + ">=", + "!=", + "&&", + "||", + "+", + "-", + "*", + "**", + "/", + "&", + "|", + "^", + "%", + "<<", + ">>", + ], + + decimalSuffix: /(u16|u32|u64|u8|f)?/, + + // we include these common regular expressions + symbols: /[=>](?!@symbols)/, "@brackets"], + [/@symbols/, { cases: { "@operators": "operator", "@default": "" } }], + + // numbers + [/0[xX][0-9a-fA-F]+/, "number.hex"], + [/\d+(@decimalSuffix)/, "number"], + + // delimiter + [/[;,.]/, "delimiter"], + + // strings + [/"([^"\\]|\\.)*$/, "string.invalid"], // non-teminated string + [/"/, { token: "string.quote", bracket: "@open", next: "@string" }], + ], + + comment: [ + [/[^\/*]+/, "comment"], + [/\/\*/, "comment", "@push"], // nested comment + ["\\*/", "comment", "@pop"], + [/[\/*]/, "comment"], + ], + + string: [ + [/[^\\"]+/, "string"], + [/@escapes/, "string.escape"], + [/\\./, "string.escape.invalid"], + [/"/, { token: "string.quote", bracket: "@close", next: "@pop" }], + ], + + whitespace: [ + [/[ \t\r\n]+/, "white"], + [/\/\*/, "comment", "@comment"], + [/\/\/.*$/, "comment"], + ], + }, +} From 450540c49fae4c96c7eefa59edd614e756e9c26c Mon Sep 17 00:00:00 2001 From: lianahus Date: Thu, 4 Aug 2022 12:48:20 +0200 Subject: [PATCH 150/179] disable SUT when sol.v is less than 0.4.12 --- apps/solidity-compiler/src/app/compiler-api.ts | 3 ++- .../staticAnalysisIntegration-test-0.4.24.ts | 2 +- .../src/lib/solidity-unit-testing.tsx | 18 +++++++++++++++++- package.json | 1 + yarn.lock | 5 +++++ 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/apps/solidity-compiler/src/app/compiler-api.ts b/apps/solidity-compiler/src/app/compiler-api.ts index 08bc50888e..74eec1d57f 100644 --- a/apps/solidity-compiler/src/app/compiler-api.ts +++ b/apps/solidity-compiler/src/app/compiler-api.ts @@ -222,9 +222,10 @@ export const CompilerApiMixin = (Base) => class extends Base { } this.compiler.event.register('loadingCompiler', this.data.eventHandlers.onLoadingCompiler) - this.data.eventHandlers.onCompilerLoaded = () => { + this.data.eventHandlers.onCompilerLoaded = (version) => { this.data.loading = false this.statusChanged({ key: 'none' }) + this.emit('compilerLoaded', version) } this.compiler.event.register('compilerLoaded', this.data.eventHandlers.onCompilerLoaded) diff --git a/libs/remix-analyzer/test/analysis/staticAnalysisIntegration-test-0.4.24.ts b/libs/remix-analyzer/test/analysis/staticAnalysisIntegration-test-0.4.24.ts index 8052a1870a..9bcaaf7a7b 100644 --- a/libs/remix-analyzer/test/analysis/staticAnalysisIntegration-test-0.4.24.ts +++ b/libs/remix-analyzer/test/analysis/staticAnalysisIntegration-test-0.4.24.ts @@ -38,7 +38,7 @@ const testFiles: string[] = [ 'forLoopIteratesOverDynamicArray.sol' ] -let compilationResults: Record = {} +const compilationResults: Record = {} test('setup', function (t: test.Test) { solcOrg.loadRemoteVersion('v0.4.24+commit.e67f0147', (error, compiler) => { diff --git a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx index 8f55fe2ea7..e580a9448b 100644 --- a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx +++ b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx @@ -1,4 +1,5 @@ import React, { useState, useRef, useEffect, ReactElement } from 'react' // eslint-disable-line +import * as semver from 'semver' import { eachOfSeries } from 'async' // eslint-disable-line import type Web3 from 'web3' import { canUseWorker, urlFromVersion } from '@remix-project/remix-solidity' @@ -154,8 +155,23 @@ export const SolidityUnitTesting = (props: Record) => { // eslint-d await setCurrentPath(defaultPath) }) + const truncateVersion = (version: string) => { + const tmp: RegExpExecArray | null = /^(\d+.\d+.\d+)/.exec(version) + return tmp ? tmp[1] : version + } + testTab.fileManager.events.on('noFileSelected', async () => { await updateForNewCurrent() }) - testTab.fileManager.events.on('currentFileChanged', async (file: string) => await updateForNewCurrent(file)) + testTab.fileManager.events.on('currentFileChanged', async (file: string) => { + await updateForNewCurrent(file) + }) + testTab.on('solidity', 'compilerLoaded', async (version: string) => { + const { currentVersion } = testTab.compileTab.getCurrentCompilerConfig() + + if (!semver.gt(truncateVersion(currentVersion), '0.4.12')) { + setDisableRunButton(true) + setRunButtonTitle('Please select Solidity compiler version greater than 0.4.12.') + } + }) }, []) // eslint-disable-line diff --git a/package.json b/package.json index ca78b75c73..06b9c286cf 100644 --- a/package.json +++ b/package.json @@ -252,6 +252,7 @@ "@types/react-dom": "^17.0.9", "@types/react-router-dom": "^5.3.0", "@types/request": "^2.48.7", + "@types/semver": "^7.3.10", "@types/tape": "^4.13.0", "@types/ws": "^7.2.4", "@typescript-eslint/eslint-plugin": "^4.32.0", diff --git a/yarn.lock b/yarn.lock index d544d2119c..bba528ba28 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4637,6 +4637,11 @@ integrity sha512-NxxZZek50ylIACiXebKQYHD3D4One3WXOasEXWazL6aTfYbZob7ClNKxUpg8I4/oWArX87oPWvj1cHKqfel3Hg== dependencies: "@types/ws" "*" + +"@types/semver@^7.3.10": + version "7.3.10" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.10.tgz#5f19ee40cbeff87d916eedc8c2bfe2305d957f73" + integrity sha512-zsv3fsC7S84NN6nPK06u79oWgrPVd0NvOyqgghV1haPaFcVxIrP4DLomRwGAXk0ui4HZA7mOcSFL98sMVW9viw== "@types/source-list-map@*": version "0.1.2" From 0f84885cc25cfb50abc1c68147a248a2ecc08351 Mon Sep 17 00:00:00 2001 From: lianahus Date: Tue, 2 Aug 2022 20:58:21 +0200 Subject: [PATCH 151/179] disable SSA for versions < 0.4.12 --- .../src/lib/Button/StaticAnalyserButton.tsx | 10 ++- .../src/lib/remix-ui-static-analyser.tsx | 71 +++++++++++++------ 2 files changed, 58 insertions(+), 23 deletions(-) diff --git a/libs/remix-ui/static-analyser/src/lib/Button/StaticAnalyserButton.tsx b/libs/remix-ui/static-analyser/src/lib/Button/StaticAnalyserButton.tsx index 2a67c82cf8..62876bc1c0 100644 --- a/libs/remix-ui/static-analyser/src/lib/Button/StaticAnalyserButton.tsx +++ b/libs/remix-ui/static-analyser/src/lib/Button/StaticAnalyserButton.tsx @@ -3,16 +3,20 @@ import React from 'react' //eslint-disable-line interface StaticAnalyserButtonProps { onClick: (event) => void buttonText: string, - disabled?: boolean + disabled?: boolean, + title?: string } const StaticAnalyserButton = ({ onClick, buttonText, - disabled + disabled, + title }: StaticAnalyserButtonProps) => { + let classList = "btn btn-sm w-25 btn-primary" + classList += disabled ? " disabled" : "" return ( - ) diff --git a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx index cdce6d95d6..8aa285ba8d 100644 --- a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx +++ b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx @@ -2,6 +2,7 @@ import React, { useEffect, useState, useReducer, useRef } from 'react' // eslint import Button from './Button/StaticAnalyserButton' // eslint-disable-line import { util } from '@remix-project/remix-lib' import _ from 'lodash' +import * as semver from 'semver' import { TreeView, TreeViewItem } from '@remix-ui/tree-view' // eslint-disable-line import { RemixUiCheckbox } from '@remix-ui/checkbox' // eslint-disable-line import ErrorRenderer from './ErrorRenderer' // eslint-disable-line @@ -9,6 +10,7 @@ import { compilation } from './actions/staticAnalysisActions' import { initialState, analysisReducer } from './reducers/staticAnalysisReducer' import { OverlayTrigger, Tooltip } from 'react-bootstrap'// eslint-disable-line import { CodeAnalysis } from '@remix-project/remix-analyzer' +import { setIpfsCheckedState } from 'libs/remix-ui/run-tab/src/lib/actions/payload' declare global { interface Window { @@ -64,14 +66,30 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { const [autoRun, setAutoRun] = useState(true) const [slitherEnabled, setSlitherEnabled] = useState(false) const [showSlither, setShowSlither] = useState(false) + const [isSupportedVersion, setIsSupportedVersion] = useState(false) let [showLibsWarning, setShowLibsWarning] = useState(false) // eslint-disable-line prefer-const const [categoryIndex, setCategoryIndex] = useState(groupedModuleIndex(groupedModules)) const [warningState, setWarningState] = useState({}) + const [runButtonTitle, setRunButtonTitle] = useState('Run Static Analysis') const warningContainer = useRef(null) const allWarnings = useRef({}) const [state, dispatch] = useReducer(analysisReducer, initialState) + const setDisableForRun = (version: string) => { + const truncateVersion = (version: string) => { + const tmp: RegExpExecArray | null = /^(\d+.\d+.\d+)/.exec(version) + return tmp ? tmp[1] : version + } + if (version != '' && !semver.gt(truncateVersion(version), '0.4.12')) { + setIsSupportedVersion(false) + setRunButtonTitle('Sselect Solidity compiler version greater than 0.4.12.') + } else { + setIsSupportedVersion(true) + setRunButtonTitle('Run static analysis') + } + } + useEffect(() => { compilation(props.analysisModule, dispatch) }, [props]) @@ -91,6 +109,10 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { return () => { } }, [state]) + useEffect(() => { + props.analysisModule.call('solidity', 'getCompilerState').then((compilerState) => setDisableForRun(compilerState.currentVersion)) + }, []) + useEffect(() => { props.analysisModule.on('filePanel', 'setWorkspace', (currentWorkspace) => { // Reset warning state @@ -119,20 +141,24 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { setSlitherEnabled(false) } }) + + props.analysisModule.on('solidity', 'compilerLoaded', async (version: string) => { + setDisableForRun(version) + }) return () => { } }, [props]) const message = (name, warning, more, fileName, locationString) : string => { return (` - - ${name} - ${warning} - ${more - ? (more) - : ( ) - } - Pos: ${locationString} - ` + + ${name} + ${warning} + ${more + ? (more) + : ( ) + } + Pos: ${locationString} + ` ) } @@ -183,6 +209,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { } const run = async (lastCompilationResult, lastCompilationSource, currentFile) => { + if (!isSupportedVersion) return if (state.data !== null) { if (lastCompilationResult && (categoryIndex.length > 0 || slitherEnabled)) { const warningMessage = [] @@ -474,7 +501,12 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { label="Autorun" onChange={() => {}} /> -
{ showSlither &&
@@ -520,15 +552,15 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { {Object.entries(warningState).length > 0 &&
{}} + id="showLibWarnings" + name="showLibWarnings" + categoryId="showLibWarnings" + title="when checked, the results are also displayed for external contract libraries" + inputType="checkbox" + checked={showLibsWarning} + label="Show warnings for external libraries" + onClick={handleShowLibsWarning} + onChange={() => {}} />
@@ -541,7 +573,6 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
- ) : null ))}
From 8363d46057197de2b2fab627ee1eb4729de47ab8 Mon Sep 17 00:00:00 2001 From: lianahus Date: Tue, 2 Aug 2022 21:00:46 +0200 Subject: [PATCH 152/179] cleanup --- .../static-analyser/src/lib/remix-ui-static-analyser.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx index 8aa285ba8d..5e143dec1f 100644 --- a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx +++ b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx @@ -10,7 +10,6 @@ import { compilation } from './actions/staticAnalysisActions' import { initialState, analysisReducer } from './reducers/staticAnalysisReducer' import { OverlayTrigger, Tooltip } from 'react-bootstrap'// eslint-disable-line import { CodeAnalysis } from '@remix-project/remix-analyzer' -import { setIpfsCheckedState } from 'libs/remix-ui/run-tab/src/lib/actions/payload' declare global { interface Window { From 4e38dcad70f7a7a0b39124d5f52e09f422f35fda Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 3 Aug 2022 12:24:20 +0200 Subject: [PATCH 153/179] add etherscan plugin --- apps/etherscan/.babelrc | 13 + apps/etherscan/.browserslistrc | 16 + apps/etherscan/.eslintrc.json | 34 ++ apps/etherscan/src/app/App.css | 7 + apps/etherscan/src/app/AppContext.tsx | 24 ++ apps/etherscan/src/app/app.tsx | 157 +++++++++ .../src/app/components/HeaderWithSettings.tsx | 159 +++++++++ .../src/app/components/SubmitButton.tsx | 34 ++ apps/etherscan/src/app/components/index.ts | 2 + .../src/app/hooks/useLocalStorage.tsx | 37 +++ apps/etherscan/src/app/layouts/Default.tsx | 19 ++ apps/etherscan/src/app/layouts/index.ts | 1 + apps/etherscan/src/app/logo.svg | 17 + apps/etherscan/src/app/routes.tsx | 51 +++ apps/etherscan/src/app/star.svg | 11 + apps/etherscan/src/app/types/Receipt.ts | 6 + apps/etherscan/src/app/types/ThemeType.ts | 1 + apps/etherscan/src/app/types/index.ts | 2 + apps/etherscan/src/app/utils/index.ts | 1 + apps/etherscan/src/app/utils/utilities.ts | 34 ++ .../src/app/views/CaptureKeyView.tsx | 59 ++++ apps/etherscan/src/app/views/ErrorView.tsx | 31 ++ apps/etherscan/src/app/views/HomeView.tsx | 36 +++ apps/etherscan/src/app/views/ReceiptsView.tsx | 135 ++++++++ apps/etherscan/src/app/views/VerifyView.tsx | 302 ++++++++++++++++++ apps/etherscan/src/app/views/index.ts | 4 + apps/etherscan/src/assets/.gitkeep | 0 .../src/environments/environment.prod.ts | 3 + .../etherscan/src/environments/environment.ts | 6 + apps/etherscan/src/favicon.ico | Bin 0 -> 15086 bytes apps/etherscan/src/index.html | 14 + apps/etherscan/src/main.tsx | 7 + apps/etherscan/src/polyfills.ts | 7 + apps/etherscan/src/styles.css | 1 + apps/etherscan/tsconfig.app.json | 14 + apps/etherscan/tsconfig.json | 20 ++ nx.json | 3 + package.json | 2 + workspace.json | 83 ++++- yarn.lock | 62 ++++ 40 files changed, 1414 insertions(+), 1 deletion(-) create mode 100644 apps/etherscan/.babelrc create mode 100644 apps/etherscan/.browserslistrc create mode 100644 apps/etherscan/.eslintrc.json create mode 100644 apps/etherscan/src/app/App.css create mode 100644 apps/etherscan/src/app/AppContext.tsx create mode 100644 apps/etherscan/src/app/app.tsx create mode 100644 apps/etherscan/src/app/components/HeaderWithSettings.tsx create mode 100644 apps/etherscan/src/app/components/SubmitButton.tsx create mode 100644 apps/etherscan/src/app/components/index.ts create mode 100644 apps/etherscan/src/app/hooks/useLocalStorage.tsx create mode 100644 apps/etherscan/src/app/layouts/Default.tsx create mode 100644 apps/etherscan/src/app/layouts/index.ts create mode 100644 apps/etherscan/src/app/logo.svg create mode 100644 apps/etherscan/src/app/routes.tsx create mode 100644 apps/etherscan/src/app/star.svg create mode 100644 apps/etherscan/src/app/types/Receipt.ts create mode 100644 apps/etherscan/src/app/types/ThemeType.ts create mode 100644 apps/etherscan/src/app/types/index.ts create mode 100644 apps/etherscan/src/app/utils/index.ts create mode 100644 apps/etherscan/src/app/utils/utilities.ts create mode 100644 apps/etherscan/src/app/views/CaptureKeyView.tsx create mode 100644 apps/etherscan/src/app/views/ErrorView.tsx create mode 100644 apps/etherscan/src/app/views/HomeView.tsx create mode 100644 apps/etherscan/src/app/views/ReceiptsView.tsx create mode 100644 apps/etherscan/src/app/views/VerifyView.tsx create mode 100644 apps/etherscan/src/app/views/index.ts create mode 100644 apps/etherscan/src/assets/.gitkeep create mode 100644 apps/etherscan/src/environments/environment.prod.ts create mode 100644 apps/etherscan/src/environments/environment.ts create mode 100644 apps/etherscan/src/favicon.ico create mode 100644 apps/etherscan/src/index.html create mode 100644 apps/etherscan/src/main.tsx create mode 100644 apps/etherscan/src/polyfills.ts create mode 100644 apps/etherscan/src/styles.css create mode 100644 apps/etherscan/tsconfig.app.json create mode 100644 apps/etherscan/tsconfig.json diff --git a/apps/etherscan/.babelrc b/apps/etherscan/.babelrc new file mode 100644 index 0000000000..b1fc975456 --- /dev/null +++ b/apps/etherscan/.babelrc @@ -0,0 +1,13 @@ +{ + "presets": [ + [ + "@nrwl/react/babel", { + "runtime": "automatic" + + } + ] + ], + "plugins": [ + + ] +} diff --git a/apps/etherscan/.browserslistrc b/apps/etherscan/.browserslistrc new file mode 100644 index 0000000000..f1d12df4fa --- /dev/null +++ b/apps/etherscan/.browserslistrc @@ -0,0 +1,16 @@ +# This file is used by: +# 1. autoprefixer to adjust CSS to support the below specified browsers +# 2. babel preset-env to adjust included polyfills +# +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries +# +# If you need to support different browsers in production, you may tweak the list below. + +last 1 Chrome version +last 1 Firefox version +last 2 Edge major versions +last 2 Safari major version +last 2 iOS major versions +Firefox ESR +not IE 9-11 # For IE 9-11 support, remove 'not'. \ No newline at end of file diff --git a/apps/etherscan/.eslintrc.json b/apps/etherscan/.eslintrc.json new file mode 100644 index 0000000000..a92d0f887a --- /dev/null +++ b/apps/etherscan/.eslintrc.json @@ -0,0 +1,34 @@ +{ + "extends": [ + "plugin:@nrwl/nx/react", + "../../.eslintrc.json" + ], + "ignorePatterns": [ + "!**/*" + ], + "overrides": [ + { + "files": [ + "*.ts", + "*.tsx", + "*.js", + "*.jsx" + ], + "rules": {} + }, + { + "files": [ + "*.ts", + "*.tsx" + ], + "rules": {} + }, + { + "files": [ + "*.js", + "*.jsx" + ], + "rules": {} + } + ] +} \ No newline at end of file diff --git a/apps/etherscan/src/app/App.css b/apps/etherscan/src/app/App.css new file mode 100644 index 0000000000..27083bfb90 --- /dev/null +++ b/apps/etherscan/src/app/App.css @@ -0,0 +1,7 @@ +body { + margin: 0; +} + +#root { + padding: 5px; +} \ No newline at end of file diff --git a/apps/etherscan/src/app/AppContext.tsx b/apps/etherscan/src/app/AppContext.tsx new file mode 100644 index 0000000000..52b0c1fda8 --- /dev/null +++ b/apps/etherscan/src/app/AppContext.tsx @@ -0,0 +1,24 @@ +import React from "react" +import { PluginClient } from "@remixproject/plugin" + +import { Receipt, ThemeType } from "./types" + +export const AppContext = React.createContext({ + apiKey: "", + setAPIKey: (value: string) => { + console.log("Set API Key from Context") + }, + clientInstance: {} as PluginClient, + receipts: [] as Receipt[], + setReceipts: (receipts: Receipt[]) => { + console.log("Calling Set Receipts") + }, + contracts: [] as string[], + setContracts: (contracts: string[]) => { + console.log("Calling Set Contract Names") + }, + themeType: "dark" as ThemeType, + setThemeType: (themeType: ThemeType) => { + console.log("Calling Set Theme Type") + }, +}) diff --git a/apps/etherscan/src/app/app.tsx b/apps/etherscan/src/app/app.tsx new file mode 100644 index 0000000000..d46b66fccc --- /dev/null +++ b/apps/etherscan/src/app/app.tsx @@ -0,0 +1,157 @@ +import React, { useState, useEffect, useRef } from "react" + +import { + CompilationFileSources, + CompilationResult, +} from "@remixproject/plugin-api" + +import { PluginClient } from "@remixproject/plugin"; +import { createClient } from "@remixproject/plugin-webview"; + +import { AppContext } from "./AppContext" +import { DisplayRoutes } from "./routes" + +import { useLocalStorage } from "./hooks/useLocalStorage" + +import { getReceiptStatus, getEtherScanApi, getNetworkName } from "./utils" +import { Receipt, ThemeType } from "./types" + +import "./App.css" + +export const getNewContractNames = (compilationResult: CompilationResult) => { + const compiledContracts = compilationResult.contracts + let result: string[] = [] + + for (const file of Object.keys(compiledContracts)) { + const newContractNames = Object.keys(compiledContracts[file]) + result = [...result, ...newContractNames] + } + + return result +} + +const App = () => { + const [apiKey, setAPIKey] = useLocalStorage("apiKey", "") + const [clientInstance, setClientInstance] = useState(undefined as any) + const [receipts, setReceipts] = useLocalStorage("receipts", []) + const [contracts, setContracts] = useState([] as string[]) + const [themeType, setThemeType] = useState("dark" as ThemeType) + + const clientInstanceRef = useRef(clientInstance) + clientInstanceRef.current = clientInstance + const contractsRef = useRef(contracts) + contractsRef.current = contracts + + useEffect(() => { + console.log("Remix Etherscan loading...") + const client = new PluginClient() + createClient(client) + const loadClient = async () => { + await client.onload() + setClientInstance(client) + console.log("Remix Etherscan Plugin has been loaded") + + client.on("solidity", + "compilationFinished", + ( + fileName: string, + source: CompilationFileSources, + languageVersion: string, + data: CompilationResult + ) => { + console.log("New compilation received") + const newContractsNames = getNewContractNames(data) + + const newContractsToSave: string[] = [ + ...contractsRef.current, + ...newContractsNames, + ] + + const uniqueContracts: string[] = [...new Set(newContractsToSave)] + + setContracts(uniqueContracts) + } + ) + + //const currentTheme = await client.call("theme", "currentTheme") + //setThemeType(currentTheme.quality) + //client.on("theme", "themeChanged", (theme) => { + // setThemeType(theme.quality) + //}) + } + + loadClient() + }, []) + + useEffect(() => { + if (!clientInstance) { + return + } + + const receiptsNotVerified: Receipt[] = receipts.filter((item: Receipt) => { + return item.status !== "Verified" + }) + + if (receiptsNotVerified.length > 0) { + let timer1 = setInterval(() => { + for (const item in receiptsNotVerified) { + + } + receiptsNotVerified.forEach(async (item) => { + if (!clientInstanceRef.current) { + return {} + } + const network = await getNetworkName(clientInstanceRef.current) + if (network === "vm") { + return {} + } + const status = await getReceiptStatus( + item.guid, + apiKey, + getEtherScanApi(network) + ) + if (status === "Pass - Verified") { + const newReceipts = receipts.map((currentReceipt: Receipt) => { + if (currentReceipt.guid === item.guid) { + return { + ...currentReceipt, + status: "Verified", + } + } + return currentReceipt + }) + + clearInterval(timer1) + + setReceipts(newReceipts) + + return () => { + clearInterval(timer1) + } + } + return {} + }) + }, 5000) + } + }, [receipts, clientInstance, apiKey, setReceipts]) + + return ( + + + + ) +} + +export default App diff --git a/apps/etherscan/src/app/components/HeaderWithSettings.tsx b/apps/etherscan/src/app/components/HeaderWithSettings.tsx new file mode 100644 index 0000000000..f0ba96ae6b --- /dev/null +++ b/apps/etherscan/src/app/components/HeaderWithSettings.tsx @@ -0,0 +1,159 @@ +import React from "react" + +import { NavLink } from "react-router-dom" +import { AppContext } from "../AppContext" +import { ThemeType } from "../types" + +interface Props { + title?: string + showBackButton?: boolean + from: string +} + +interface IconProps { + from: string + themeType: ThemeType +} + +const HomeIcon: React.FC = ({ from, themeType }: IconProps) => { + return ( + { + return { + ...(isActive ? getStyleFilterIcon(themeType) : {}), ...{ marginRight: "0.4em" } + } + }} + > + + + + + + ) +} + +const SettingsIcon: React.FC = ({ from, themeType }: IconProps) => { + return ( + { + return { + ...(isActive ? getStyleFilterIcon(themeType) : {}), ...{ marginRight: "0.4em" } + } + }} + > + + + + + + + ) +} + +const getStyleFilterIcon = (themeType: ThemeType) => { + const invert = themeType === "dark" ? 1 : 0 + const brightness = themeType === "dark" ? "150" : "0" // should be >100 for icons with color + return { + filter: `invert(${invert}) grayscale(1) brightness(${brightness}%)`, + } +} + +const ReceiptsIcon: React.FC = ({ from, themeType }: IconProps) => { + return ( + { + return { + ...(isActive ? getStyleFilterIcon(themeType) : {}), ...{ marginRight: "0.4em" } + } + }} + > + + + + + + + ) +} +export const HeaderWithSettings: React.FC = ({ + title = "", + showBackButton = false, + from, +}) => { + return ( + + {({ themeType }) => ( +
+
{title}
+
+ + + + + +
+
+ )} +
+ ) +} diff --git a/apps/etherscan/src/app/components/SubmitButton.tsx b/apps/etherscan/src/app/components/SubmitButton.tsx new file mode 100644 index 0000000000..7fe0fa4f05 --- /dev/null +++ b/apps/etherscan/src/app/components/SubmitButton.tsx @@ -0,0 +1,34 @@ +import React from "react" + +interface Props { + text: string + isSubmitting?: boolean +} + +export const SubmitButton: React.FC = ({ + text, + isSubmitting = false, +}) => { + return ( + + ) +} diff --git a/apps/etherscan/src/app/components/index.ts b/apps/etherscan/src/app/components/index.ts new file mode 100644 index 0000000000..c52e3712f0 --- /dev/null +++ b/apps/etherscan/src/app/components/index.ts @@ -0,0 +1,2 @@ +export { HeaderWithSettings } from "./HeaderWithSettings" +export { SubmitButton } from "./SubmitButton" diff --git a/apps/etherscan/src/app/hooks/useLocalStorage.tsx b/apps/etherscan/src/app/hooks/useLocalStorage.tsx new file mode 100644 index 0000000000..cca4a83a72 --- /dev/null +++ b/apps/etherscan/src/app/hooks/useLocalStorage.tsx @@ -0,0 +1,37 @@ +import { useState } from "react" + +export function useLocalStorage(key: string, initialValue: any) { + // State to store our value + // Pass initial state function to useState so logic is only executed once + const [storedValue, setStoredValue] = useState(() => { + try { + // Get from local storage by key + const item = window.localStorage.getItem(key) + // Parse stored json or if none return initialValue + return item ? JSON.parse(item) : initialValue + } catch (error) { + // If error also return initialValue + console.log(error) + return initialValue + } + }) + + // Return a wrapped version of useState's setter function that ... + // ... persists the new value to localStorage. + const setValue = (value: any) => { + try { + // Allow value to be a function so we have same API as useState + const valueToStore = + value instanceof Function ? value(storedValue) : value + // Save state + setStoredValue(valueToStore) + // Save to local storage + window.localStorage.setItem(key, JSON.stringify(valueToStore)) + } catch (error) { + // A more advanced implementation would handle the error case + console.log(error) + } + } + + return [storedValue, setValue] +} diff --git a/apps/etherscan/src/app/layouts/Default.tsx b/apps/etherscan/src/app/layouts/Default.tsx new file mode 100644 index 0000000000..93dd89b851 --- /dev/null +++ b/apps/etherscan/src/app/layouts/Default.tsx @@ -0,0 +1,19 @@ +import React, { PropsWithChildren } from "react" + +import { HeaderWithSettings } from "../components" + +interface Props { + from: string +} + +export const DefaultLayout: React.FC> = ({ + children, + from, +}) => { + return ( +
+ + {children} +
+ ) +} diff --git a/apps/etherscan/src/app/layouts/index.ts b/apps/etherscan/src/app/layouts/index.ts new file mode 100644 index 0000000000..9b8e6166d5 --- /dev/null +++ b/apps/etherscan/src/app/layouts/index.ts @@ -0,0 +1 @@ +export { DefaultLayout } from "./Default" diff --git a/apps/etherscan/src/app/logo.svg b/apps/etherscan/src/app/logo.svg new file mode 100644 index 0000000000..8fa84ab509 --- /dev/null +++ b/apps/etherscan/src/app/logo.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/apps/etherscan/src/app/routes.tsx b/apps/etherscan/src/app/routes.tsx new file mode 100644 index 0000000000..68fd76318f --- /dev/null +++ b/apps/etherscan/src/app/routes.tsx @@ -0,0 +1,51 @@ +import React from "react" +import { + BrowserRouter as Router, + Route, + Routes, + RouteProps, +} from "react-router-dom" + +import { ErrorView, HomeView, ReceiptsView, CaptureKeyView } from "./views" +import { DefaultLayout } from "./layouts" + +interface Props extends RouteProps { + component: any // TODO: new (props: any) => React.Component + from: string +} + +const RouteWithHeader = ({ component: Component, ...rest }: Props) => { + return ( + + + + + + ) +} + +export const DisplayRoutes = () => ( + + + + + } /> + } /> + + + } /> + + + } /> + + +) diff --git a/apps/etherscan/src/app/star.svg b/apps/etherscan/src/app/star.svg new file mode 100644 index 0000000000..901053d385 --- /dev/null +++ b/apps/etherscan/src/app/star.svg @@ -0,0 +1,11 @@ + + + + + diff --git a/apps/etherscan/src/app/types/Receipt.ts b/apps/etherscan/src/app/types/Receipt.ts new file mode 100644 index 0000000000..57de417094 --- /dev/null +++ b/apps/etherscan/src/app/types/Receipt.ts @@ -0,0 +1,6 @@ +export type ReceiptStatus = "Verified" | "Queue" + +export interface Receipt { + guid: string + status: ReceiptStatus +} diff --git a/apps/etherscan/src/app/types/ThemeType.ts b/apps/etherscan/src/app/types/ThemeType.ts new file mode 100644 index 0000000000..13b3710cd0 --- /dev/null +++ b/apps/etherscan/src/app/types/ThemeType.ts @@ -0,0 +1 @@ +export type ThemeType = "dark" | "light" diff --git a/apps/etherscan/src/app/types/index.ts b/apps/etherscan/src/app/types/index.ts new file mode 100644 index 0000000000..1a8733d6ff --- /dev/null +++ b/apps/etherscan/src/app/types/index.ts @@ -0,0 +1,2 @@ +export * from "./Receipt" +export * from "./ThemeType" diff --git a/apps/etherscan/src/app/utils/index.ts b/apps/etherscan/src/app/utils/index.ts new file mode 100644 index 0000000000..b23d52e6e0 --- /dev/null +++ b/apps/etherscan/src/app/utils/index.ts @@ -0,0 +1 @@ +export * from "./utilities" diff --git a/apps/etherscan/src/app/utils/utilities.ts b/apps/etherscan/src/app/utils/utilities.ts new file mode 100644 index 0000000000..17ef6fc8a0 --- /dev/null +++ b/apps/etherscan/src/app/utils/utilities.ts @@ -0,0 +1,34 @@ +import { PluginClient } from "@remixproject/plugin" +import axios from 'axios' +type RemixClient = PluginClient + +export const getEtherScanApi = (network: string) => { + return network === "main" + ? `https://api.etherscan.io/api` + : `https://api-${network}.etherscan.io/api` +} + +export const getNetworkName = async (client: RemixClient) => { + const network = await client.call("network", "detectNetwork") + if (!network) { + throw new Error("no known network to verify against") + } + const name = network.name!.toLowerCase() + // TODO : remove that when https://github.com/ethereum/remix-ide/issues/2017 is fixe + return name === "görli" ? "goerli" : name +} + +export const getReceiptStatus = async ( + receiptGuid: string, + apiKey: string, + etherscanApi: string +) => { + const params = `guid=${receiptGuid}&module=contract&action=checkverifystatus&apiKey=${apiKey}` + try { + const response = await axios.get(`${etherscanApi}?${params}`) + const { result } = response.data + return result + } catch (error) { + console.log("Error", error) + } +} diff --git a/apps/etherscan/src/app/views/CaptureKeyView.tsx b/apps/etherscan/src/app/views/CaptureKeyView.tsx new file mode 100644 index 0000000000..2bac179293 --- /dev/null +++ b/apps/etherscan/src/app/views/CaptureKeyView.tsx @@ -0,0 +1,59 @@ +import React from "react" + +import { Formik, ErrorMessage, Field } from "formik" +import { useNavigate, useLocation } from "react-router-dom" + +import { AppContext } from "../AppContext" +import { SubmitButton } from "../components" + +export const CaptureKeyView: React.FC = () => { + const location = useLocation() + const navigate = useNavigate() + return ( + + {({ apiKey, setAPIKey }) => ( + { + const errors = {} as any + if (!values.apiKey) { + errors.apiKey = "Required" + } + return errors + }} + onSubmit={(values) => { + setAPIKey(values.apiKey) + navigate((location.state as any).from) + }} + > + {({ errors, touched, handleSubmit }) => ( +
+
+ + + +
+ +
+ +
+
+ )} +
+ )} +
+ ) +} diff --git a/apps/etherscan/src/app/views/ErrorView.tsx b/apps/etherscan/src/app/views/ErrorView.tsx new file mode 100644 index 0000000000..5c9e623231 --- /dev/null +++ b/apps/etherscan/src/app/views/ErrorView.tsx @@ -0,0 +1,31 @@ +import React from "react" + +export const ErrorView: React.FC = () => { + return ( +
+ Error page +
Sorry, something unexpected happened.
+
+ Please raise an issue:{" "} + + Here + +
+
+ ) +} diff --git a/apps/etherscan/src/app/views/HomeView.tsx b/apps/etherscan/src/app/views/HomeView.tsx new file mode 100644 index 0000000000..0b9d2e3820 --- /dev/null +++ b/apps/etherscan/src/app/views/HomeView.tsx @@ -0,0 +1,36 @@ +import React from "react" + +import { Navigate } from "react-router-dom" + +import { AppContext } from "../AppContext" +import { Receipt } from "../types" + +import { VerifyView } from "./VerifyView" + +export const HomeView: React.FC = () => { + // const [hasError, setHasError] = useState(false) + return ( + + {({ apiKey, clientInstance, setReceipts, receipts, contracts }) => + !apiKey ? ( + + ) : ( + { + const newReceipts = [...receipts, receipt] + + setReceipts(newReceipts) + }} + /> + ) + } + + ) +} diff --git a/apps/etherscan/src/app/views/ReceiptsView.tsx b/apps/etherscan/src/app/views/ReceiptsView.tsx new file mode 100644 index 0000000000..ad13fbee33 --- /dev/null +++ b/apps/etherscan/src/app/views/ReceiptsView.tsx @@ -0,0 +1,135 @@ +import React, { useState } from "react" + +import { Formik, ErrorMessage, Field } from "formik" +import { getEtherScanApi, getNetworkName, getReceiptStatus } from "../utils" +import { Receipt } from "../types" +import { AppContext } from "../AppContext" +import { SubmitButton } from "../components" +import { Navigate } from "react-router-dom" + +interface FormValues { + receiptGuid: string +} + +export const ReceiptsView: React.FC = () => { + const [results, setResults] = useState("") + const onGetReceiptStatus = async ( + values: FormValues, + clientInstance: any, + apiKey: string + ) => { + try { + const network = await getNetworkName(clientInstance) + if (network === "vm") { + setResults("Cannot verify in the selected network") + return + } + const etherscanApi = getEtherScanApi(network) + const result = await getReceiptStatus( + values.receiptGuid, + apiKey, + etherscanApi + ) + setResults(result) + } catch (error: any) { + setResults(error.message) + } + } + + return ( + + {({ apiKey, clientInstance, receipts }) => + !apiKey ? ( + + ) : ( +
+ { + const errors = {} as any + if (!values.receiptGuid) { + errors.receiptGuid = "Required" + } + return errors + }} + onSubmit={(values) => + onGetReceiptStatus(values, clientInstance, apiKey) + } + > + {({ errors, touched, handleSubmit }) => ( +
+
+
Get your Receipt GUID status
+ + + +
+ + + + )} +
+ +
+ + +
+ ) + } + + ) +} + +const ReceiptsTable: React.FC<{ receipts: Receipt[] }> = ({ receipts }) => { + return ( +
+
Receipts
+ + + + + + + + + {receipts && + receipts.length > 0 && + receipts.map((item: Receipt, index) => { + return ( + + + + + ) + })} + +
GuidStatus
{item.guid}{item.status}
+
+ ) +} diff --git a/apps/etherscan/src/app/views/VerifyView.tsx b/apps/etherscan/src/app/views/VerifyView.tsx new file mode 100644 index 0000000000..a57b23a8cb --- /dev/null +++ b/apps/etherscan/src/app/views/VerifyView.tsx @@ -0,0 +1,302 @@ +import React, { useState } from "react" + +import { + PluginClient, +} from "@remixproject/plugin" +import { Formik, ErrorMessage, Field } from "formik" + +import { getNetworkName, getEtherScanApi, getReceiptStatus } from "../utils" +import { SubmitButton } from "../components" +import { Receipt } from "../types" +import { CompilationResult } from "@remixproject/plugin-api" +import axios from 'axios' + +interface Props { + client: PluginClient + apiKey: string + onVerifiedContract: (receipt: Receipt) => void + contracts: string[] +} + +interface FormValues { + contractName: string + contractArguments: string + contractAddress: string +} + +export const getContractFileName = ( + compilationResult: CompilationResult, + contractName: string +) => { + const compiledContracts = compilationResult.contracts + let fileName = "" + + for (const file of Object.keys(compiledContracts)) { + for (const contract of Object.keys(compiledContracts[file])) { + if (contract === contractName) { + fileName = file + break + } + } + } + return fileName +} + +export const getContractMetadata = ( + compilationResult: CompilationResult, + contractName: string +) => { + const compiledContracts = compilationResult.contracts + let contractMetadata = "" + + for (const file of Object.keys(compiledContracts)) { + for (const contract of Object.keys(compiledContracts[file])) { + if (contract === contractName) { + contractMetadata = compiledContracts[file][contract].metadata + if (contractMetadata) { + break + } + } + } + } + return contractMetadata +} + +export const VerifyView: React.FC = ({ + apiKey, + client, + contracts, + onVerifiedContract, +}) => { + const [results, setResults] = useState("") + + const onVerifyContract = async (values: FormValues) => { + const compilationResult = (await client.call( + "solidity", + "getCompilationResult" + )) as any + + if (!compilationResult) { + throw new Error("no compilation result available") + } + + const contractArguments = values.contractArguments.replace("0x", "") + + const verify = async ( + apiKeyParam: string, + contractAddress: string, + contractArgumentsParam: string, + contractName: string, + compilationResultParam: any + ) => { + const network = await getNetworkName(client) + if (network === "vm") { + return "Cannot verify in the selected network" + } + const etherscanApi = getEtherScanApi(network) + + try { + const contractMetadata = getContractMetadata( + compilationResultParam.data, + contractName + ) + + if (!contractMetadata) { + return "Please recompile contract" + } + + const contractMetadataParsed = JSON.parse(contractMetadata) + + const fileName = getContractFileName( + compilationResultParam.data, + contractName + ) + + const jsonInput = { + language: 'Solidity', + sources: compilationResultParam.source.sources, + settings: { + optimizer: { + enabled: contractMetadataParsed.settings.optimizer.enabled, + runs: contractMetadataParsed.settings.optimizer.runs + } + } + } + + const data: { [key: string]: string | any } = { + apikey: apiKeyParam, // A valid API-Key is required + module: "contract", // Do not change + action: "verifysourcecode", // Do not change + codeformat: "solidity-standard-json-input", + contractaddress: contractAddress, // Contract Address starts with 0x... + sourceCode: JSON.stringify(jsonInput), + contractname: fileName + ':' + contractName, + compilerversion: `v${contractMetadataParsed.compiler.version}`, // see http://etherscan.io/solcversions for list of support versions + constructorArguements: contractArgumentsParam, // if applicable + } + + const body = new FormData() + Object.keys(data).forEach((key) => body.append(key, data[key])) + + client.emit("statusChanged", { + key: "loading", + type: "info", + title: "Verifying ...", + }) + const response = await axios.post(etherscanApi, body) + const { message, result, status } = await response.data + + if (message === "OK" && status === "1") { + resetAfter10Seconds() + const receiptStatus = await getReceiptStatus( + result, + apiKey, + etherscanApi + ) + + onVerifiedContract({ + guid: result, + status: receiptStatus, + }) + return `Contract verified correctly
Receipt GUID ${result}` + } + if (message === "NOTOK") { + client.emit("statusChanged", { + key: "failed", + type: "error", + title: result, + }) + resetAfter10Seconds() + } + return result + } catch (error) { + console.log("Error, something wrong happened", error) + setResults("Something wrong happened, try again") + } + } + + const resetAfter10Seconds = () => { + setTimeout(() => { + client.emit("statusChanged", { key: "none" }) + setResults("") + }, 10000) + } + + const verificationResult = await verify( + apiKey, + values.contractAddress, + contractArguments, + values.contractName, + compilationResult + ) + + setResults(verificationResult) + } + + return ( +
+ { + const errors = {} as any + if (!values.contractName) { + errors.contractName = "Required" + } + if (!values.contractAddress) { + errors.contractAddress = "Required" + } + if (values.contractAddress.trim() === "") { + errors.contractAddress = "Please enter a valid contract address" + } + return errors + }} + onSubmit={(values) => onVerifyContract(values)} + > + {({ errors, touched, handleSubmit, isSubmitting }) => ( +
+
+
Verify your smart contracts
+ + + + {contracts.map((item) => ( + + ))} + + +
+ +
+ + + +
+ +
+ + + +
+ + + + )} +
+ +
+ + {/*
+ View Receipts +
*/} +
+ ) +} diff --git a/apps/etherscan/src/app/views/index.ts b/apps/etherscan/src/app/views/index.ts new file mode 100644 index 0000000000..c483228ece --- /dev/null +++ b/apps/etherscan/src/app/views/index.ts @@ -0,0 +1,4 @@ +export { HomeView } from "./HomeView" +export { ErrorView } from "./ErrorView" +export { ReceiptsView } from "./ReceiptsView" +export { CaptureKeyView } from "./CaptureKeyView" diff --git a/apps/etherscan/src/assets/.gitkeep b/apps/etherscan/src/assets/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/apps/etherscan/src/environments/environment.prod.ts b/apps/etherscan/src/environments/environment.prod.ts new file mode 100644 index 0000000000..3612073bc3 --- /dev/null +++ b/apps/etherscan/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/apps/etherscan/src/environments/environment.ts b/apps/etherscan/src/environments/environment.ts new file mode 100644 index 0000000000..d9370e924b --- /dev/null +++ b/apps/etherscan/src/environments/environment.ts @@ -0,0 +1,6 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// When building for production, this file is replaced with `environment.prod.ts`. + +export const environment = { + production: false +}; diff --git a/apps/etherscan/src/favicon.ico b/apps/etherscan/src/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..317ebcb2336e0833a22dddf0ab287849f26fda57 GIT binary patch literal 15086 zcmeI332;U^%p|z7g|#(P)qFEA@4f!_@qOK2 z_lJl}!lhL!VT_U|uN7%8B2iKH??xhDa;*`g{yjTFWHvXn;2s{4R7kH|pKGdy(7z!K zgftM+Ku7~24TLlh(!g)gz|foI94G^t2^IO$uvX$3(OR0<_5L2sB)lMAMy|+`xodJ{ z_Uh_1m)~h?a;2W{dmhM;u!YGo=)OdmId_B<%^V^{ovI@y`7^g1_V9G}*f# zNzAtvou}I!W1#{M^@ROc(BZ! z+F!!_aR&Px3_reO(EW+TwlW~tv*2zr?iP7(d~a~yA|@*a89IUke+c472NXM0wiX{- zl`UrZC^1XYyf%1u)-Y)jj9;MZ!SLfd2Hl?o|80Su%Z?To_=^g_Jt0oa#CT*tjx>BI z16wec&AOWNK<#i0Qd=1O$fymLRoUR*%;h@*@v7}wApDl^w*h}!sYq%kw+DKDY)@&A z@9$ULEB3qkR#85`lb8#WZw=@})#kQig9oqy^I$dj&k4jU&^2(M3q{n1AKeGUKPFbr z1^<)aH;VsG@J|B&l>UtU#Ejv3GIqERzYgL@UOAWtW<{p#zy`WyJgpCy8$c_e%wYJL zyGHRRx38)HyjU3y{-4z6)pzb>&Q1pR)B&u01F-|&Gx4EZWK$nkUkOI|(D4UHOXg_- zw{OBf!oWQUn)Pe(=f=nt=zkmdjpO^o8ZZ9o_|4tW1ni+Un9iCW47*-ut$KQOww!;u z`0q)$s6IZO!~9$e_P9X!hqLxu`fpcL|2f^I5d4*a@Dq28;@2271v_N+5HqYZ>x;&O z05*7JT)mUe&%S0@UD)@&8SmQrMtsDfZT;fkdA!r(S=}Oz>iP)w=W508=Rc#nNn7ym z1;42c|8($ALY8#a({%1#IXbWn9-Y|0eDY$_L&j{63?{?AH{);EzcqfydD$@-B`Y3<%IIj7S7rK_N}je^=dEk%JQ4c z!tBdTPE3Tse;oYF>cnrapWq*o)m47X1`~6@(!Y29#>-#8zm&LXrXa(3=7Z)ElaQqj z-#0JJy3Fi(C#Rx(`=VXtJ63E2_bZGCz+QRa{W0e2(m3sI?LOcUBx)~^YCqZ{XEPX)C>G>U4tfqeH8L(3|pQR*zbL1 zT9e~4Tb5p9_G}$y4t`i*4t_Mr9QYvL9C&Ah*}t`q*}S+VYh0M6GxTTSXI)hMpMpIq zD1ImYqJLzbj0}~EpE-aH#VCH_udYEW#`P2zYmi&xSPs_{n6tBj=MY|-XrA;SGA_>y zGtU$?HXm$gYj*!N)_nQ59%lQdXtQZS3*#PC-{iB_sm+ytD*7j`D*k(P&IH2GHT}Eh z5697eQECVIGQAUe#eU2I!yI&%0CP#>%6MWV z@zS!p@+Y1i1b^QuuEF*13CuB zu69dve5k7&Wgb+^s|UB08Dr3u`h@yM0NTj4h7MnHo-4@xmyr7(*4$rpPwsCDZ@2be zRz9V^GnV;;?^Lk%ynzq&K(Aix`mWmW`^152Hoy$CTYVehpD-S1-W^#k#{0^L`V6CN+E z!w+xte;2vu4AmVNEFUOBmrBL>6MK@!O2*N|2=d|Y;oN&A&qv=qKn73lDD zI(+oJAdgv>Yr}8(&@ZuAZE%XUXmX(U!N+Z_sjL<1vjy1R+1IeHt`79fnYdOL{$ci7 z%3f0A*;Zt@ED&Gjm|OFTYBDe%bbo*xXAQsFz+Q`fVBH!N2)kaxN8P$c>sp~QXnv>b zwq=W3&Mtmih7xkR$YA)1Yi?avHNR6C99!u6fh=cL|KQ&PwF!n@ud^n(HNIImHD!h87!i*t?G|p0o+eelJ?B@A64_9%SBhNaJ64EvKgD&%LjLCYnNfc; znj?%*p@*?dq#NqcQFmmX($wms@CSAr9#>hUR^=I+=0B)vvGX%T&#h$kmX*s=^M2E!@N9#m?LhMvz}YB+kd zG~mbP|D(;{s_#;hsKK9lbVK&Lo734x7SIFJ9V_}2$@q?zm^7?*XH94w5Qae{7zOMUF z^?%F%)c1Y)Q?Iy?I>knw*8gYW#ok|2gdS=YYZLiD=CW|Nj;n^x!=S#iJ#`~Ld79+xXpVmUK^B(xO_vO!btA9y7w3L3-0j-y4 z?M-V{%z;JI`bk7yFDcP}OcCd*{Q9S5$iGA7*E1@tfkyjAi!;wP^O71cZ^Ep)qrQ)N z#wqw0_HS;T7x3y|`P==i3hEwK%|>fZ)c&@kgKO1~5<5xBSk?iZV?KI6&i72H6S9A* z=U(*e)EqEs?Oc04)V-~K5AUmh|62H4*`UAtItO$O(q5?6jj+K^oD!04r=6#dsxp?~}{`?&sXn#q2 zGuY~7>O2=!u@@Kfu7q=W*4egu@qPMRM>(eyYyaIE<|j%d=iWNdGsx%c!902v#ngNg z@#U-O_4xN$s_9?(`{>{>7~-6FgWpBpqXb`Ydc3OFL#&I}Irse9F_8R@4zSS*Y*o*B zXL?6*Aw!AfkNCgcr#*yj&p3ZDe2y>v$>FUdKIy_2N~}6AbHc7gA3`6$g@1o|dE>vz z4pl(j9;kyMsjaw}lO?(?Xg%4k!5%^t#@5n=WVc&JRa+XT$~#@rldvN3S1rEpU$;XgxVny7mki3 z-Hh|jUCHrUXuLr!)`w>wgO0N%KTB-1di>cj(x3Bav`7v z3G7EIbU$z>`Nad7Rk_&OT-W{;qg)-GXV-aJT#(ozdmnA~Rq3GQ_3mby(>q6Ocb-RgTUhTN)))x>m&eD;$J5Bg zo&DhY36Yg=J=$Z>t}RJ>o|@hAcwWzN#r(WJ52^g$lh^!63@hh+dR$&_dEGu&^CR*< z!oFqSqO@>xZ*nC2oiOd0eS*F^IL~W-rsrO`J`ej{=ou_q^_(<$&-3f^J z&L^MSYWIe{&pYq&9eGaArA~*kA + + + + Etherscan + + + + + + +
+ + diff --git a/apps/etherscan/src/main.tsx b/apps/etherscan/src/main.tsx new file mode 100644 index 0000000000..353ad43f6d --- /dev/null +++ b/apps/etherscan/src/main.tsx @@ -0,0 +1,7 @@ +import { StrictMode } from 'react'; +import * as ReactDOM from 'react-dom'; + + +import App from './app/app'; + +ReactDOM.render(, document.getElementById('root')); diff --git a/apps/etherscan/src/polyfills.ts b/apps/etherscan/src/polyfills.ts new file mode 100644 index 0000000000..2adf3d05b6 --- /dev/null +++ b/apps/etherscan/src/polyfills.ts @@ -0,0 +1,7 @@ +/** + * Polyfill stable language features. These imports will be optimized by `@babel/preset-env`. + * + * See: https://github.com/zloirock/core-js#babel + */ +import 'core-js/stable'; +import 'regenerator-runtime/runtime'; diff --git a/apps/etherscan/src/styles.css b/apps/etherscan/src/styles.css new file mode 100644 index 0000000000..90d4ee0072 --- /dev/null +++ b/apps/etherscan/src/styles.css @@ -0,0 +1 @@ +/* You can add global styles to this file, and also import other style files */ diff --git a/apps/etherscan/tsconfig.app.json b/apps/etherscan/tsconfig.app.json new file mode 100644 index 0000000000..62d6d52c3d --- /dev/null +++ b/apps/etherscan/tsconfig.app.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "types": ["node"] + }, + "files": [ + + "../../node_modules/@nrwl/react/typings/cssmodule.d.ts", + "../../node_modules/@nrwl/react/typings/image.d.ts" + ], + "exclude": ["**/*.spec.ts", "**/*.spec.tsx"], + "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] +} diff --git a/apps/etherscan/tsconfig.json b/apps/etherscan/tsconfig.json new file mode 100644 index 0000000000..a3e71f89f3 --- /dev/null +++ b/apps/etherscan/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "jsx": "react-jsx", + "allowJs": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.app.json" + } + ] +} \ No newline at end of file diff --git a/nx.json b/nx.json index 2afa03ec50..e5fa51dd58 100644 --- a/nx.json +++ b/nx.json @@ -198,6 +198,9 @@ }, "vyper": { "tags": [] + }, + "etherscan": { + "tags": [] } }, "targetDependencies": { diff --git a/package.json b/package.json index 06b9c286cf..11c4897478 100644 --- a/package.json +++ b/package.json @@ -182,6 +182,7 @@ "file-path-filter": "^3.0.2", "file-saver": "^2.0.5", "form-data": "^4.0.0", + "formik": "^2.2.9", "fs-extra": "^3.0.1", "html-react-parser": "^1.3.0", "http-server": "^0.11.1", @@ -201,6 +202,7 @@ "react-dom": "^17.0.2", "react-draggable": "^4.4.4", "react-json-view": "^1.21.3", + "react-router-dom": "^6.3.0", "react-tabs": "^3.2.2", "regenerator-runtime": "0.13.7", "rss-parser": "^3.12.0", diff --git a/workspace.json b/workspace.json index a2eca1cee7..df7e8f9d28 100644 --- a/workspace.json +++ b/workspace.json @@ -1566,7 +1566,88 @@ "linter": "eslint", "config": "apps/vyper/.eslintrc", "files": [ - "apps/vyper/src/**/*.js", "apps/vyper/src/**/*.ts" + "apps/vyper/src/**/*.js", + "apps/vyper/src/**/*.ts" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + }, + "etherscan": { + "root": "apps/etherscan", + "sourceRoot": "apps/etherscan/src", + "projectType": "application", + "architect": { + "build": { + "builder": "@nrwl/web:build", + "outputs": [ + "{options.outputPath}" + ], + "options": { + "outputPath": "dist/apps/etherscan", + "index": "apps/etherscan/src/index.html", + "main": "apps/etherscan/src/main.tsx", + "polyfills": "apps/etherscan/src/polyfills.ts", + "tsConfig": "apps/etherscan/tsconfig.app.json", + "assets": [ + "apps/etherscan/src/favicon.ico", + "apps/etherscan/src/assets" + ], + "styles": [ + "apps/etherscan/src/styles.css" + ], + "scripts": [], + "webpackConfig": "@nrwl/react/plugins/webpack" + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "apps/etherscan/src/environments/environment.ts", + "with": "apps/etherscan/src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + } + ] + } + } + }, + "serve": { + "builder": "@nrwl/web:dev-server", + "options": { + "buildTarget": "etherscan:build", + "port": 5003 + }, + "configurations": { + "production": { + "buildTarget": "etherscan:build:production", + "hmr": false + } + } + }, + "lint": { + "builder": "@nrwl/linter:lint", + "options": { + "linter": "eslint", + "config": "apps/vyper/.eslintrc", + "files": [ + "apps/vyper/src/**/*.js", + "apps/vyper/src/**/*.ts" ], "exclude": [ "**/node_modules/**" diff --git a/yarn.lock b/yarn.lock index bba528ba28..cd49915370 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1622,6 +1622,13 @@ dependencies: regenerator-runtime "^0.13.4" +"@babel/runtime@^7.7.6": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" + integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/template@7.0.0-beta.53": version "7.0.0-beta.53" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.53.tgz#3322290900d0b187b0a7174381e1f3bb71050d2e" @@ -9136,6 +9143,11 @@ deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== +deepmerge@^2.1.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.2.1.tgz#5d3ff22a01c00f645405a2fbc17d0778a1801170" + integrity sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA== + deepmerge@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" @@ -11250,6 +11262,19 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" +formik@^2.2.9: + version "2.2.9" + resolved "https://registry.yarnpkg.com/formik/-/formik-2.2.9.tgz#8594ba9c5e2e5cf1f42c5704128e119fc46232d0" + integrity sha512-LQLcISMmf1r5at4/gyJigGn0gOwFbeEAlji+N9InZF6LIMXnFNkO42sCI8Jt84YZggpD4cPWObAZaxpEFtSzNA== + dependencies: + deepmerge "^2.1.1" + hoist-non-react-statics "^3.3.0" + lodash "^4.17.21" + lodash-es "^4.17.21" + react-fast-compare "^2.0.1" + tiny-warning "^1.0.2" + tslib "^1.10.0" + forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -12331,6 +12356,13 @@ header-case@^2.0.4: capital-case "^1.0.4" tslib "^2.0.3" +history@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/history/-/history-5.3.0.tgz#1548abaa245ba47992f063a0783db91ef201c73b" + integrity sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ== + dependencies: + "@babel/runtime" "^7.7.6" + hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -15292,6 +15324,11 @@ lockfile@~1.0.3: resolved "https://registry.yarnpkg.com/lockfile/-/lockfile-1.0.3.tgz#2638fc39a0331e9cac1a04b71799931c9c50df79" integrity sha1-Jjj8OaAzHpysGgS3F5mTHJxQ33k= +lodash-es@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" + integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw== + lodash._arraycopy@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._arraycopy/-/lodash._arraycopy-3.0.0.tgz#76e7b7c1f1fb92547374878a562ed06a3e50f6e1" @@ -19584,6 +19621,11 @@ react-draggable@^4.4.4: clsx "^1.1.1" prop-types "^15.6.0" +react-fast-compare@^2.0.1: + version "2.0.4" + resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-2.0.4.tgz#e84b4d455b0fec113e0402c329352715196f81f9" + integrity sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw== + react-is@^16.3.2, react-is@^16.7.0, react-is@^16.8.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" @@ -19645,6 +19687,21 @@ react-refresh@^0.9.0: resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.9.0.tgz#71863337adc3e5c2f8a6bfddd12ae3bfe32aafbf" integrity sha512-Gvzk7OZpiqKSkxsQvO/mbTN1poglhmAV7gR/DdIrRrSMXraRQQlfikRJOr3Nb9GTMPC5kof948Zy6jJZIFtDvQ== +react-router-dom@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.3.0.tgz#a0216da813454e521905b5fa55e0e5176123f43d" + integrity sha512-uaJj7LKytRxZNQV8+RbzJWnJ8K2nPsOOEuX7aQstlMZKQT0164C+X2w6bnkqU3sjtLvpd5ojrezAyfZ1+0sStw== + dependencies: + history "^5.2.0" + react-router "6.3.0" + +react-router@6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.3.0.tgz#3970cc64b4cb4eae0c1ea5203a80334fdd175557" + integrity sha512-7Wh1DzVQ+tlFjkeo+ujvjSqSJmkt1+8JO+T5xklPlgrh70y7ogx75ODRW0ThWhY7S+6yEDks8TYrtQe/aoboBQ== + dependencies: + history "^5.2.0" + react-tabs@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/react-tabs/-/react-tabs-3.2.2.tgz#07bdc3cdb17bdffedd02627f32a93cd4b3d6e4d0" @@ -22487,6 +22544,11 @@ tiny-invariant@^1.0.6: resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.2.0.tgz#a1141f86b672a9148c72e978a19a73b9b94a15a9" integrity sha512-1Uhn/aqw5C6RI4KejVeTg6mIS7IqxnLJ8Mv2tV5rTc0qWobay7pDUz6Wi392Cnc8ak1H0F2cjoRzb2/AW4+Fvg== +tiny-warning@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" + integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== + tmp@0.0.33, tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" From 144404bd04365824f8037dc5004bf100b5333e8a Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 3 Aug 2022 12:48:14 +0200 Subject: [PATCH 154/179] add e2e for etherscan --- .circleci/config.yml | 50 +++++++++++++++++++ apps/remix-ide-e2e/src/tests/etherscan_api.ts | 24 +++++++++ .../ci/browser_tests_etherscan_plugin.sh | 25 ++++++++++ 3 files changed, 99 insertions(+) create mode 100644 apps/remix-ide-e2e/src/tests/etherscan_api.ts create mode 100755 apps/remix-ide/ci/browser_tests_etherscan_plugin.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index bccbf0146a..2095b373fe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -310,6 +310,50 @@ jobs: path: ./reports/tests - store_artifacts: path: ./reports/screenshots + + remix-ide-etherscan-plugin: + docker: + # specify the version you desire here + - image: cimg/node:14.17.6-browsers + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + resource_class: xlarge + # - image: circleci/mongo:3.4.4 + environment: + - COMMIT_AUTHOR_EMAIL: "yann@ethereum.org" + - COMMIT_AUTHOR: "Circle CI" + working_directory: ~/remix-project + parallelism: 10 + steps: + - browser-tools/install-chrome + - browser-tools/install-chromedriver + - run: + command: | + google-chrome --version + chromedriver --version + java -jar /usr/local/bin/selenium.jar --version + name: Check install + - checkout + - checkout + - attach_workspace: + at: . + - run: unzip ./persist/dist.zip + - restore_cache: + keys: + - v1-deps-{{ checksum "yarn.lock" }} + - run: yarn install + - run: + name: Start Selenium + command: java -jar /usr/local/bin/selenium.jar + background: true + - run: npx nx build etherscan + - run: ./apps/remix-ide/ci/browser_tests_etherscan_plugin.sh + - store_test_results: + path: ./reports/tests + - store_artifacts: + path: ./reports/screenshots remix-ide-plugin-api: docker: @@ -467,6 +511,9 @@ workflows: - remix-ide-vyper-plugin: requires: - build + - remix-ide-etherscan-plugin: + requires: + - build - remix-ide-chrome: requires: - build @@ -481,6 +528,7 @@ workflows: - remix-ide-firefox - remix-ide-plugin-api - remix-ide-vyper-plugin + - remix-ide-etherscan-plugin filters: branches: only: remix_live @@ -492,6 +540,7 @@ workflows: - remix-ide-firefox - remix-ide-plugin-api - remix-ide-vyper-plugin + - remix-ide-etherscan-plugin filters: branches: only: master @@ -503,6 +552,7 @@ workflows: - remix-ide-firefox - remix-ide-plugin-api - remix-ide-vyper-plugin + - remix-ide-etherscan-plugin filters: branches: only: remix_beta diff --git a/apps/remix-ide-e2e/src/tests/etherscan_api.ts b/apps/remix-ide-e2e/src/tests/etherscan_api.ts new file mode 100644 index 0000000000..719db61972 --- /dev/null +++ b/apps/remix-ide-e2e/src/tests/etherscan_api.ts @@ -0,0 +1,24 @@ +'use strict' +import { NightwatchBrowser } from 'nightwatch' +import init from '../helpers/init' + +declare global { + interface Window { testplugin: { name: string, url: string }; } +} + +module.exports = { + '@disabled': true, + before: function (browser: NightwatchBrowser, done: VoidFunction) { + init(browser, done, null, true, { name: 'etherscan', url: 'http://127.0.0.1:5003'}) + }, + + 'Should load etherscan plugin #group1': function (browser: NightwatchBrowser) { + browser.clickLaunchIcon('pluginManager') + .scrollAndClick('[data-id="pluginManagerComponentActivateButtonetherscan"]') + .clickLaunchIcon('etherscan') + .pause(5000) + // @ts-ignore + .frame(0) + .waitForElementNotVisible('input[name="apiKey"]') + } +} diff --git a/apps/remix-ide/ci/browser_tests_etherscan_plugin.sh b/apps/remix-ide/ci/browser_tests_etherscan_plugin.sh new file mode 100755 index 0000000000..fdb420fc69 --- /dev/null +++ b/apps/remix-ide/ci/browser_tests_etherscan_plugin.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -e + +BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}} +echo "$BUILD_ID" +TEST_EXITCODE=0 + +yarn run serve:production & +npx nx serve etherscan & + +sleep 5 + +yarn run build:e2e + +TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "etherscan_api" | sort | circleci tests split ) +for TESTFILE in $TESTFILES; do + npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=chrome || TEST_EXITCODE=1 +done + +echo "$TEST_EXITCODE" +if [ "$TEST_EXITCODE" -eq 1 ] +then + exit 1 +fi From a40a18f158b7489700feaede9ff6970e2b26eb5a Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 4 Aug 2022 09:34:28 +0200 Subject: [PATCH 155/179] remove console.log --- apps/etherscan/src/app/app.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/etherscan/src/app/app.tsx b/apps/etherscan/src/app/app.tsx index d46b66fccc..653d90bfb1 100644 --- a/apps/etherscan/src/app/app.tsx +++ b/apps/etherscan/src/app/app.tsx @@ -43,14 +43,11 @@ const App = () => { contractsRef.current = contracts useEffect(() => { - console.log("Remix Etherscan loading...") const client = new PluginClient() createClient(client) const loadClient = async () => { await client.onload() setClientInstance(client) - console.log("Remix Etherscan Plugin has been loaded") - client.on("solidity", "compilationFinished", ( @@ -59,7 +56,6 @@ const App = () => { languageVersion: string, data: CompilationResult ) => { - console.log("New compilation received") const newContractsNames = getNewContractNames(data) const newContractsToSave: string[] = [ From 46a989d8e41cd6d16913f29b97d08f9365158874 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 4 Aug 2022 09:35:38 +0200 Subject: [PATCH 156/179] use console.error --- apps/etherscan/src/app/hooks/useLocalStorage.tsx | 4 ++-- apps/etherscan/src/app/utils/utilities.ts | 2 +- apps/etherscan/src/app/views/VerifyView.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/etherscan/src/app/hooks/useLocalStorage.tsx b/apps/etherscan/src/app/hooks/useLocalStorage.tsx index cca4a83a72..dbef5378a8 100644 --- a/apps/etherscan/src/app/hooks/useLocalStorage.tsx +++ b/apps/etherscan/src/app/hooks/useLocalStorage.tsx @@ -11,7 +11,7 @@ export function useLocalStorage(key: string, initialValue: any) { return item ? JSON.parse(item) : initialValue } catch (error) { // If error also return initialValue - console.log(error) + console.error(error) return initialValue } }) @@ -29,7 +29,7 @@ export function useLocalStorage(key: string, initialValue: any) { window.localStorage.setItem(key, JSON.stringify(valueToStore)) } catch (error) { // A more advanced implementation would handle the error case - console.log(error) + console.error(error) } } diff --git a/apps/etherscan/src/app/utils/utilities.ts b/apps/etherscan/src/app/utils/utilities.ts index 17ef6fc8a0..748babf9e5 100644 --- a/apps/etherscan/src/app/utils/utilities.ts +++ b/apps/etherscan/src/app/utils/utilities.ts @@ -29,6 +29,6 @@ export const getReceiptStatus = async ( const { result } = response.data return result } catch (error) { - console.log("Error", error) + console.error(error) } } diff --git a/apps/etherscan/src/app/views/VerifyView.tsx b/apps/etherscan/src/app/views/VerifyView.tsx index a57b23a8cb..0cf383dc8b 100644 --- a/apps/etherscan/src/app/views/VerifyView.tsx +++ b/apps/etherscan/src/app/views/VerifyView.tsx @@ -170,7 +170,7 @@ export const VerifyView: React.FC = ({ } return result } catch (error) { - console.log("Error, something wrong happened", error) + console.error(error) setResults("Something wrong happened, try again") } } From b964e748891d77a4a22436813cf24fcad162a02e Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 4 Aug 2022 09:39:31 +0200 Subject: [PATCH 157/179] =?UTF-8?q?use=20goerli=20instead=20of=20g=C3=B6rl?= =?UTF-8?q?i?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/etherscan/src/app/utils/utilities.ts | 4 +--- libs/remix-core-plugin/src/lib/compiler-metadata.ts | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/etherscan/src/app/utils/utilities.ts b/apps/etherscan/src/app/utils/utilities.ts index 748babf9e5..d7300806a3 100644 --- a/apps/etherscan/src/app/utils/utilities.ts +++ b/apps/etherscan/src/app/utils/utilities.ts @@ -13,9 +13,7 @@ export const getNetworkName = async (client: RemixClient) => { if (!network) { throw new Error("no known network to verify against") } - const name = network.name!.toLowerCase() - // TODO : remove that when https://github.com/ethereum/remix-ide/issues/2017 is fixe - return name === "görli" ? "goerli" : name + return network.name!.toLowerCase() } export const getReceiptStatus = async ( diff --git a/libs/remix-core-plugin/src/lib/compiler-metadata.ts b/libs/remix-core-plugin/src/lib/compiler-metadata.ts index 9a69e616f4..403c22b90b 100644 --- a/libs/remix-core-plugin/src/lib/compiler-metadata.ts +++ b/libs/remix-core-plugin/src/lib/compiler-metadata.ts @@ -15,7 +15,7 @@ export class CompilerMetadata extends Plugin { innerPath: string constructor () { super(profile) - this.networks = ['VM:-', 'main:1', 'ropsten:3', 'rinkeby:4', 'kovan:42', 'görli:5', 'Custom'] + this.networks = ['VM:-', 'main:1', 'ropsten:3', 'rinkeby:4', 'kovan:42', 'goerli:5', 'Custom'] this.innerPath = 'artifacts' } From 6cf0474e3e869a42621017053f88e78e4b676ff4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 4 Aug 2022 09:40:52 +0200 Subject: [PATCH 158/179] update issue url --- apps/etherscan/src/app/views/ErrorView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/etherscan/src/app/views/ErrorView.tsx b/apps/etherscan/src/app/views/ErrorView.tsx index 5c9e623231..69e022e47c 100644 --- a/apps/etherscan/src/app/views/ErrorView.tsx +++ b/apps/etherscan/src/app/views/ErrorView.tsx @@ -21,7 +21,7 @@ export const ErrorView: React.FC = () => { Please raise an issue:{" "} Here From 85303fec002f6f4f68e485257c20c8f46c5b8f33 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 4 Aug 2022 09:52:52 +0200 Subject: [PATCH 159/179] fix e2e --- .../src/app/components/HeaderWithSettings.tsx | 1 + .../src/app/components/SubmitButton.tsx | 5 +- .../src/app/views/CaptureKeyView.tsx | 2 +- apps/etherscan/src/app/views/VerifyView.tsx | 4 +- apps/remix-ide-e2e/src/tests/etherscan_api.ts | 87 ++++++++++++++++++- 5 files changed, 93 insertions(+), 6 deletions(-) diff --git a/apps/etherscan/src/app/components/HeaderWithSettings.tsx b/apps/etherscan/src/app/components/HeaderWithSettings.tsx index f0ba96ae6b..14e048d6cd 100644 --- a/apps/etherscan/src/app/components/HeaderWithSettings.tsx +++ b/apps/etherscan/src/app/components/HeaderWithSettings.tsx @@ -18,6 +18,7 @@ interface IconProps { const HomeIcon: React.FC = ({ from, themeType }: IconProps) => { return ( = ({ text, + dataId, isSubmitting = false, }) => { return (
)} diff --git a/apps/etherscan/src/app/views/CaptureKeyView.tsx b/apps/etherscan/src/app/views/CaptureKeyView.tsx index 2bac179293..9703ec10ff 100644 --- a/apps/etherscan/src/app/views/CaptureKeyView.tsx +++ b/apps/etherscan/src/app/views/CaptureKeyView.tsx @@ -48,7 +48,7 @@ export const CaptureKeyView: React.FC = () => {
- +
)} diff --git a/apps/etherscan/src/app/views/VerifyView.tsx b/apps/etherscan/src/app/views/VerifyView.tsx index 0cf383dc8b..3e85d471b7 100644 --- a/apps/etherscan/src/app/views/VerifyView.tsx +++ b/apps/etherscan/src/app/views/VerifyView.tsx @@ -284,12 +284,12 @@ export const VerifyView: React.FC = ({ />
- + )} -
diff --git a/apps/remix-ide-e2e/src/tests/etherscan_api.ts b/apps/remix-ide-e2e/src/tests/etherscan_api.ts index 719db61972..7089d5b563 100644 --- a/apps/remix-ide-e2e/src/tests/etherscan_api.ts +++ b/apps/remix-ide-e2e/src/tests/etherscan_api.ts @@ -19,6 +19,89 @@ module.exports = { .pause(5000) // @ts-ignore .frame(0) - .waitForElementNotVisible('input[name="apiKey"]') - } + .waitForElementVisible('input[name="apiKey"]') + .setValue('input[name="apiKey"]', '2HKUX5ZVASZIKWJM8MIQVCRUVZ6JAWT531') + .click('[data-id="save-api-key"]') + }, + + 'Should verify a contract (contract is already verified) #group1': function (browser: NightwatchBrowser) { + browser + .frameParent() + .clickLaunchIcon('udapp') // switch to Goerli + .switchEnvironment('External Http Provider') + .waitForElementPresent('[data-id="basic-http-provider-modal-footer-ok-react"]') + .execute(() => { + (document.querySelector('*[data-id="basic-http-providerModalDialogContainer-react"] input[data-id="modalDialogCustomPromp"]') as any).focus() + }, [], () => {}) + .setValue('[data-id="modalDialogCustomPromp"]', 'https://remix-goerli.ethdevops.io') + .modalFooterOKClick('basic-http-provider') + .clickLaunchIcon('solidity') // compile + .testContracts('Owner_1.sol', { content: verifiedContract }, ['Owner']) + .clickLaunchIcon('etherscan') // start etherscan verification + // @ts-ignore + .frame(0) + .click('[data-id="home"]') + .setValue('select[name="contractName"]', 'Owner') + .setValue('*[name="contractAddress"]', '0x9981c9d00103da481c3c65b22a79582a3e3ff50b') + .click('[data-id="verify-contract"]') + .waitForElementVisible('[data-id="verify-result"]') + .waitForElementContainsText('[data-id="verify-result"]', 'Contract source code already verified') + } } + +const verifiedContract = ` +// SPDX-License-Identifier: GPL-3.0 + +pragma solidity >=0.7.0 <0.9.0; + +/** + * @title Owner + * @dev Set & change owner + */ +contract Owner { + + 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"); + _; + } + + function getInt() public returns (uint) { + return 123498; + } + + /** + * @dev Set contract deployer as owner + */ + 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 { + emit OwnerSet(owner, newOwner); + owner = newOwner; + } + + /** + * @dev Return owner address + * @return address of owner + */ + function getOwner() external view returns (address) { + return owner; + } +}` From 9d8b7eeeba912e9a9cadc3a39edaa2513c62a1e0 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 20 Jul 2022 12:10:19 +0200 Subject: [PATCH 160/179] fixing null workspace --- apps/remix-ide/src/app/panels/file-panel.js | 2 +- libs/remix-ui/search/src/lib/context/context.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide/src/app/panels/file-panel.js b/apps/remix-ide/src/app/panels/file-panel.js index ba45ff806b..e24b137058 100644 --- a/apps/remix-ide/src/app/panels/file-panel.js +++ b/apps/remix-ide/src/app/panels/file-panel.js @@ -57,7 +57,7 @@ module.exports = class Filepanel extends ViewPlugin { this.slitherHandle = new SlitherHandle() this.workspaces = [] this.appManager = appManager - this.currentWorkspaceMetadata = {} + this.currentWorkspaceMetadata = null } render () { diff --git a/libs/remix-ui/search/src/lib/context/context.tsx b/libs/remix-ui/search/src/lib/context/context.tsx index 9af59cce28..2b372a24c8 100644 --- a/libs/remix-ui/search/src/lib/context/context.tsx +++ b/libs/remix-ui/search/src/lib/context/context.tsx @@ -338,8 +338,10 @@ export const SearchProvider = ({ async function fetchWorkspace() { try { const workspace = await plugin.call('filePanel', 'getCurrentWorkspace') - if (workspace) value.setCurrentWorkspace(workspace.name) - setFiles(await getDirectory('/', plugin)) + if (workspace) { + value.setCurrentWorkspace(workspace.name) + setFiles(await getDirectory('/', plugin)) + } } catch (e) { console.log(e) } From 787aa02e7c55dab9924001807f564c8a9503290f Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Tue, 9 Aug 2022 12:24:45 +0200 Subject: [PATCH 161/179] update test --- apps/remix-ide-e2e/src/tests/editor_line_text.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/editor_line_text.test.ts b/apps/remix-ide-e2e/src/tests/editor_line_text.test.ts index d0d079cf68..afff1c8f28 100644 --- a/apps/remix-ide-e2e/src/tests/editor_line_text.test.ts +++ b/apps/remix-ide-e2e/src/tests/editor_line_text.test.ts @@ -13,8 +13,8 @@ module.exports = { .openFile('contracts') .openFile('contracts/1_Storage.sol') .addFile('scripts/addlinetext.ts', {content: addLineText}) - .pause(2000) - .executeScript('remix.exeCurrent()') + .pause(4000) + .executeScriptInTerminal('remix.exeCurrent()') .pause(4000) .openFile('contracts/1_Storage.sol') .useXpath() From f60dc9805e6cc2870bc72e697466a04d2f8c9a7e Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 1 Aug 2022 13:41:03 +0200 Subject: [PATCH 162/179] add action to copy parameters --- .../src/lib/components/contractGUI.tsx | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx index c5f6f394ce..fb16d4a49f 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx @@ -5,6 +5,7 @@ import { ContractGUIProps } from '../types' import { CopyToClipboard } from '@remix-ui/clipboard' const txFormat = remixLib.execution.txFormat +const txHelper = remixLib.execution.txHelper export function ContractGUI (props: ContractGUIProps) { const [title, setTitle] = useState('') const [basicInput, setBasicInput] = useState('') @@ -74,7 +75,7 @@ export function ContractGUI (props: ContractGUIProps) { } }, [props.lookupOnly, props.funcABI, title]) - const getContentOnCTC = () => { + const getEncodedCall = () => { const multiString = getMultiValsString(multiFields.current) // copy-to-clipboard icon is only visible for method requiring input params if (!multiString) { @@ -95,6 +96,20 @@ export function ContractGUI (props: ContractGUIProps) { } } + const getEncodedParams = () => { + try { + const multiString = getMultiValsString(multiFields.current) + // copy-to-clipboard icon is only visible for method requiring input params + if (!multiString) { + return 'cannot encode empty arguments' + } + const multiJSON = JSON.parse('[' + multiString + ']') + return txHelper.encodeParams(props.funcABI, multiJSON) + } catch (e) { + console.error(e) + } + } + const switchMethodViewOn = () => { setToggleContainer(true) makeMultiVal() @@ -251,9 +266,20 @@ export function ContractGUI (props: ContractGUIProps) { })}
- - +
+ + + + + +
{ props.deployOption && (props.deployOption || []).length > 0 ? From dcfacb3041d8eeeb79605f1b345451196f187ec7 Mon Sep 17 00:00:00 2001 From: lianahus Date: Tue, 2 Aug 2022 22:04:40 +0200 Subject: [PATCH 163/179] UI inprovements --- .../src/lib/components/contractGUI.tsx | 24 ++++++++++++------- .../src/lib/components/multiDeployInput.tsx | 8 +++---- libs/remix-ui/run-tab/src/lib/css/run-tab.css | 2 +- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx index fb16d4a49f..20965b644f 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx @@ -265,21 +265,29 @@ export function ContractGUI (props: ContractGUIProps) {
) })}
-
- -
- +
+ + +
{ props.deployOption && (props.deployOption || []).length > 0 ? diff --git a/libs/remix-ui/run-tab/src/lib/components/multiDeployInput.tsx b/libs/remix-ui/run-tab/src/lib/components/multiDeployInput.tsx index cec20b223c..6f3d355852 100644 --- a/libs/remix-ui/run-tab/src/lib/components/multiDeployInput.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/multiDeployInput.tsx @@ -2,13 +2,13 @@ import React, { useRef, useState } from 'react' import { MultiDeployInputProps } from '../types' import { DeployButton } from './deployButton' -export function MultiDeployInput (props: MultiDeployInputProps) { +export function MultiDeployInput(props: MultiDeployInputProps) { const multiFields = useRef>([]) - - return ( + + return (
-
+
Deploy
diff --git a/libs/remix-ui/run-tab/src/lib/css/run-tab.css b/libs/remix-ui/run-tab/src/lib/css/run-tab.css index 2921381007..1c9cd7fe5b 100644 --- a/libs/remix-ui/run-tab/src/lib/css/run-tab.css +++ b/libs/remix-ui/run-tab/src/lib/css/run-tab.css @@ -357,7 +357,7 @@ border-bottom-left-radius: 0; } .udapp_contractProperty button { - min-width: 100px; + min-width: 80px; width: 100px; margin:0; word-break: inherit; From f10f104e01b0e28423470925b1d2c61d5acd2630 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Wed, 3 Aug 2022 17:42:56 +0530 Subject: [PATCH 164/179] show contract balance --- .../run-tab/src/lib/components/instanceContainerUI.tsx | 1 + .../remix-ui/run-tab/src/lib/components/universalDappUI.tsx | 6 ++++++ libs/remix-ui/run-tab/src/lib/run-tab.tsx | 1 + libs/remix-ui/run-tab/src/lib/types/index.ts | 2 ++ 4 files changed, 10 insertions(+) diff --git a/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx b/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx index 6890c53f6d..1d51e10b04 100644 --- a/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx @@ -35,6 +35,7 @@ export function InstanceContainerUI (props: InstanceContainerProps) { runTransactions={props.runTransactions} sendValue={props.sendValue} getFuncABIInputs={props.getFuncABIInputs} + blockchain={props.blockchain} /> }) }
diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 679ab61b15..690c03d5eb 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -20,6 +20,7 @@ export function UniversalDappUI (props: UdappProps) { const [llIError, setLlIError] = useState('') const [calldataValue, setCalldataValue] = useState('') const [evmBC, setEvmBC] = useState(null) + const [contractBal, setContractBal] = useState(0) useEffect(() => { if (!props.instance.abi) { @@ -33,6 +34,10 @@ export function UniversalDappUI (props: UdappProps) { useEffect(() => { if (props.instance.address) { + props.blockchain.getBalanceInEther(props.instance.address, (err, balInEth) => { + if (!err) setContractBal(balInEth) + }) + // @ts-ignore let address = (props.instance.address.slice(0, 2) === '0x' ? '' : '0x') + props.instance.address.toString('hex') @@ -228,6 +233,7 @@ export function UniversalDappUI (props: UdappProps) {
+
{ contractABI && contractABI.map((funcABI, index) => { diff --git a/libs/remix-ui/run-tab/src/lib/run-tab.tsx b/libs/remix-ui/run-tab/src/lib/run-tab.tsx index 128d315201..5c7548536b 100644 --- a/libs/remix-ui/run-tab/src/lib/run-tab.tsx +++ b/libs/remix-ui/run-tab/src/lib/run-tab.tsx @@ -263,6 +263,7 @@ export function RunTabUI (props: RunTabProps) { runTransactions={executeTransactions} sendValue={runTab.sendValue} getFuncABIInputs={getFuncABIValues} + blockchain={plugin.blockchain} />
diff --git a/libs/remix-ui/run-tab/src/lib/types/index.ts b/libs/remix-ui/run-tab/src/lib/types/index.ts index d27eb1f580..3744759b5b 100644 --- a/libs/remix-ui/run-tab/src/lib/types/index.ts +++ b/libs/remix-ui/run-tab/src/lib/types/index.ts @@ -208,6 +208,7 @@ export interface InstanceContainerProps { mainnetPrompt: (tx: Tx, network: Network, amount: string, gasEstimation: string, gasFees: (maxFee: string, cb: (txFeeText: string, priceStatus: boolean) => void) => void, determineGasPrice: (cb: (txFeeText: string, gasPriceValue: string, gasPriceStatus: boolean) => void) => void) => JSX.Element, sendValue: string, getFuncABIInputs: (funcABI: FuncABI) => string + blockchain: any } export interface Modal { @@ -306,6 +307,7 @@ export interface UdappProps { funcIndex?: number) => void, sendValue: string, getFuncABIInputs: (funcABI: FuncABI) => string + blockchain: any } export interface DeployButtonProps { From ebed9eaca0ebf2e62777f154437187e1ab2eef4d Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Thu, 4 Aug 2022 12:50:35 +0530 Subject: [PATCH 165/179] left align --- libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 690c03d5eb..7d1ada661b 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -233,8 +233,10 @@ export function UniversalDappUI (props: UdappProps) {
-
+
+ Balance: {contractBal} ETH +
{ contractABI && contractABI.map((funcABI, index) => { if (funcABI.type !== 'function') return null From ff4eee19b3914f012be008b3e164002ec89c9c16 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Thu, 4 Aug 2022 14:14:30 +0530 Subject: [PATCH 166/179] update balance --- .../src/lib/components/universalDappUI.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 7d1ada661b..6156f82b5f 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -34,10 +34,7 @@ export function UniversalDappUI (props: UdappProps) { useEffect(() => { if (props.instance.address) { - props.blockchain.getBalanceInEther(props.instance.address, (err, balInEth) => { - if (!err) setContractBal(balInEth) - }) - + updateBalance() // @ts-ignore let address = (props.instance.address.slice(0, 2) === '0x' ? '' : '0x') + props.instance.address.toString('hex') @@ -52,6 +49,16 @@ export function UniversalDappUI (props: UdappProps) { } }, [props.instance.contractData]) + props.blockchain.event.register('transactionExecuted', (error, from, to, data, call, txResult, timestamp, _payload) => { + if (!error) updateBalance() + }) + + const updateBalance = () => { + props.blockchain.getBalanceInEther(props.instance.address, (err, balInEth) => { + if (!err) setContractBal(balInEth) + }) + } + const sendData = () => { setLlIError('') const fallback = txHelper.getFallbackInterface(contractABI) From c671a899d57d2e5b4ec951c8af2e0f119c956219 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Thu, 4 Aug 2022 18:29:20 +0530 Subject: [PATCH 167/179] dark label --- libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 6156f82b5f..5b7926ffa3 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -242,7 +242,7 @@ export function UniversalDappUI (props: UdappProps) {
- Balance: {contractBal} ETH +
{ contractABI && contractABI.map((funcABI, index) => { From 064b0921c630c842e00f505e918400e9287e4d8d Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Fri, 5 Aug 2022 15:33:16 +0530 Subject: [PATCH 168/179] periodically update balance --- libs/remix-ui/run-tab/src/lib/actions/index.ts | 11 ++++++++++- .../src/lib/components/universalDappUI.tsx | 15 +++++---------- libs/remix-ui/run-tab/src/lib/reducers/runTab.ts | 1 + libs/remix-ui/run-tab/src/lib/types/index.ts | 2 ++ 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/actions/index.ts b/libs/remix-ui/run-tab/src/lib/actions/index.ts index 5dc0eb2de7..bbf375eaed 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/index.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/index.ts @@ -3,7 +3,9 @@ import React from 'react' import { RunTab } from '../types/run-tab' import { resetAndInit, setupEvents } from './events' import { createNewBlockchainAccount, fillAccountsList, setExecutionContext, signMessageWithAddress } from './account' -import { clearInstances, clearPopUp, removeInstance, setAccount, setGasFee, setMatchPassphrasePrompt, setNetworkNameFromProvider, setPassphrasePrompt, setSelectedContract, setSendTransactionValue, setUnit, updateBaseFeePerGas, updateConfirmSettings, updateGasPrice, updateGasPriceStatus, updateMaxFee, updateMaxPriorityFee, updateScenarioPath, updateTxFeeContent } from './actions' +import { clearInstances, clearPopUp, removeInstance, setAccount, setGasFee, setMatchPassphrasePrompt, + setNetworkNameFromProvider, setPassphrasePrompt, setSelectedContract, setSendTransactionValue, setUnit, + updateBaseFeePerGas, updateConfirmSettings, updateGasPrice, updateGasPriceStatus, updateMaxFee, updateMaxPriorityFee, updateScenarioPath, updateTxFeeContent } from './actions' import { createInstance, getContext, getFuncABIInputs, getSelectedContract, loadAddress, runTransactions } from './deploy' import { CompilerAbstract as CompilerAbstractType } from '@remix-project/remix-solidity-ts' import { ContractData, FuncABI } from "@remix-project/core-plugin" @@ -26,6 +28,13 @@ export const initRunTab = (udapp: RunTab) => async (reducerDispatch: React.Dispa setupEvents(plugin, dispatch) setInterval(() => { fillAccountsList(plugin, dispatch) + if (plugin.REACT_API?.instances?.instanceList?.length){ + for (const instance of plugin.REACT_API.instances.instanceList) { + plugin.blockchain.getBalanceInEther(instance.address, (err, balInEth) => { + if (!err) instance.balance = balInEth + }) + } + } }, 1000) } diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 5b7926ffa3..2beb6bec1a 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -34,7 +34,6 @@ export function UniversalDappUI (props: UdappProps) { useEffect(() => { if (props.instance.address) { - updateBalance() // @ts-ignore let address = (props.instance.address.slice(0, 2) === '0x' ? '' : '0x') + props.instance.address.toString('hex') @@ -49,15 +48,11 @@ export function UniversalDappUI (props: UdappProps) { } }, [props.instance.contractData]) - props.blockchain.event.register('transactionExecuted', (error, from, to, data, call, txResult, timestamp, _payload) => { - if (!error) updateBalance() - }) - - const updateBalance = () => { - props.blockchain.getBalanceInEther(props.instance.address, (err, balInEth) => { - if (!err) setContractBal(balInEth) - }) - } + useEffect(() => { + if (props.instance.balance) { + setContractBal(props.instance.balance) + } + }, [props.instance.balance]) const sendData = () => { setLlIError('') diff --git a/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts b/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts index 5299b748ab..5bae13a09e 100644 --- a/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts +++ b/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts @@ -88,6 +88,7 @@ export interface RunTabState { instanceList: { contractData?: ContractData, address: string, + balance?: number, name: string, decodedResponse?: Record, abi?: any diff --git a/libs/remix-ui/run-tab/src/lib/types/index.ts b/libs/remix-ui/run-tab/src/lib/types/index.ts index 3744759b5b..5d6c819555 100644 --- a/libs/remix-ui/run-tab/src/lib/types/index.ts +++ b/libs/remix-ui/run-tab/src/lib/types/index.ts @@ -181,6 +181,7 @@ export interface InstanceContainerProps { instanceList: { contractData?: ContractData, address: string, + balance?: number, name: string, decodedResponse?: Record, abi?: any @@ -282,6 +283,7 @@ export interface UdappProps { instance: { contractData?: ContractData, address: string, + balance?: number, name: string, decodedResponse?: Record, abi?: any From 9a9aca509cd0ecc4b59b03a6aacb4bf7f65969aa Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Fri, 5 Aug 2022 19:36:31 +0530 Subject: [PATCH 169/179] naming --- .../run-tab/src/lib/components/instanceContainerUI.tsx | 1 - .../run-tab/src/lib/components/universalDappUI.tsx | 8 ++++---- libs/remix-ui/run-tab/src/lib/run-tab.tsx | 1 - libs/remix-ui/run-tab/src/lib/types/index.ts | 2 -- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx b/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx index 1d51e10b04..6890c53f6d 100644 --- a/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx @@ -35,7 +35,6 @@ export function InstanceContainerUI (props: InstanceContainerProps) { runTransactions={props.runTransactions} sendValue={props.sendValue} getFuncABIInputs={props.getFuncABIInputs} - blockchain={props.blockchain} /> }) }
diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 2beb6bec1a..3ac993bd23 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -20,7 +20,7 @@ export function UniversalDappUI (props: UdappProps) { const [llIError, setLlIError] = useState('') const [calldataValue, setCalldataValue] = useState('') const [evmBC, setEvmBC] = useState(null) - const [contractBal, setContractBal] = useState(0) + const [instanceBalance, setInstanceBalance] = useState(0) useEffect(() => { if (!props.instance.abi) { @@ -50,7 +50,7 @@ export function UniversalDappUI (props: UdappProps) { useEffect(() => { if (props.instance.balance) { - setContractBal(props.instance.balance) + setInstanceBalance(props.instance.balance) } }, [props.instance.balance]) @@ -236,8 +236,8 @@ export function UniversalDappUI (props: UdappProps) {
-
- +
+
{ contractABI && contractABI.map((funcABI, index) => { diff --git a/libs/remix-ui/run-tab/src/lib/run-tab.tsx b/libs/remix-ui/run-tab/src/lib/run-tab.tsx index 5c7548536b..128d315201 100644 --- a/libs/remix-ui/run-tab/src/lib/run-tab.tsx +++ b/libs/remix-ui/run-tab/src/lib/run-tab.tsx @@ -263,7 +263,6 @@ export function RunTabUI (props: RunTabProps) { runTransactions={executeTransactions} sendValue={runTab.sendValue} getFuncABIInputs={getFuncABIValues} - blockchain={plugin.blockchain} />
diff --git a/libs/remix-ui/run-tab/src/lib/types/index.ts b/libs/remix-ui/run-tab/src/lib/types/index.ts index 5d6c819555..8ef73156df 100644 --- a/libs/remix-ui/run-tab/src/lib/types/index.ts +++ b/libs/remix-ui/run-tab/src/lib/types/index.ts @@ -209,7 +209,6 @@ export interface InstanceContainerProps { mainnetPrompt: (tx: Tx, network: Network, amount: string, gasEstimation: string, gasFees: (maxFee: string, cb: (txFeeText: string, priceStatus: boolean) => void) => void, determineGasPrice: (cb: (txFeeText: string, gasPriceValue: string, gasPriceStatus: boolean) => void) => void) => JSX.Element, sendValue: string, getFuncABIInputs: (funcABI: FuncABI) => string - blockchain: any } export interface Modal { @@ -309,7 +308,6 @@ export interface UdappProps { funcIndex?: number) => void, sendValue: string, getFuncABIInputs: (funcABI: FuncABI) => string - blockchain: any } export interface DeployButtonProps { From 3ad9809e8de9ad6b8754acb1d997b48fecbd082f Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 8 Aug 2022 17:55:32 +0530 Subject: [PATCH 170/179] e2e tests --- .../src/tests/runAndDeploy.test.ts | 26 +++++++++++++++++++ .../src/lib/components/universalDappUI.tsx | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts b/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts index c8f2277ba2..075bd0e05a 100644 --- a/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts +++ b/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts @@ -65,6 +65,21 @@ module.exports = { }) }, + 'Should show and update balance for deployed contract on JavascriptVM #group3': function (browser: NightwatchBrowser) { + browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') + .clickLaunchIcon('filePanel') + .addFile('checkBalance.sol', sources[0]['checkBalance.sol']) + .clickLaunchIcon('udapp') + .setValue('*[data-id="dandrValue"]', '111') + .waitForElementVisible('*[data-id="Deploy - transact (payable)"]', 45000) + .click('*[data-id="Deploy - transact (payable)"]') + .pause(1000) + .clickInstance(1) + .pause(1000) + .waitForElementVisible('*[data-id="instanceBal"]', 45000) + .assert.containsText('*[data-id="instanceBal"]', 'Balance') + }, + 'Should run low level interaction (fallback function) #group3': function (browser: NightwatchBrowser) { browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') .clickInstance(0) @@ -224,6 +239,17 @@ const sources = [ message = _message; } }` + }, + 'checkBalance.sol': { + content: `pragma solidity ^0.8.0; + contract checkBalance { + constructor () payable {} + + function sendSomeEther(uint256 num) public { + payable(msg.sender).transfer(num); + } + + }` } } ] diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 3ac993bd23..d7cd9c09c3 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -236,7 +236,7 @@ export function UniversalDappUI (props: UdappProps) {
-
+
{ From a0ee033a52620d78808ad353bc6dc7c1e5984022 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 9 Aug 2022 10:35:36 +0530 Subject: [PATCH 171/179] add method --- libs/remix-ui/run-tab/src/lib/actions/deploy.ts | 10 ++++++++++ libs/remix-ui/run-tab/src/lib/actions/index.ts | 10 ++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/actions/deploy.ts b/libs/remix-ui/run-tab/src/lib/actions/deploy.ts index 440d805664..caf8e6de8a 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/deploy.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/deploy.ts @@ -300,4 +300,14 @@ export const runTransactions = ( export const getFuncABIInputs = (plugin: RunTab, funcABI: FuncABI) => { return plugin.blockchain.getInputs(funcABI) +} + +export const updateInstanceBalance = (plugin: RunTab) => { + if (plugin.REACT_API?.instances?.instanceList?.length) { + for (const instance of plugin.REACT_API.instances.instanceList) { + plugin.blockchain.getBalanceInEther(instance.address, (err, balInEth) => { + if (!err) instance.balance = balInEth + }) + } + } } \ No newline at end of file diff --git a/libs/remix-ui/run-tab/src/lib/actions/index.ts b/libs/remix-ui/run-tab/src/lib/actions/index.ts index bbf375eaed..6a20e9470d 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/index.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/index.ts @@ -6,7 +6,7 @@ import { createNewBlockchainAccount, fillAccountsList, setExecutionContext, sign import { clearInstances, clearPopUp, removeInstance, setAccount, setGasFee, setMatchPassphrasePrompt, setNetworkNameFromProvider, setPassphrasePrompt, setSelectedContract, setSendTransactionValue, setUnit, updateBaseFeePerGas, updateConfirmSettings, updateGasPrice, updateGasPriceStatus, updateMaxFee, updateMaxPriorityFee, updateScenarioPath, updateTxFeeContent } from './actions' -import { createInstance, getContext, getFuncABIInputs, getSelectedContract, loadAddress, runTransactions } from './deploy' +import { createInstance, getContext, getFuncABIInputs, getSelectedContract, loadAddress, runTransactions, updateInstanceBalance } from './deploy' import { CompilerAbstract as CompilerAbstractType } from '@remix-project/remix-solidity-ts' import { ContractData, FuncABI } from "@remix-project/core-plugin" import { DeployMode, MainnetPrompt } from '../types' @@ -28,13 +28,7 @@ export const initRunTab = (udapp: RunTab) => async (reducerDispatch: React.Dispa setupEvents(plugin, dispatch) setInterval(() => { fillAccountsList(plugin, dispatch) - if (plugin.REACT_API?.instances?.instanceList?.length){ - for (const instance of plugin.REACT_API.instances.instanceList) { - plugin.blockchain.getBalanceInEther(instance.address, (err, balInEth) => { - if (!err) instance.balance = balInEth - }) - } - } + updateInstanceBalance(plugin) }, 1000) } From e50171a719a95a23d992bd4e56c0dcdb9dc1fe00 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 9 Aug 2022 16:23:17 +0530 Subject: [PATCH 172/179] fix e2e --- apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts | 9 +++++++-- .../run-tab/src/lib/components/universalDappUI.tsx | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts b/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts index 075bd0e05a..e1edef7dad 100644 --- a/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts +++ b/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts @@ -66,6 +66,7 @@ module.exports = { }, 'Should show and update balance for deployed contract on JavascriptVM #group3': function (browser: NightwatchBrowser) { + let instanceAddress browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]') .clickLaunchIcon('filePanel') .addFile('checkBalance.sol', sources[0]['checkBalance.sol']) @@ -76,8 +77,12 @@ module.exports = { .pause(1000) .clickInstance(1) .pause(1000) - .waitForElementVisible('*[data-id="instanceBal"]', 45000) - .assert.containsText('*[data-id="instanceBal"]', 'Balance') + .getAddressAtPosition(1, (address) => { + instanceAddress = address + browser + .waitForElementVisible(`#instance${instanceAddress} [data-id="instanceContractBal"]`) + .assert.containsText(`#instance${instanceAddress} [data-id="instanceContractBal"]`, 'Balance:') + }) }, 'Should run low level interaction (fallback function) #group3': function (browser: NightwatchBrowser) { diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index d7cd9c09c3..46d2f2dfb7 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -236,7 +236,7 @@ export function UniversalDappUI (props: UdappProps) {
-
+
{ From a5001b02d41cabc025cc22099114f425947d30e4 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 9 Aug 2022 16:47:24 +0530 Subject: [PATCH 173/179] more e2e --- apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts b/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts index e1edef7dad..0d8df82b96 100644 --- a/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts +++ b/apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts @@ -81,7 +81,10 @@ module.exports = { instanceAddress = address browser .waitForElementVisible(`#instance${instanceAddress} [data-id="instanceContractBal"]`) - .assert.containsText(`#instance${instanceAddress} [data-id="instanceContractBal"]`, 'Balance:') + .assert.containsText(`#instance${instanceAddress} [data-id="instanceContractBal"]`, 'Balance: 0.000000000000000111 ETH') + .clickFunction('sendSomeEther - transact (not payable)', { types: 'uint256 num', values: '2' }) + .pause(1000) + .assert.containsText(`#instance${instanceAddress} [data-id="instanceContractBal"]`, 'Balance: 0.000000000000000109 ETH') }) }, From b295ecb90694a8f4f6fc9bdc60046a97df8c774e Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 10 Aug 2022 08:24:57 +0200 Subject: [PATCH 174/179] regular icon for delete workshop --- libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index 353e4ccf91..b56c83b5de 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -227,7 +227,7 @@ export function Workspace () { e.stopPropagation() deleteCurrentWorkspace() }} - className='fas fa-trash remixui_menuicon' + className='far fa-trash remixui_menuicon' title='Delete'> Date: Wed, 10 Aug 2022 15:07:21 +0200 Subject: [PATCH 175/179] Update publish-to-storage.tsx --- .../publish-to-storage/src/lib/publish-to-storage.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx b/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx index 8ff00ca026..51b5d46b01 100644 --- a/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx +++ b/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx @@ -31,12 +31,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => { modal(`Published ${contract.name}'s Metadata and Sources`, publishMessage(result.uploaded)) } catch (err) { - let parseError = err - try { - parseError = JSON.stringify(err) - } catch (e) { - } - modal('Swarm Publish Failed', publishMessageFailed(storage, parseError)) + modal('Swarm Publish Failed', publishMessageFailed(storage, err.message)) } } else { if (!api.config.get('settings/ipfs-url') && !modalShown) { @@ -81,7 +76,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => { const result = await publishToIPFS(contract, api) modal(`Published ${contract.name}'s Metadata and Sources`, publishMessage(result.uploaded)) } catch (err) { - modal('IPFS Publish Failed', publishMessageFailed(storage, err)) + modal('IPFS Publish Failed', publishMessageFailed(storage, err.message)) } setModalShown(true) } From 90cbe1082dbd0ff64d990a299e153d9fb05830b3 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 10 Aug 2022 15:17:54 +0200 Subject: [PATCH 176/179] disable ipfs e2e tests --- apps/remix-ide-e2e/src/tests/publishContract.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide-e2e/src/tests/publishContract.test.ts b/apps/remix-ide-e2e/src/tests/publishContract.test.ts index 38ee1c3e54..2545a53808 100644 --- a/apps/remix-ide-e2e/src/tests/publishContract.test.ts +++ b/apps/remix-ide-e2e/src/tests/publishContract.test.ts @@ -3,6 +3,7 @@ import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' module.exports = { + '@disabled': true, before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done) }, From 1914d38dda81847a3de42d2536c14acfb02e6fb4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 9 Aug 2022 16:28:13 +0200 Subject: [PATCH 177/179] fix display json rpc error --- apps/remix-ide/src/app/panels/terminal.js | 4 ++-- apps/remix-ide/src/app/tabs/web3-provider.js | 5 ++++- libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide/src/app/panels/terminal.js b/apps/remix-ide/src/app/panels/terminal.js index bd89f2d7ce..6d830c2054 100644 --- a/apps/remix-ide/src/app/panels/terminal.js +++ b/apps/remix-ide/src/app/panels/terminal.js @@ -100,8 +100,8 @@ class Terminal extends Plugin { this.terminalApi.logHtml(html) } - log (message) { - this.terminalApi.log(message) + log (message, type) { + this.terminalApi.log(message, type) } setDispatch(dispatch) { diff --git a/apps/remix-ide/src/app/tabs/web3-provider.js b/apps/remix-ide/src/app/tabs/web3-provider.js index 4bf96f062d..a6690f545e 100644 --- a/apps/remix-ide/src/app/tabs/web3-provider.js +++ b/apps/remix-ide/src/app/tabs/web3-provider.js @@ -29,7 +29,10 @@ export class Web3ProviderModule extends Plugin { const provider = this.blockchain.web3().currentProvider // see https://github.com/ethereum/web3.js/pull/1018/files#diff-d25786686c1053b786cc2626dc6e048675050593c0ebaafbf0814e1996f22022R129 provider[provider.sendAsync ? 'sendAsync' : 'send'](payload, async (error, message) => { - if (error) return reject(error) + if (error) { + this.call('terminal', 'log', error.data ? error.data : error, 'error') + return reject(error.data ? error.data : error) + } if (payload.method === 'eth_sendTransaction') { if (payload.params.length && !payload.params[0].to && message.result) { setTimeout(async () => { 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 d8cbe6d610..4c30fee8f9 100644 --- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx +++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx @@ -86,8 +86,8 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { scriptRunnerDispatch({ type: 'html', payload: { message: [html ? html.innerText ? html.innerText : html : null] } }) }, - log: (message) => { - scriptRunnerDispatch({ type: 'log', payload: { message: [message] } }) + log: (message, type) => { + scriptRunnerDispatch({ type: type ? type : 'log', payload: { message: [message] } }) } }) }, []) From da6172aa4e0f1ffd16dceb84ee318045120d2121 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 10 Aug 2022 12:55:55 +0200 Subject: [PATCH 178/179] fix ipfs publish --- apps/etherscan/src/app/routes.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/etherscan/src/app/routes.tsx b/apps/etherscan/src/app/routes.tsx index 68fd76318f..1400a601df 100644 --- a/apps/etherscan/src/app/routes.tsx +++ b/apps/etherscan/src/app/routes.tsx @@ -1,6 +1,6 @@ import React from "react" import { - BrowserRouter as Router, + HashRouter as Router, Route, Routes, RouteProps, From 4c49207f7d2d0bbbe9dd43b2a0d722bc3ecbe51f Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 4 Aug 2022 11:55:32 +0200 Subject: [PATCH 179/179] add e2e for calls --- apps/remix-ide-e2e/src/tests/url.test.ts | 11 ++++++++++- apps/remix-ide/src/app.js | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index 832dca69d0..2bc6fe778f 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -246,6 +246,15 @@ module.exports = { .openFile('contracts') .openFile('contracts/governance') .openFile('contracts/governance/UnionGovernor.sol') - .end() + }, + + 'Should execute function call from URL parameters #group2': function (browser: NightwatchBrowser) { + browser + .switchWorkspace('default_workspace') + .url('http://127.0.0.1:8080?calls=fileManager//open//contracts/3_Ballot.sol///terminal//log//log') + .refresh() + .waitForElementVisible('*[data-shared="tooltipPopup"]') + .waitForElementContainsText('*[data-shared="tooltipPopup"]', 'initiating fileManager and calling "open" ...') + .waitForElementContainsText('*[data-shared="tooltipPopup"]', 'initiating terminal and calling "log" ...') } } diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index de6d2ba470..a05934ea18 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -410,7 +410,7 @@ class AppComponent { if (params.call) { const callDetails = params.call.split('//') if (callDetails.length > 1) { - this.appManager.call('notification', 'toast', `initiating ${callDetails[0]} ...`) + this.appManager.call('notification', 'toast', `initiating ${callDetails[0]} and calling "${callDetails[1]}" ...`) // @todo(remove the timeout when activatePlugin is on 0.3.0) this.appManager.call(...callDetails).catch(console.error) } @@ -426,7 +426,7 @@ class AppComponent { this.appManager.call( "notification", "toast", - `initiating ${callDetails[0]} ...` + `initiating ${callDetails[0]} and calling "${callDetails[1]}" ...` ); // @todo(remove the timeout when activatePlugin is on 0.3.0)