From 5e38ec104c5c0e7e5f685abe1b07ed610afa81ca Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 14 May 2021 17:28:41 +0200 Subject: [PATCH 01/67] multi select plus multi delete --- .../src/lib/file-explorer-context-menu.tsx | 48 +++++++-- .../file-explorer/src/lib/file-explorer.tsx | 101 +++++++++++++----- .../file-explorer/src/lib/types/index.ts | 9 +- .../src/lib/tree-view-item/tree-view-item.tsx | 2 +- package.json | 1 - 5 files changed, 119 insertions(+), 42 deletions(-) diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx index 3e6b308a35..2263889191 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx @@ -1,12 +1,11 @@ import React, { useRef, useEffect } from 'react' // eslint-disable-line -import { FileExplorerContextMenuProps } from './types' +import { action, FileExplorerContextMenuProps } from './types' import './css/file-explorer-context-menu.css' export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => { - const { actions, createNewFile, createNewFolder, deletePath, renamePath, hideContextMenu, publishToGist, runScript, emit, pageX, pageY, path, type, ...otherProps } = props + const { actions, createNewFile, createNewFolder, deletePath, renamePath, hideContextMenu, publishToGist, runScript, emit, pageX, pageY, path, type, focus, ...otherProps } = props const contextMenuRef = useRef(null) - useEffect(() => { contextMenuRef.current.focus() }, []) @@ -22,13 +21,42 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => } }, [pageX, pageY]) + const filterItem = (item: action) => { + /** + * if there are multiple elements focused we need to take this and all conditions must be met plus the action must be set to 'multi' + * for example : 'downloadAsZip' with type ['file','folder','multi'] will work on files and folders when multiple are selected + **/ + const nonRootFocus = focus.filter((el) => { return !(el.key === '' && el.type === 'folder') }) + if (nonRootFocus.length > 1) { + for (const element of nonRootFocus) { + if (!itemMatchesCondition(item, element.type, element.key)) return false + } + return (item.type.includes('multi')) + } else { + return itemMatchesCondition(item, type, path) + } + } + + const itemMatchesCondition = (item: action, itemType: string, itemPath: string) => { + if (item.type && Array.isArray(item.type) && (item.type.findIndex(name => name === itemType) !== -1)) return true + else if (item.path && Array.isArray(item.path) && (item.path.findIndex(key => key === itemPath) !== -1)) return true + else if (item.extension && Array.isArray(item.extension) && (item.extension.findIndex(ext => itemPath.endsWith(ext)) !== -1)) return true + else if (item.pattern && Array.isArray(item.pattern) && (item.pattern.filter(value => itemPath.match(new RegExp(value))).length > 0)) return true + else return false + } + + const getPath = () => { + const nonRootFocus = focus.filter((el) => { return !(el.key === '' && el.type === 'folder') }) + if (nonRootFocus.length > 1) { + return nonRootFocus.map((element) => { return element.key }) + } else { + return path + } + } + const menu = () => { return actions.filter(item => { - if (item.type && Array.isArray(item.type) && (item.type.findIndex(name => name === type) !== -1)) return true - else if (item.path && Array.isArray(item.path) && (item.path.findIndex(key => key === path) !== -1)) return true - else if (item.extension && Array.isArray(item.extension) && (item.extension.findIndex(ext => path.endsWith(ext)) !== -1)) return true - else if (item.pattern && Array.isArray(item.pattern) && (item.pattern.filter(value => path.match(new RegExp(value))).length > 0)) return true - else return false + return filterItem(item) }).map((item, index) => { return
  • renamePath(path, type) break case 'Delete': - deletePath(path) + deletePath(getPath()) break case 'Push changes to gist': publishToGist() @@ -56,7 +84,7 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => runScript(path) break default: - emit && emit(item.id, path) + emit && emit(item.id, getPath()) break } hideContextMenu() diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx index fc8c89450a..8282855d76 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx @@ -19,10 +19,7 @@ const queryParams = new QueryParams() export const FileExplorer = (props: FileExplorerProps) => { const { name, registry, plugin, focusRoot, contextMenuItems, displayInput, externalUploads } = props const [state, setState] = useState({ - focusElement: [{ - key: '', - type: 'folder' - }], + focusElement: [{ key: '', type: 'folder' }], focusPath: null, files: [], fileManager: null, @@ -52,7 +49,7 @@ export const FileExplorer = (props: FileExplorerProps) => { }, { id: 'delete', name: 'Delete', - type: ['file', 'folder'], + type: ['file', 'folder', 'multi'], path: [], extension: [], pattern: [] @@ -70,6 +67,13 @@ export const FileExplorer = (props: FileExplorerProps) => { path: [], extension: ['.js'], pattern: [] + }, { + id: 'test', + name: 'test', + type: ['file', 'folder', 'multi'], + path: [], + extension: [], + pattern: [] }], focusContext: { element: null, @@ -88,6 +92,7 @@ export const FileExplorer = (props: FileExplorerProps) => { hide: true, title: '', message: '', + children: <>, ok: { label: '', fn: () => {} @@ -203,7 +208,8 @@ export const FileExplorer = (props: FileExplorerProps) => { message: prevState.modals[0].message, ok: prevState.modals[0].ok, cancel: prevState.modals[0].cancel, - handleHide: prevState.modals[0].handleHide + handleHide: prevState.modals[0].handleHide, + children: prevState.modals[0].children } prevState.modals.shift() @@ -216,6 +222,31 @@ export const FileExplorer = (props: FileExplorerProps) => { } }, [state.modals]) + useEffect(() => { + const keyPressHandler = (e: KeyboardEvent) => { + if (e.key === 'Shift') { + setState(prevState => { + return { ...prevState, ctrlKey: true } + }) + } + } + + const keyUpHandler = (e: KeyboardEvent) => { + if (e.key === 'Shift') { + setState(prevState => { + return { ...prevState, ctrlKey: false } + }) + } + } + + document.addEventListener('keydown', keyPressHandler) + document.addEventListener('keyup', keyUpHandler) + return () => { + document.removeEventListener('keydown', keyPressHandler) + document.removeEventListener('keyup', keyUpHandler) + } + }, []) + const extractNameFromKey = (key: string):string => { const keyPath = key.split('/') @@ -280,29 +311,32 @@ export const FileExplorer = (props: FileExplorerProps) => { } } - const deletePath = async (path: string) => { + const deletePath = async (path: string | string[]) => { const filesProvider = fileSystem.provider.provider - - if (filesProvider.isReadOnly(path)) { - return toast('cannot delete file. ' + name + ' is a read only explorer') + if (!Array.isArray(path)) path = [path] + const children: React.ReactFragment =
    Are you sure you want to delete {path.length > 1 ? 'these items' : 'this item'}?
    {path.map((item, i) => (
  • {item}
  • ))} + for (const p of path) { + if (filesProvider.isReadOnly(p)) { + return toast('cannot delete file. ' + name + ' is a read only explorer') + } } - const isDir = state.fileManager.isDirectory(path) - - modal(`Delete ${isDir ? 'folder' : 'file'}`, `Are you sure you want to delete ${path} ${isDir ? 'folder' : 'file'}?`, { + modal(`Delete ${path.length > 1 ? 'items' : 'item'}`, '', { label: 'OK', fn: async () => { - try { - const fileManager = state.fileManager - - await fileManager.remove(path) - } catch (e) { - toast(`Failed to remove ${isDir ? 'folder' : 'file'} ${path}.`) + const fileManager = state.fileManager + for (const p of path) { + try { + await fileManager.remove(p) + } catch (e) { + const isDir = state.fileManager.isDirectory(p) + toast(`Failed to remove ${isDir ? 'folder' : 'file'} ${p}.`) + } } } }, { label: 'Cancel', fn: () => {} - }) + }, children) } const renamePath = async (oldPath: string, newPath: string) => { @@ -526,7 +560,7 @@ export const FileExplorer = (props: FileExplorerProps) => { }) } - const emitContextMenuEvent = (id: string, path: string) => { + const emitContextMenuEvent = (id: string, path: string | string[]) => { plugin.emit(id, path) } @@ -536,13 +570,14 @@ export const FileExplorer = (props: FileExplorerProps) => { }) } - const modal = (title: string, message: string, ok: { label: string, fn: () => void }, cancel: { label: string, fn: () => void }) => { + const modal = (title: string, message: string, ok: { label: string, fn: () => void }, cancel: { label: string, fn: () => void }, children?:React.ReactNode) => { setState(prevState => { return { ...prevState, modals: [...prevState.modals, { message, + children, title, ok, cancel, @@ -560,10 +595,22 @@ export const FileExplorer = (props: FileExplorerProps) => { const handleClickFile = (path: string) => { path = path.indexOf(props.name + '/') === 0 ? path.replace(props.name + '/', '') : path - state.fileManager.open(path) - setState(prevState => { - return { ...prevState, focusElement: [{ key: path, type: 'file' }] } - }) + if (!state.ctrlKey) { + state.fileManager.open(path) + setState(prevState => { + return { ...prevState, focusElement: [{ key: path, type: 'file' }] } + }) + } else { + if (state.focusElement.findIndex(item => item.key === path) !== -1) { + setState(prevState => { + return { ...prevState, focusElement: [...prevState.focusElement.filter(item => item.key !== path)] } + }) + } else { + setState(prevState => { + return { ...prevState, focusElement: [...prevState.focusElement, { key: path, type: 'file' }] } + }) + } + } } const handleClickFolder = async (path: string) => { @@ -864,6 +911,7 @@ export const FileExplorer = (props: FileExplorerProps) => { id={ props.name } title={ state.focusModal.title } message={ state.focusModal.message } + children={ state.focusModal.children } hide={ state.focusModal.hide } ok={ state.focusModal.ok } cancel={ state.focusModal.cancel } @@ -885,6 +933,7 @@ export const FileExplorer = (props: FileExplorerProps) => { pageY={state.focusContext.y} path={state.focusContext.element} type={state.focusContext.type} + focus={state.focusElement} onMouseOver={(e) => { e.stopPropagation() handleMouseOver(state.focusContext.element) diff --git a/libs/remix-ui/file-explorer/src/lib/types/index.ts b/libs/remix-ui/file-explorer/src/lib/types/index.ts index 17d6975414..6f6dadc44a 100644 --- a/libs/remix-ui/file-explorer/src/lib/types/index.ts +++ b/libs/remix-ui/file-explorer/src/lib/types/index.ts @@ -27,20 +27,21 @@ export interface FileExplorerMenuProps { publishToGist: () => void, uploadFile: (target: EventTarget & HTMLInputElement) => void } - +export type action = { name: string, type: string[], path: string[], extension: string[], pattern: string[], id: string } export interface FileExplorerContextMenuProps { - actions: { name: string, type: string[], path: string[], extension: string[], pattern: string[], id: string }[], + actions: action[], createNewFile: (folder?: string) => void, createNewFolder: (parentFolder?: string) => void, - deletePath: (path: string) => void, + deletePath: (path: string | string[]) => void, renamePath: (path: string, type: string) => void, hideContextMenu: () => void, publishToGist?: () => void, runScript?: (path: string) => void, - emit?: (id: string, path: string) => void, + emit?: (id: string, path: string | string[]) => void, pageX: number, pageY: number, path: string, type: string, + focus: {key:string, type:string}[] onMouseOver?: (...args) => void } diff --git a/libs/remix-ui/tree-view/src/lib/tree-view-item/tree-view-item.tsx b/libs/remix-ui/tree-view/src/lib/tree-view-item/tree-view-item.tsx index 6f7028f4cb..c570de5f07 100644 --- a/libs/remix-ui/tree-view/src/lib/tree-view-item/tree-view-item.tsx +++ b/libs/remix-ui/tree-view/src/lib/tree-view-item/tree-view-item.tsx @@ -14,7 +14,7 @@ export const TreeViewItem = (props: TreeViewItemProps) => { return (
  • !controlBehaviour && setIsExpanded(!isExpanded)}> - { controlBehaviour ? null : children ?
    : icon ?
    : null } + { children ?
    : icon ?
    : null } { label } diff --git a/package.json b/package.json index 0e3b262c5e..6302cb48fd 100644 --- a/package.json +++ b/package.json @@ -159,7 +159,6 @@ "isbinaryfile": "^3.0.2", "jquery": "^3.3.1", "jszip": "^3.6.0", - "lodash": "^4.17.21", "latest-version": "^5.1.0", "lodash": "^4.17.21", "merge": "^1.2.0", From 9080409a0ed7c348f989ebb4a9071bcbd5cad2fb Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 14 May 2021 17:31:59 +0200 Subject: [PATCH 02/67] rm test --- libs/remix-ui/file-explorer/src/lib/file-explorer.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx index 8282855d76..2358fd49c9 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx @@ -67,13 +67,6 @@ export const FileExplorer = (props: FileExplorerProps) => { path: [], extension: ['.js'], pattern: [] - }, { - id: 'test', - name: 'test', - type: ['file', 'folder', 'multi'], - path: [], - extension: [], - pattern: [] }], focusContext: { element: null, From 7ef49ca8fcce96b2010e54c55d9a5db5f33ee14d Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 14 May 2021 17:42:26 +0200 Subject: [PATCH 03/67] use shiftkey --- libs/remix-ui/file-explorer/src/lib/file-explorer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx index 2358fd49c9..e911dbf2a4 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx @@ -217,7 +217,7 @@ export const FileExplorer = (props: FileExplorerProps) => { useEffect(() => { const keyPressHandler = (e: KeyboardEvent) => { - if (e.key === 'Shift') { + if (e.shiftKey) { setState(prevState => { return { ...prevState, ctrlKey: true } }) @@ -225,7 +225,7 @@ export const FileExplorer = (props: FileExplorerProps) => { } const keyUpHandler = (e: KeyboardEvent) => { - if (e.key === 'Shift') { + if (!e.shiftKey) { setState(prevState => { return { ...prevState, ctrlKey: false } }) From 55d6244de6f0bfafa85a0e49b6fdc6513d533591 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 14 May 2021 17:28:41 +0200 Subject: [PATCH 04/67] multi select plus multi delete --- .../src/lib/file-explorer-context-menu.tsx | 48 ++++++++-- .../file-explorer/src/lib/file-explorer.tsx | 96 ++++++++++++++----- .../file-explorer/src/lib/types/index.ts | 11 ++- .../src/lib/tree-view-item/tree-view-item.tsx | 2 +- 4 files changed, 119 insertions(+), 38 deletions(-) diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx index f7c5302b06..6f57b616be 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx @@ -1,12 +1,11 @@ import React, { useRef, useEffect } from 'react' // eslint-disable-line -import { FileExplorerContextMenuProps } from './types' +import { action, FileExplorerContextMenuProps } from './types' import './css/file-explorer-context-menu.css' export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => { - const { actions, createNewFile, createNewFolder, deletePath, renamePath, hideContextMenu, pushChangesToGist, publishFileToGist, publishFolderToGist, copy, paste, runScript, emit, pageX, pageY, path, type, ...otherProps } = props + const { actions, createNewFile, createNewFolder, deletePath, renamePath, hideContextMenu, pushChangesToGist, publishFileToGist, publishFolderToGist, copy, paste, runScript, emit, pageX, pageY, path, type, focus, ...otherProps } = props const contextMenuRef = useRef(null) - useEffect(() => { contextMenuRef.current.focus() }, []) @@ -22,13 +21,42 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => } }, [pageX, pageY]) + const filterItem = (item: action) => { + /** + * if there are multiple elements focused we need to take this and all conditions must be met plus the action must be set to 'multi' + * for example : 'downloadAsZip' with type ['file','folder','multi'] will work on files and folders when multiple are selected + **/ + const nonRootFocus = focus.filter((el) => { return !(el.key === '' && el.type === 'folder') }) + if (nonRootFocus.length > 1) { + for (const element of nonRootFocus) { + if (!itemMatchesCondition(item, element.type, element.key)) return false + } + return (item.type.includes('multi')) + } else { + return itemMatchesCondition(item, type, path) + } + } + + const itemMatchesCondition = (item: action, itemType: string, itemPath: string) => { + if (item.type && Array.isArray(item.type) && (item.type.findIndex(name => name === itemType) !== -1)) return true + else if (item.path && Array.isArray(item.path) && (item.path.findIndex(key => key === itemPath) !== -1)) return true + else if (item.extension && Array.isArray(item.extension) && (item.extension.findIndex(ext => itemPath.endsWith(ext)) !== -1)) return true + else if (item.pattern && Array.isArray(item.pattern) && (item.pattern.filter(value => itemPath.match(new RegExp(value))).length > 0)) return true + else return false + } + + const getPath = () => { + const nonRootFocus = focus.filter((el) => { return !(el.key === '' && el.type === 'folder') }) + if (nonRootFocus.length > 1) { + return nonRootFocus.map((element) => { return element.key }) + } else { + return path + } + } + const menu = () => { return actions.filter(item => { - if (item.type && Array.isArray(item.type) && (item.type.findIndex(name => name === type) !== -1)) return true - else if (item.path && Array.isArray(item.path) && (item.path.findIndex(key => key === path) !== -1)) return true - else if (item.extension && Array.isArray(item.extension) && (item.extension.findIndex(ext => path.endsWith(ext)) !== -1)) return true - else if (item.pattern && Array.isArray(item.pattern) && (item.pattern.filter(value => path.match(new RegExp(value))).length > 0)) return true - else return false + return filterItem(item) }).map((item, index) => { return
  • renamePath(path, type) break case 'Delete': - deletePath(path) + deletePath(getPath()) break case 'Push changes to gist': pushChangesToGist(path, type) @@ -68,7 +96,7 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => paste(path, type) break default: - emit && emit(item.id, path) + emit && emit(item.id, getPath()) break } hideContextMenu() diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx index a433300e68..5d5317867b 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx @@ -51,7 +51,7 @@ export const FileExplorer = (props: FileExplorerProps) => { }, { id: 'delete', name: 'Delete', - type: ['file', 'folder', 'gist'], + type: ['file', 'folder', 'gist', 'multi'], path: [], extension: [], pattern: [] @@ -90,6 +90,13 @@ export const FileExplorer = (props: FileExplorerProps) => { path: [], extension: [], pattern: [] + }, { + id: 'test', + name: 'test', + type: ['file', 'folder', 'multi'], + path: [], + extension: [], + pattern: [] }], focusContext: { element: null, @@ -108,6 +115,7 @@ export const FileExplorer = (props: FileExplorerProps) => { hide: true, title: '', message: '', + children: <>, okLabel: '', okFn: () => {}, cancelLabel: '', @@ -211,7 +219,8 @@ export const FileExplorer = (props: FileExplorerProps) => { okFn: prevState.modals[0].okFn, cancelLabel: prevState.modals[0].cancelLabel, cancelFn: prevState.modals[0].cancelFn, - handleHide: prevState.modals[0].handleHide + handleHide: prevState.modals[0].handleHide, + children: prevState.modals[0].children } prevState.modals.shift() @@ -224,6 +233,31 @@ export const FileExplorer = (props: FileExplorerProps) => { } }, [state.modals]) + useEffect(() => { + const keyPressHandler = (e: KeyboardEvent) => { + if (e.key === 'Shift') { + setState(prevState => { + return { ...prevState, ctrlKey: true } + }) + } + } + + const keyUpHandler = (e: KeyboardEvent) => { + if (e.key === 'Shift') { + setState(prevState => { + return { ...prevState, ctrlKey: false } + }) + } + } + + document.addEventListener('keydown', keyPressHandler) + document.addEventListener('keyup', keyUpHandler) + return () => { + document.removeEventListener('keydown', keyPressHandler) + document.removeEventListener('keyup', keyUpHandler) + } + }, []) + useEffect(() => { if (canPaste) { addMenuItems([{ @@ -325,23 +359,26 @@ export const FileExplorer = (props: FileExplorerProps) => { } } - const deletePath = async (path: string) => { + const deletePath = async (path: string | string[]) => { const filesProvider = fileSystem.provider.provider - - if (filesProvider.isReadOnly(path)) { - return toast('cannot delete file. ' + name + ' is a read only explorer') + if (!Array.isArray(path)) path = [path] + const children: React.ReactFragment =
    Are you sure you want to delete {path.length > 1 ? 'these items' : 'this item'}?
    {path.map((item, i) => (
  • {item}
  • ))} + for (const p of path) { + if (filesProvider.isReadOnly(p)) { + return toast('cannot delete file. ' + name + ' is a read only explorer') + } } - const isDir = state.fileManager.isDirectory(path) - - modal(`Delete ${isDir ? 'folder' : 'file'}`, `Are you sure you want to delete ${path} ${isDir ? 'folder' : 'file'}?`, 'OK', async () => { - try { - const fileManager = state.fileManager - - await fileManager.remove(path) - } catch (e) { - toast(`Failed to remove ${isDir ? 'folder' : 'file'} ${path}.`) + modal(`Delete ${path.length > 1 ? 'items' : 'item'}`, '', 'OK', async () => { + const fileManager = state.fileManager + for (const p of path) { + try { + await fileManager.remove(p) + } catch (e) { + const isDir = state.fileManager.isDirectory(p) + toast(`Failed to remove ${isDir ? 'folder' : 'file'} ${p}.`) + } } - }, 'Cancel', () => {}) + }, 'Cancel', () => {}, children) } const renamePath = async (oldPath: string, newPath: string) => { @@ -556,7 +593,7 @@ export const FileExplorer = (props: FileExplorerProps) => { }) } - const emitContextMenuEvent = (id: string, path: string) => { + const emitContextMenuEvent = (id: string, path: string | string[]) => { plugin.emit(id, path) } @@ -566,13 +603,14 @@ export const FileExplorer = (props: FileExplorerProps) => { }) } - const modal = (title: string, message: string, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => { + const modal = (title: string, message: string, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void, children?:React.ReactNode) => { setState(prevState => { return { ...prevState, modals: [...prevState.modals, { message, + children, title, okLabel, okFn, @@ -592,10 +630,22 @@ export const FileExplorer = (props: FileExplorerProps) => { const handleClickFile = (path: string, type: string) => { path = path.indexOf(props.name + '/') === 0 ? path.replace(props.name + '/', '') : path - state.fileManager.open(path) - setState(prevState => { - return { ...prevState, focusElement: [{ key: path, type }] } - }) + if (!state.ctrlKey) { + state.fileManager.open(path) + setState(prevState => { + return { ...prevState, focusElement: [{ key: path, type }] } + }) + } else { + if (state.focusElement.findIndex(item => item.key === path) !== -1) { + setState(prevState => { + return { ...prevState, focusElement: [...prevState.focusElement.filter(item => item.key !== path)] } + }) + } else { + setState(prevState => { + return { ...prevState, focusElement: [...prevState.focusElement, { key: path, type }] } + }) + } + } } const handleClickFolder = async (path: string, type: string) => { @@ -918,6 +968,7 @@ export const FileExplorer = (props: FileExplorerProps) => { id={ props.name } title={ state.focusModal.title } message={ state.focusModal.message } + children={ state.focusModal.children } hide={ state.focusModal.hide } okLabel={ state.focusModal.okLabel } okFn={ state.focusModal.okFn } @@ -943,6 +994,7 @@ export const FileExplorer = (props: FileExplorerProps) => { pageY={state.focusContext.y} path={state.focusContext.element} type={state.focusContext.type} + focus={state.focusElement} onMouseOver={(e) => { e.stopPropagation() handleMouseOver(state.focusContext.element) diff --git a/libs/remix-ui/file-explorer/src/lib/types/index.ts b/libs/remix-ui/file-explorer/src/lib/types/index.ts index e89361378c..880f8aafc3 100644 --- a/libs/remix-ui/file-explorer/src/lib/types/index.ts +++ b/libs/remix-ui/file-explorer/src/lib/types/index.ts @@ -28,12 +28,12 @@ export interface FileExplorerMenuProps { publishToGist: (path?: string) => void, uploadFile: (target: EventTarget & HTMLInputElement) => void } - +export type action = { name: string, type: string[], path: string[], extension: string[], pattern: string[], id: string } export interface FileExplorerContextMenuProps { - actions: { name: string, type: string[], path: string[], extension: string[], pattern: string[], id: string }[], + actions: action[], createNewFile: (folder?: string) => void, createNewFolder: (parentFolder?: string) => void, - deletePath: (path: string) => void, + deletePath: (path: string | string[]) => void, renamePath: (path: string, type: string) => void, hideContextMenu: () => void, publishToGist?: (path?: string, type?: string) => void, @@ -41,12 +41,13 @@ export interface FileExplorerContextMenuProps { publishFolderToGist?: (path?: string, type?: string) => void, publishFileToGist?: (path?: string, type?: string) => void, runScript?: (path: string) => void, - emit?: (id: string, path: string) => void, + emit?: (id: string, path: string | string[]) => void, pageX: number, pageY: number, path: string, type: string, + focus: {key:string, type:string}[], onMouseOver?: (...args) => void, - copy?: (path: string, type: string) => void + copy?: (path: string, type: string) => void, paste?: (destination: string, type: string) => void } diff --git a/libs/remix-ui/tree-view/src/lib/tree-view-item/tree-view-item.tsx b/libs/remix-ui/tree-view/src/lib/tree-view-item/tree-view-item.tsx index 6f7028f4cb..c570de5f07 100644 --- a/libs/remix-ui/tree-view/src/lib/tree-view-item/tree-view-item.tsx +++ b/libs/remix-ui/tree-view/src/lib/tree-view-item/tree-view-item.tsx @@ -14,7 +14,7 @@ export const TreeViewItem = (props: TreeViewItemProps) => { return (
  • !controlBehaviour && setIsExpanded(!isExpanded)}> - { controlBehaviour ? null : children ?
    : icon ?
    : null } + { children ?
    : icon ?
    : null } { label } From 25ee25b351ac0277df5c339196fd73fc3a1f0eec Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 14 May 2021 17:31:59 +0200 Subject: [PATCH 05/67] rm test --- libs/remix-ui/file-explorer/src/lib/file-explorer.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx index 5d5317867b..a50e6d7cb3 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx @@ -90,13 +90,6 @@ export const FileExplorer = (props: FileExplorerProps) => { path: [], extension: [], pattern: [] - }, { - id: 'test', - name: 'test', - type: ['file', 'folder', 'multi'], - path: [], - extension: [], - pattern: [] }], focusContext: { element: null, From 010e192b0bb60b881b54ffdc95b26f831fa34d30 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Fri, 14 May 2021 17:42:26 +0200 Subject: [PATCH 06/67] use shiftkey --- libs/remix-ui/file-explorer/src/lib/file-explorer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx index a50e6d7cb3..5a41ff1e7a 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx @@ -228,7 +228,7 @@ export const FileExplorer = (props: FileExplorerProps) => { useEffect(() => { const keyPressHandler = (e: KeyboardEvent) => { - if (e.key === 'Shift') { + if (e.shiftKey) { setState(prevState => { return { ...prevState, ctrlKey: true } }) @@ -236,7 +236,7 @@ export const FileExplorer = (props: FileExplorerProps) => { } const keyUpHandler = (e: KeyboardEvent) => { - if (e.key === 'Shift') { + if (!e.shiftKey) { setState(prevState => { return { ...prevState, ctrlKey: false } }) From 63e2b01a23ef223384ec9287cd1fb094dedc4611 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Fri, 28 May 2021 12:54:49 +0100 Subject: [PATCH 07/67] Refactor delete all for multi-select --- .../src/lib/file-explorer-context-menu.tsx | 41 +++------- .../file-explorer/src/lib/file-explorer.tsx | 82 +++++++++++++------ .../file-explorer/src/lib/types/index.ts | 7 +- package-lock.json | 4 +- 4 files changed, 76 insertions(+), 58 deletions(-) diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx index 6f57b616be..0b92216fe8 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx @@ -6,6 +6,7 @@ import './css/file-explorer-context-menu.css' export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => { const { actions, createNewFile, createNewFolder, deletePath, renamePath, hideContextMenu, pushChangesToGist, publishFileToGist, publishFolderToGist, copy, paste, runScript, emit, pageX, pageY, path, type, focus, ...otherProps } = props const contextMenuRef = useRef(null) + useEffect(() => { contextMenuRef.current.focus() }, []) @@ -21,43 +22,24 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => } }, [pageX, pageY]) - const filterItem = (item: action) => { - /** - * if there are multiple elements focused we need to take this and all conditions must be met plus the action must be set to 'multi' - * for example : 'downloadAsZip' with type ['file','folder','multi'] will work on files and folders when multiple are selected - **/ - const nonRootFocus = focus.filter((el) => { return !(el.key === '' && el.type === 'folder') }) - if (nonRootFocus.length > 1) { - for (const element of nonRootFocus) { - if (!itemMatchesCondition(item, element.type, element.key)) return false - } - return (item.type.includes('multi')) - } else { - return itemMatchesCondition(item, type, path) - } - } - - const itemMatchesCondition = (item: action, itemType: string, itemPath: string) => { - if (item.type && Array.isArray(item.type) && (item.type.findIndex(name => name === itemType) !== -1)) return true - else if (item.path && Array.isArray(item.path) && (item.path.findIndex(key => key === itemPath) !== -1)) return true - else if (item.extension && Array.isArray(item.extension) && (item.extension.findIndex(ext => itemPath.endsWith(ext)) !== -1)) return true - else if (item.pattern && Array.isArray(item.pattern) && (item.pattern.filter(value => itemPath.match(new RegExp(value))).length > 0)) return true + const itemMatchesCondition = (item: action) => { + if (item.type && Array.isArray(item.type) && (item.type.findIndex(name => name === type) !== -1)) return true + else if (item.path && Array.isArray(item.path) && (item.path.findIndex(key => key === path) !== -1)) return true + else if (item.extension && Array.isArray(item.extension) && (item.extension.findIndex(ext => path.endsWith(ext)) !== -1)) return true + else if (item.pattern && Array.isArray(item.pattern) && (item.pattern.filter(value => path.match(new RegExp(value))).length > 0)) return true else return false } const getPath = () => { - const nonRootFocus = focus.filter((el) => { return !(el.key === '' && el.type === 'folder') }) - if (nonRootFocus.length > 1) { - return nonRootFocus.map((element) => { return element.key }) + if (focus.length > 1) { + return focus.map((element) => element.key) } else { return path } } const menu = () => { - return actions.filter(item => { - return filterItem(item) - }).map((item, index) => { + return actions.filter(item => itemMatchesCondition(item)).map((item, index) => { return
  • renamePath(path, type) break case 'Delete': - deletePath(getPath()) + deletePath(path) break case 'Push changes to gist': pushChangesToGist(path, type) @@ -95,6 +77,9 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => case 'Paste': paste(path, type) break + case 'Delete All': + deletePath(getPath()) + break default: emit && emit(item.id, getPath()) break diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx index 5a41ff1e7a..ba7e43e8c2 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx @@ -6,7 +6,7 @@ import { Toaster } from '@remix-ui/toaster' // eslint-disable-line import Gists from 'gists' import { FileExplorerMenu } from './file-explorer-menu' // eslint-disable-line import { FileExplorerContextMenu } from './file-explorer-context-menu' // eslint-disable-line -import { FileExplorerProps, File } from './types' +import { FileExplorerProps, File, MenuItems } from './types' import { fileSystemReducer, fileSystemInitialState } from './reducers/fileSystem' import { fetchDirectory, init, resolveDirectory, addInputField, removeInputField } from './actions/fileSystem' import * as helper from '../../../../../apps/remix-ide/src/lib/helper' @@ -33,63 +33,80 @@ export const FileExplorer = (props: FileExplorerProps) => { type: ['folder', 'gist'], path: [], extension: [], - pattern: [] + pattern: [], + multiselect: false }, { id: 'newFolder', name: 'New Folder', type: ['folder', 'gist'], path: [], extension: [], - pattern: [] + pattern: [], + multiselect: false }, { id: 'rename', name: 'Rename', type: ['file', 'folder'], path: [], extension: [], - pattern: [] + pattern: [], + multiselect: false }, { id: 'delete', name: 'Delete', - type: ['file', 'folder', 'gist', 'multi'], + type: ['file', 'folder', 'gist'], path: [], extension: [], - pattern: [] + pattern: [], + multiselect: false }, { id: 'run', name: 'Run', type: [], path: [], extension: ['.js'], - pattern: [] + pattern: [], + multiselect: false }, { id: 'pushChangesToGist', name: 'Push changes to gist', type: ['gist'], path: [], extension: [], - pattern: [] + pattern: [], + multiselect: false }, { id: 'publishFolderToGist', name: 'Publish folder to gist', type: ['folder'], path: [], extension: [], - pattern: [] + pattern: [], + multiselect: false }, { id: 'publishFileToGist', name: 'Publish file to gist', type: ['file'], path: [], extension: [], - pattern: [] + pattern: [], + multiselect: false }, { id: 'copy', name: 'Copy', type: ['folder', 'file'], path: [], extension: [], - pattern: [] + pattern: [], + multiselect: false + }, { + id: 'deleteAll', + name: 'Delete All', + type: ['folder', 'file'], + path: [], + extension: [], + pattern: [], + multiselect: true }], focusContext: { element: null, @@ -108,7 +125,6 @@ export const FileExplorer = (props: FileExplorerProps) => { hide: true, title: '', message: '', - children: <>, okLabel: '', okFn: () => {}, cancelLabel: '', @@ -212,8 +228,7 @@ export const FileExplorer = (props: FileExplorerProps) => { okFn: prevState.modals[0].okFn, cancelLabel: prevState.modals[0].cancelLabel, cancelFn: prevState.modals[0].cancelFn, - handleHide: prevState.modals[0].handleHide, - children: prevState.modals[0].children + handleHide: prevState.modals[0].handleHide } prevState.modals.shift() @@ -259,14 +274,15 @@ export const FileExplorer = (props: FileExplorerProps) => { type: ['folder', 'file'], path: [], extension: [], - pattern: [] + pattern: [], + multiselect: false }]) } else { removeMenuItems(['paste']) } }, [canPaste]) - const addMenuItems = (items: { id: string, name: string, type: string[], path: string[], extension: string[], pattern: string[] }[]) => { + const addMenuItems = (items: MenuItems) => { setState(prevState => { // filter duplicate items const actions = items.filter(({ name }) => prevState.actions.findIndex(action => action.name === name) === -1) @@ -355,13 +371,12 @@ export const FileExplorer = (props: FileExplorerProps) => { const deletePath = async (path: string | string[]) => { const filesProvider = fileSystem.provider.provider if (!Array.isArray(path)) path = [path] - const children: React.ReactFragment =
    Are you sure you want to delete {path.length > 1 ? 'these items' : 'this item'}?
    {path.map((item, i) => (
  • {item}
  • ))} for (const p of path) { if (filesProvider.isReadOnly(p)) { return toast('cannot delete file. ' + name + ' is a read only explorer') } } - modal(`Delete ${path.length > 1 ? 'items' : 'item'}`, '', 'OK', async () => { + modal(`Delete ${path.length > 1 ? 'items' : 'item'}`, deleteMessage(path), 'OK', async () => { const fileManager = state.fileManager for (const p of path) { try { @@ -371,7 +386,7 @@ export const FileExplorer = (props: FileExplorerProps) => { toast(`Failed to remove ${isDir ? 'folder' : 'file'} ${p}.`) } } - }, 'Cancel', () => {}, children) + }, 'Cancel', () => {}) } const renamePath = async (oldPath: string, newPath: string) => { @@ -596,14 +611,13 @@ export const FileExplorer = (props: FileExplorerProps) => { }) } - const modal = (title: string, message: string, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void, children?:React.ReactNode) => { + const modal = (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => { setState(prevState => { return { ...prevState, modals: [...prevState.modals, { message, - children, title, okLabel, okFn, @@ -631,11 +645,14 @@ export const FileExplorer = (props: FileExplorerProps) => { } else { if (state.focusElement.findIndex(item => item.key === path) !== -1) { setState(prevState => { - return { ...prevState, focusElement: [...prevState.focusElement.filter(item => item.key !== path)] } + return { ...prevState, focusElement: prevState.focusElement.filter(item => item.key !== path) } }) } else { setState(prevState => { - return { ...prevState, focusElement: [...prevState.focusElement, { key: path, type }] } + const nonRootFocus = prevState.focusElement.filter((el) => { return !(el.key === '' && el.type === 'folder') }) + + nonRootFocus.push({ key: path, type }) + return { ...prevState, focusElement: nonRootFocus } }) } } @@ -649,7 +666,10 @@ export const FileExplorer = (props: FileExplorerProps) => { }) } else { setState(prevState => { - return { ...prevState, focusElement: [...prevState.focusElement, { key: path, type }] } + const nonRootFocus = prevState.focusElement.filter((el) => { return !(el.key === '' && el.type === 'folder') }) + + nonRootFocus.push({ key: path, type }) + return { ...prevState, focusElement: nonRootFocus } }) } } else { @@ -806,6 +826,17 @@ export const FileExplorer = (props: FileExplorerProps) => { }) } + const deleteMessage = (path: string[]) => { + return ( +
    +
    Are you sure you want to delete {path.length > 1 ? 'these items' : 'this item'}?
    + { + path.map((item, i) => (
  • {item}
  • )) + } +
    + ) + } + const label = (file: File) => { return (
    { id={ props.name } title={ state.focusModal.title } message={ state.focusModal.message } - children={ state.focusModal.children } hide={ state.focusModal.hide } okLabel={ state.focusModal.okLabel } okFn={ state.focusModal.okFn } @@ -973,7 +1003,7 @@ export const FileExplorer = (props: FileExplorerProps) => { { state.showContextMenu && 1 ? state.actions.filter(item => item.multiselect) : state.actions.filter(item => !item.multiselect)} hideContextMenu={hideContextMenu} createNewFile={handleNewFileInput} createNewFolder={handleNewFolderInput} diff --git a/libs/remix-ui/file-explorer/src/lib/types/index.ts b/libs/remix-ui/file-explorer/src/lib/types/index.ts index 880f8aafc3..511d1b79a1 100644 --- a/libs/remix-ui/file-explorer/src/lib/types/index.ts +++ b/libs/remix-ui/file-explorer/src/lib/types/index.ts @@ -6,7 +6,7 @@ export interface FileExplorerProps { menuItems?: string[], plugin: any, focusRoot: boolean, - contextMenuItems: { id: string, name: string, type: string[], path: string[], extension: string[], pattern: string[] }[], + contextMenuItems: MenuItems, displayInput?: boolean, externalUploads?: EventTarget & HTMLInputElement } @@ -28,7 +28,10 @@ export interface FileExplorerMenuProps { publishToGist: (path?: string) => void, uploadFile: (target: EventTarget & HTMLInputElement) => void } -export type action = { name: string, type: string[], path: string[], extension: string[], pattern: string[], id: string } + +export type action = { name: string, type: string[], path: string[], extension: string[], pattern: string[], id: string, multiselect: boolean } + +export type MenuItems = action[] export interface FileExplorerContextMenuProps { actions: action[], createNewFile: (folder?: string) => void, diff --git a/package-lock.json b/package-lock.json index ef1e85062f..144c35c778 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17419,7 +17419,7 @@ "express-ws": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/express-ws/-/express-ws-4.0.0.tgz", - "integrity": "sha512-KEyUw8AwRET2iFjFsI1EJQrJ/fHeGiJtgpYgEWG3yDv4l/To/m3a2GaYfeGyB3lsWdvbesjF5XCMx+SVBgAAYw==", + "integrity": "sha1-2r2NyXRRZBiQKkH+bjDtlJtNNsQ=", "requires": { "ws": "^5.2.0" }, @@ -17427,7 +17427,7 @@ "ws": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", - "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "integrity": "sha1-3/7xSGa46NyRM1glFNG++vlumA8=", "requires": { "async-limiter": "~1.0.0" } From d88b848b049aacd07ec9f6d18599812076335b0d Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 31 May 2021 12:25:04 +0200 Subject: [PATCH 08/67] fixing multi focused items --- .../src/lib/file-explorer-context-menu.tsx | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx index 8d64091673..2c96080866 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx @@ -21,11 +21,27 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => } }, [pageX, pageY]) - const itemMatchesCondition = (item: action) => { - if (item.type && Array.isArray(item.type) && (item.type.findIndex(name => name === type) !== -1)) return true - else if (item.path && Array.isArray(item.path) && (item.path.findIndex(key => key === path) !== -1)) return true - else if (item.extension && Array.isArray(item.extension) && (item.extension.findIndex(ext => path.endsWith(ext)) !== -1)) return true - else if (item.pattern && Array.isArray(item.pattern) && (item.pattern.filter(value => path.match(new RegExp(value))).length > 0)) return true + const filterItem = (item: action) => { + /** + * if there are multiple elements focused we need to take this and all conditions must be met + * for example : 'downloadAsZip' with type ['file','folder','multi'] will work on files and folders when multiple are selected + **/ + const nonRootFocus = focus.filter((el) => { return !(el.key === '' && el.type === 'folder') }) + if (nonRootFocus.length > 1) { + for (const element of nonRootFocus) { + if (!itemMatchesCondition(item, element.type, element.key)) return false + } + return true + } else { + return itemMatchesCondition(item, type, path) + } + } + + const itemMatchesCondition = (item: action, itemType: string, itemPath: string) => { + if (item.type && Array.isArray(item.type) && (item.type.findIndex(name => name === itemType) !== -1)) return true + else if (item.path && Array.isArray(item.path) && (item.path.findIndex(key => key === itemPath) !== -1)) return true + else if (item.extension && Array.isArray(item.extension) && (item.extension.findIndex(ext => itemPath.endsWith(ext)) !== -1)) return true + else if (item.pattern && Array.isArray(item.pattern) && (item.pattern.filter(value => itemPath.match(new RegExp(value))).length > 0)) return true else return false } @@ -38,7 +54,7 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => } const menu = () => { - return actions.filter(item => itemMatchesCondition(item)).map((item, index) => { + return actions.filter(item => filterItem(item)).map((item, index) => { return
  • Date: Mon, 31 May 2021 18:00:09 +0200 Subject: [PATCH 09/67] Update file-explorer-context-menu.tsx --- .../file-explorer/src/lib/file-explorer-context-menu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx index 2c96080866..c049a93a65 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx @@ -24,7 +24,7 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => const filterItem = (item: action) => { /** * if there are multiple elements focused we need to take this and all conditions must be met - * for example : 'downloadAsZip' with type ['file','folder','multi'] will work on files and folders when multiple are selected + * for example : 'downloadAsZip' with type ['file','folder'] will work on files and folders when multiple are selected **/ const nonRootFocus = focus.filter((el) => { return !(el.key === '' && el.type === 'folder') }) if (nonRootFocus.length > 1) { From 8ce3ff28c81dc116a53274de3311926eb79c41f2 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Tue, 1 Jun 2021 10:59:48 +0200 Subject: [PATCH 10/67] prop children --- libs/remix-ui/file-explorer/src/lib/file-explorer.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx index 9f9893f487..ba7e43e8c2 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx @@ -992,7 +992,6 @@ export const FileExplorer = (props: FileExplorerProps) => { id={ props.name } title={ state.focusModal.title } message={ state.focusModal.message } - children={ state.focusModal.children } hide={ state.focusModal.hide } okLabel={ state.focusModal.okLabel } okFn={ state.focusModal.okFn } From 7ea41d728834b5254a6f92812ddba0372d661253 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 2 Jun 2021 10:31:32 +0200 Subject: [PATCH 11/67] using awaits for proper result --- apps/remix-ide/src/app/tabs/test-tab.js | 6 +++--- apps/remix-ide/src/app/tabs/testTab/testTab.js | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index 652be0b9c9..c880fabcc3 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -606,7 +606,7 @@ module.exports = class TestTab extends ViewPlugin { this.updateDirList(testDirInput) } else { // If there is no matching folder in the workspace with entered text, enable Create button - if (this.testTabLogic.pathExists(testDirInput)) { + if (await this.testTabLogic.pathExists(testDirInput)) { this.createTestFolder.disabled = true this.updateGenerateFileAction().disabled = false } else { @@ -636,10 +636,10 @@ module.exports = class TestTab extends ViewPlugin { name="utPath" style="background-image: var(--primary);" onkeyup=${(e) => this.handleTestDirInput(e)} - onchange=${(e) => { + onchange=${async (e) => { if (this.createTestFolder.disabled) { this.inputPath.value = this.trimTestDirInput(this.inputPath.value) - if (this.testTabLogic.pathExists(this.inputPath.value)) { + if (await this.testTabLogic.pathExists(this.inputPath.value)) { this.inputPath.value = this.trimTestDirInput(this.inputPath.value) this.testTabLogic.setCurrentPath(this.inputPath.value) this.updateForNewCurrent() diff --git a/apps/remix-ide/src/app/tabs/testTab/testTab.js b/apps/remix-ide/src/app/tabs/testTab/testTab.js index 1f915d9ee4..04aec9d94e 100644 --- a/apps/remix-ide/src/app/tabs/testTab/testTab.js +++ b/apps/remix-ide/src/app/tabs/testTab/testTab.js @@ -23,11 +23,12 @@ class TestTabLogic { }) } - pathExists (path) { + async pathExists (path) { // Checking to ignore the value which contains only whitespaces if (!path || !(/\S/.test(path))) return const fileProvider = this.fileManager.fileProviderOf(path.split('/')[0]) - return fileProvider.exists(path, (e, res) => { return res }) + const res = await fileProvider.exists(path, (e, res) => { return res }) + return res } generateTestFile () { From 0cadb907ebc1c43d8be037c1ee0096eb3685adad Mon Sep 17 00:00:00 2001 From: lianahus Date: Fri, 4 Jun 2021 09:02:31 +0200 Subject: [PATCH 12/67] improved unit testing plugin path --- apps/remix-ide/src/app/tabs/test-tab.js | 81 ++++++++++++------- .../remix-ide/src/app/tabs/testTab/testTab.js | 1 + apps/remix-ide/src/lib/helper.js | 8 ++ 3 files changed, 59 insertions(+), 31 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index c880fabcc3..f2e9ece175 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -1,5 +1,7 @@ import { ViewPlugin } from '@remixproject/engine-web' import { canUseWorker, urlFromVersion } from '../compiler/compiler-utils' +import * as helper from '../../lib/helper' + var yo = require('yo-yo') var async = require('async') var tooltip = require('../ui/tooltip') @@ -52,18 +54,26 @@ module.exports = class TestTab extends ViewPlugin { } listenToEvents () { - this.on('filePanel', 'newTestFileCreated', file => { - var testList = this._view.el.querySelector("[class^='testList']") - var test = this.createSingleTest(file) - testList.appendChild(test) + this.on('filePanel', 'newTestFileCreated', async file => { + try { + await this.testTabLogic.getTests((error, tests) => { + if (error) return tooltip(error) + this.data.allTests = tests + this.data.selectedTests = [...this.data.allTests] + this.updateTestFileList(tests) + if (!this.testsOutput) return // eslint-disable-line + }) + } catch (e) { + console.log(e) + } this.data.allTests.push(file) this.data.selectedTests.push(file) }) - this.on('filePanel', 'setWorkspace', () => { + this.on('filePanel', 'setWorkspace', async () => { this.testTabLogic.setCurrentPath(this.defaultPath) this.inputPath.value = this.defaultPath - this.updateForNewCurrent() + await this.updateForNewCurrent() }) this.fileManager.events.on('noFileSelected', () => { @@ -72,18 +82,23 @@ module.exports = class TestTab extends ViewPlugin { this.fileManager.events.on('currentFileChanged', (file, provider) => this.updateForNewCurrent(file)) } - updateForNewCurrent (file) { - this.updateGenerateFileAction() - if (!this.areTestsRunning) this.updateRunAction(file) + async updateForNewCurrent (file) { + this.data.allTests = [] this.updateTestFileList() this.clearResults() - this.testTabLogic.getTests((error, tests) => { - if (error) return tooltip(error) - this.data.allTests = tests - this.data.selectedTests = [...this.data.allTests] - this.updateTestFileList(tests) - if (!this.testsOutput) return // eslint-disable-line - }) + this.updateGenerateFileAction() + if (!this.areTestsRunning) this.updateRunAction(file) + try { + await this.testTabLogic.getTests((error, tests) => { + if (error) return tooltip(error) + this.data.allTests = tests + this.data.selectedTests = [...this.data.allTests] + this.updateTestFileList(tests) + if (!this.testsOutput) return // eslint-disable-line + }) + } catch (e) { + console.log(e) + } } createSingleTest (testFile) { @@ -96,7 +111,7 @@ module.exports = class TestTab extends ViewPlugin { } listTests () { - if (!this.data.allTests) return [] + if (!this.data.allTests || !this.data.allTests.length) return [] return this.data.allTests.map( testFile => this.createSingleTest(testFile) ) @@ -587,9 +602,10 @@ module.exports = class TestTab extends ViewPlugin { } async handleTestDirInput (e) { - const testDirInput = this.trimTestDirInput(this.inputPath.value) + let testDirInput = this.trimTestDirInput(this.inputPath.value) + testDirInput = helper.removeMultipleSlashes(testDirInput) if (e.key === 'Enter') { - this.inputPath.value = this.trimTestDirInput(testDirInput) + this.inputPath.value = testDirInput if (await this.testTabLogic.pathExists(testDirInput)) { this.testTabLogic.setCurrentPath(testDirInput) this.updateForNewCurrent() @@ -599,6 +615,7 @@ module.exports = class TestTab extends ViewPlugin { if (testDirInput) { if (testDirInput.endsWith('/')) { + testDirInput = helper.removeTrailingSlashes(testDirInput) if (this.testTabLogic.currentPath === testDirInput.substr(0, testDirInput.length - 1)) { this.createTestFolder.disabled = true this.updateGenerateFileAction().disabled = true @@ -612,7 +629,7 @@ module.exports = class TestTab extends ViewPlugin { } else { // Enable Create button this.createTestFolder.disabled = false - // Disable Generate button because dir is not existing + // Disable Generate button because dir does not exist this.updateGenerateFileAction().disabled = true } } @@ -621,6 +638,16 @@ module.exports = class TestTab extends ViewPlugin { } } + async handleEnter (e) { + this.inputPath.value = helper.removeMultipleSlashes(this.trimTestDirInput(this.inputPath.value)) + if (this.createTestFolder.disabled) { + if (await this.testTabLogic.pathExists(this.inputPath.value)) { + this.testTabLogic.setCurrentPath(this.inputPath.value) + this.updateForNewCurrent() + } + } + } + render () { this.onActivationInternal() this.testsOutput = yo` - { (state.validationError && !state.txNumberIsEmpty) && {state.validationError} } + { state.validationError && {state.validationError} }
  • { state.debugging && } From 95ef22e8679c1bd3d24d22d2aa916983280d7ca2 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Thu, 10 Jun 2021 14:12:26 +0200 Subject: [PATCH 21/67] Update debugger-ui.tsx --- libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx b/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx index 6da377f0c4..06f24e3dfe 100644 --- a/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx @@ -174,7 +174,7 @@ export const DebuggerUI = (props: DebuggerUIProps) => { setState(prevState => { return { ...prevState, - validationError: 'The Kovan network is unfortunately not supported.' + validationError: 'Unfortunately, the Kovan network is not supported.' } }) return From e27bf7298bd5e8a24522151920430fb94d27d025 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 10 Jun 2021 14:54:13 +0200 Subject: [PATCH 22/67] bump version --- libs/remix-analyzer/package.json | 16 ++++++++++------ libs/remix-astwalker/package.json | 16 ++++++++++------ libs/remix-debug/package.json | 16 ++++++++++------ libs/remix-lib/package.json | 6 +++--- libs/remix-simulator/package.json | 14 ++++++++------ libs/remix-solidity/package.json | 14 +++++++++----- libs/remix-tests/package.json | 19 +++++++++++-------- libs/remix-url-resolver/package.json | 4 ++-- 8 files changed, 63 insertions(+), 42 deletions(-) diff --git a/libs/remix-analyzer/package.json b/libs/remix-analyzer/package.json index 3c1f81f4f3..01eb9fc810 100644 --- a/libs/remix-analyzer/package.json +++ b/libs/remix-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-analyzer", - "version": "0.5.8", + "version": "0.5.9", "description": "Tool to perform static analysis on Solidity smart contracts", "main": "index.js", "types": ".index.d.ts", @@ -19,11 +19,15 @@ } ], "dependencies": { - "@remix-project/remix-astwalker": "^0.0.26", - "@remix-project/remix-lib": "^0.4.34", - "@ethereumjs/vm": "^5.3.2", "@ethereumjs/block": "^3.2.1", - "@ethereumjs/tx": "^3.1.3" + "@ethereumjs/tx": "^3.1.3", + "@ethereumjs/vm": "^5.3.2", + "@remix-project/remix-astwalker": "^0.0.26", + "@remix-project/remix-lib": "^0.5.0", + "async": "^2.6.2", + "ethereumjs-util": "^7.0.10", + "ethers": "^5.1.4", + "web3": "1.2.4" }, "publishConfig": { "access": "public" @@ -46,5 +50,5 @@ "typescript": "^3.7.5" }, "typings": "index.d.ts", - "gitHead": "a0db8476e581f72690f735891fdf1282a97ec100" + "gitHead": "554e6e82fb0bf431bb22ca7d80558669e335ae01" } \ No newline at end of file diff --git a/libs/remix-astwalker/package.json b/libs/remix-astwalker/package.json index 51663ad1e6..1911bb1f4e 100644 --- a/libs/remix-astwalker/package.json +++ b/libs/remix-astwalker/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-astwalker", - "version": "0.0.29", + "version": "0.0.30", "description": "Tool to walk through Solidity AST", "main": "index.js", "scripts": { @@ -34,19 +34,23 @@ ] }, "dependencies": { - "@remix-project/remix-lib": "^0.4.34", - "@types/tape": "^4.2.33", - "@ethereumjs/vm": "^5.3.2", "@ethereumjs/block": "^3.2.1", "@ethereumjs/tx": "^3.1.3", + "@ethereumjs/vm": "^5.3.2", + "@remix-project/remix-lib": "^0.5.0", + "@types/tape": "^4.2.33", + "async": "^2.6.2", + "ethereumjs-util": "^7.0.10", + "ethers": "^5.1.4", "nyc": "^13.3.0", "tape": "^4.10.1", "ts-node": "^8.0.3", - "typescript": "^3.4.3" + "typescript": "^3.4.3", + "web3": "1.2.4" }, "devDependencies": { "tap-spec": "^5.0.0" }, "typings": "index.d.ts", - "gitHead": "a0db8476e581f72690f735891fdf1282a97ec100" + "gitHead": "554e6e82fb0bf431bb22ca7d80558669e335ae01" } \ No newline at end of file diff --git a/libs/remix-debug/package.json b/libs/remix-debug/package.json index fd42914a63..387ac0316d 100644 --- a/libs/remix-debug/package.json +++ b/libs/remix-debug/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-debug", - "version": "0.4.10", + "version": "0.5.0", "description": "Tool to debug Ethereum transactions", "contributors": [ { @@ -18,13 +18,17 @@ ], "main": "src/index.js", "dependencies": { - "@remix-project/remix-astwalker": "^0.0.26", - "@remix-project/remix-lib": "^0.4.34", - "commander": "^2.19.0", - "@ethereumjs/vm": "^5.3.2", "@ethereumjs/block": "^3.2.1", + "@ethereumjs/common": "^2.2.0", "@ethereumjs/tx": "^3.1.3", + "@ethereumjs/vm": "^5.3.2", + "@remix-project/remix-astwalker": "^0.0.26", + "@remix-project/remix-lib": "^0.5.0", + "async": "^2.6.2", + "commander": "^2.19.0", + "deep-equal": "^1.0.1", "ethereumjs-util": "^7.0.10", + "ethers": "^5.1.4", "web3": "^1.2.4" }, "devDependencies": { @@ -56,5 +60,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme", "typings": "src/index.d.ts", - "gitHead": "a0db8476e581f72690f735891fdf1282a97ec100" + "gitHead": "554e6e82fb0bf431bb22ca7d80558669e335ae01" } \ No newline at end of file diff --git a/libs/remix-lib/package.json b/libs/remix-lib/package.json index 90a01a835c..bf03b65c9d 100644 --- a/libs/remix-lib/package.json +++ b/libs/remix-lib/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-lib", - "version": "0.4.34", + "version": "0.5.0", "description": "Library to various Remix tools", "contributors": [ { @@ -14,10 +14,10 @@ ], "main": "src/index.js", "dependencies": { - "async": "^2.1.2", "@ethereumjs/block": "^3.2.1", "@ethereumjs/tx": "^3.1.3", "@ethereumjs/vm": "^5.3.2", + "async": "^2.1.2", "ethereumjs-util": "^7.0.10", "ethers": "^4.0.40", "events": "^3.0.0", @@ -52,5 +52,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme", "typings": "src/index.d.ts", - "gitHead": "a0db8476e581f72690f735891fdf1282a97ec100" + "gitHead": "554e6e82fb0bf431bb22ca7d80558669e335ae01" } \ No newline at end of file diff --git a/libs/remix-simulator/package.json b/libs/remix-simulator/package.json index b39deedf5a..b537ba76b0 100644 --- a/libs/remix-simulator/package.json +++ b/libs/remix-simulator/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-simulator", - "version": "0.1.10-beta.0", + "version": "0.2.0", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -14,17 +14,19 @@ ], "main": "src/index.js", "dependencies": { - "@remix-project/remix-lib": "../remix-lib", + "@ethereumjs/block": "^3.2.1", + "@ethereumjs/common": "^2.2.0", + "@ethereumjs/tx": "^3.1.3", + "@ethereumjs/vm": "^5.3.2", + "@remix-project/remix-lib": "^0.5.0", "ansi-gray": "^0.1.1", "async": "^3.1.0", "body-parser": "^1.18.2", "color-support": "^1.1.3", "commander": "^2.19.0", "cors": "^2.8.5", - "@ethereumjs/vm": "^5.3.2", - "@ethereumjs/block": "^3.2.1", - "@ethereumjs/tx": "^3.1.3", "ethereumjs-util": "^7.0.10", + "ethers": "^5.1.4", "express": "^4.16.3", "express-ws": "^4.0.0", "merge": "^1.2.0", @@ -63,5 +65,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme", "typings": "src/index.d.ts", - "gitHead": "a0db8476e581f72690f735891fdf1282a97ec100" + "gitHead": "554e6e82fb0bf431bb22ca7d80558669e335ae01" } \ No newline at end of file diff --git a/libs/remix-solidity/package.json b/libs/remix-solidity/package.json index 7a54cfe8d7..c534241283 100644 --- a/libs/remix-solidity/package.json +++ b/libs/remix-solidity/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-solidity", - "version": "0.3.35", + "version": "0.4.0", "description": "Tool to load and run Solidity compiler", "main": "index.js", "types": "./index.d.ts", @@ -15,12 +15,16 @@ } ], "dependencies": { - "@remix-project/remix-lib": "../remix-lib", - "eslint-scope": "^5.0.0", - "@ethereumjs/vm": "^5.3.2", "@ethereumjs/block": "^3.2.1", "@ethereumjs/tx": "^3.1.3", + "@ethereumjs/vm": "^5.3.2", + "@remix-project/remix-lib": "^0.5.0", + "async": "^2.6.2", + "eslint-scope": "^5.0.0", + "ethereumjs-util": "^7.0.10", + "ethers": "^5.1.4", "solc": "^0.7.4", + "web3": "1.2.4", "webworkify-webpack": "^2.1.5" }, "devDependencies": { @@ -54,5 +58,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme", "typings": "index.d.ts", - "gitHead": "a0db8476e581f72690f735891fdf1282a97ec100" + "gitHead": "554e6e82fb0bf431bb22ca7d80558669e335ae01" } \ No newline at end of file diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index 9adf364e2d..efd0407074 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-tests", - "version": "0.1.38", + "version": "0.2.0", "description": "Tool to test Solidity smart contracts", "main": "src/index.js", "types": "./src/index.d.ts", @@ -35,9 +35,13 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-tests#readme", "dependencies": { - "@remix-project/remix-lib": "../remix-lib", - "@remix-project/remix-simulator": "../remix-simulator", - "@remix-project/remix-solidity": "../remix-solidity", + "@ethereumjs/block": "^3.2.1", + "@ethereumjs/common": "^2.2.0", + "@ethereumjs/tx": "^3.1.3", + "@ethereumjs/vm": "^5.3.2", + "@remix-project/remix-lib": "^0.5.0", + "@remix-project/remix-simulator": "^0.2.0", + "@remix-project/remix-solidity": "^0.4.0", "ansi-gray": "^0.1.1", "async": "^2.6.0", "axios": ">=0.21.1", @@ -45,9 +49,8 @@ "color-support": "^1.1.3", "colors": "^1.1.2", "commander": "^2.13.0", - "@ethereumjs/vm": "^5.3.2", - "@ethereumjs/block": "^3.2.1", - "@ethereumjs/tx": "^3.1.3", + "ethereumjs-util": "^7.0.10", + "ethers": "^5.1.4", "express-ws": "^4.0.0", "merge": "^1.2.0", "signale": "^1.4.0", @@ -72,5 +75,5 @@ "typescript": "^3.3.1" }, "typings": "src/index.d.ts", - "gitHead": "a0db8476e581f72690f735891fdf1282a97ec100" + "gitHead": "554e6e82fb0bf431bb22ca7d80558669e335ae01" } \ No newline at end of file diff --git a/libs/remix-url-resolver/package.json b/libs/remix-url-resolver/package.json index a9f735cd4e..44b8ecd332 100644 --- a/libs/remix-url-resolver/package.json +++ b/libs/remix-url-resolver/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-url-resolver", - "version": "0.0.20", + "version": "0.0.21", "description": "Solidity import url resolver engine", "main": "index.js", "types": "./index.d.ts", @@ -42,5 +42,5 @@ "typescript": "^3.1.6" }, "typings": "index.d.ts", - "gitHead": "a0db8476e581f72690f735891fdf1282a97ec100" + "gitHead": "554e6e82fb0bf431bb22ca7d80558669e335ae01" } \ No newline at end of file From d52ee13fa38758a99fc4deef1f2464f961eb8861 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 10 Jun 2021 15:12:22 +0200 Subject: [PATCH 23/67] bump remixd --- libs/remixd/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remixd/package.json b/libs/remixd/package.json index 6bbfed0109..cd43875628 100644 --- a/libs/remixd/package.json +++ b/libs/remixd/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remixd", - "version": "0.3.5", + "version": "0.4.0", "description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)", "main": "index.js", "types": "./index.d.ts", From ee1e8325c9d5cf965423e6e652dac2b54899236d Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 10 Jun 2021 21:47:56 +0200 Subject: [PATCH 24/67] debugger test fix rm --- apps/remix-ide-e2e/src/tests/debugger.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/debugger.spec.ts b/apps/remix-ide-e2e/src/tests/debugger.spec.ts index 8a16f18066..f1d84c0aa4 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.spec.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.spec.ts @@ -178,7 +178,7 @@ module.exports = { .click('*[data-id="debuggerTransactionStartButton"]') // start debugging .pause(2000) .getEditorValue((content) => { - browser.assert.ok(content.indexOf('if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }') !== -1, 'current displayed content is not a generated source') + browser.assert.ok(content.indexOf('if slt(sub(dataEnd, headStart), 32)') !== -1, 'current displayed content is not a generated source') }) .click('*[data-id="debuggerTransactionStartButton"]') }, From 6d5ab4cb2756bdbdd9cf587ac65994308659cabb Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 10 Jun 2021 22:10:40 +0200 Subject: [PATCH 25/67] set 0.8.4 --- apps/remix-ide-e2e/src/tests/debugger.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/debugger.spec.ts b/apps/remix-ide-e2e/src/tests/debugger.spec.ts index f1d84c0aa4..78406a7b8d 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.spec.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.spec.ts @@ -210,7 +210,10 @@ module.exports = { }, 'Should start debugging using remix debug nodes (rinkeby)': function (browser: NightwatchBrowser) { - browser.addFile('useDebugNodes.sol', sources[5]['useDebugNodes.sol']) // compile contract + browser + .clickLaunchIcon('solidity') + .setSolidityCompilerVersion('soljson-v0.8.4+commit.c7e474f2.js') + .addFile('useDebugNodes.sol', sources[5]['useDebugNodes.sol']) // compile contract .clickLaunchIcon('udapp') .click('*[data-id="settingsWeb3Mode"]') // select web3 provider with debug nodes URL .clearValue('*[data-id="modalDialogCustomPromptText"]') From e8f0d9e12f132aa1b4e7dbb20430eafb88606021 Mon Sep 17 00:00:00 2001 From: lianahus Date: Fri, 11 Jun 2021 00:16:51 +0200 Subject: [PATCH 26/67] bumped to 013.0-dev --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 144c35c778..f2a9a1c3ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "remix-project", - "version": "0.12.0-dev", + "version": "0.13.0-dev", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ccafdfdadf..a8c367df3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "remix-project", - "version": "0.12.0-dev", + "version": "0.13.0-dev", "license": "MIT", "description": "Ethereum Remix Monorepo", "keywords": [ From 3eca4ca42676f345cb3e8b5603a60ce31d7f1066 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 15 Jun 2021 12:10:41 +0530 Subject: [PATCH 27/67] fix for injected web3 call --- libs/remix-lib/src/execution/txRunnerWeb3.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-lib/src/execution/txRunnerWeb3.ts b/libs/remix-lib/src/execution/txRunnerWeb3.ts index 650593dfbc..f4bf3a662f 100644 --- a/libs/remix-lib/src/execution/txRunnerWeb3.ts +++ b/libs/remix-lib/src/execution/txRunnerWeb3.ts @@ -74,7 +74,7 @@ export class TxRunnerWeb3 { if (useCall) { const tag = Date.now() // for e2e reference tx['gas'] = gasLimit - tx['timestamp'] = timestamp + // tx['timestamp'] = timestamp return this.getWeb3().eth.call(tx, function (error, result: any) { if (error) return callback(error) callback(null, { From ab6d54f7b0b25b8c7a1a87fe74d7b0afe1a03c8c Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 15 Jun 2021 14:07:49 +0530 Subject: [PATCH 28/67] remove timestamp for kovan --- libs/remix-lib/src/execution/txRunnerWeb3.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/libs/remix-lib/src/execution/txRunnerWeb3.ts b/libs/remix-lib/src/execution/txRunnerWeb3.ts index f4bf3a662f..bd766f57ec 100644 --- a/libs/remix-lib/src/execution/txRunnerWeb3.ts +++ b/libs/remix-lib/src/execution/txRunnerWeb3.ts @@ -72,13 +72,19 @@ export class TxRunnerWeb3 { const tx = { from: from, to: to, data: data, value: value } if (useCall) { - const tag = Date.now() // for e2e reference tx['gas'] = gasLimit - // tx['timestamp'] = timestamp - return this.getWeb3().eth.call(tx, function (error, result: any) { - if (error) return callback(error) - callback(null, { - result: result + tx['timestamp'] = timestamp + return this._api.detectNetwork((err, network) => { + if (err) { + console.log(err) + return + } else if (network && network.name === 'Kovan') delete tx['timestamp'] + + return this.getWeb3().eth.call(tx, function (error, result: any) { + if (error) return callback(error) + callback(null, { + result: result + }) }) }) } From 009e6f18f040e8cbbff683b3a75f590d575f5270 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 15 Jun 2021 17:21:08 +0530 Subject: [PATCH 29/67] comment --- libs/remix-lib/src/execution/txRunnerWeb3.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/remix-lib/src/execution/txRunnerWeb3.ts b/libs/remix-lib/src/execution/txRunnerWeb3.ts index bd766f57ec..48a4292714 100644 --- a/libs/remix-lib/src/execution/txRunnerWeb3.ts +++ b/libs/remix-lib/src/execution/txRunnerWeb3.ts @@ -78,6 +78,9 @@ export class TxRunnerWeb3 { if (err) { console.log(err) return + // Remove `timestamp` from tx if network is Kovan + // It shows: 'Error: Returned error: Invalid params: unknown field `timestamp`' + // See: https://github.com/ethereum/remix-project/issues/1282 } else if (network && network.name === 'Kovan') delete tx['timestamp'] return this.getWeb3().eth.call(tx, function (error, result: any) { From b3771390f6a3eb60973e908310ce21deff30a0a3 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 14 Jun 2021 12:27:29 +0200 Subject: [PATCH 30/67] handle errors returns --- libs/remixd/src/bin/remixd.ts | 23 ++++++++++++++++++++--- libs/remixd/src/websocket.ts | 8 +++++++- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/libs/remixd/src/bin/remixd.ts b/libs/remixd/src/bin/remixd.ts index 913c7ec05a..6b80867843 100644 --- a/libs/remixd/src/bin/remixd.ts +++ b/libs/remixd/src/bin/remixd.ts @@ -36,12 +36,21 @@ const ports = { } const killCallBack: Array = [] -function startService (service: S, callback: (ws: WS, sharedFolderClient: servicesList.Sharedfolder) => void) { +function startService (service: S, callback: (ws: WS, sharedFolderClient: servicesList.Sharedfolder, error?:Error) => void) { const socket = new WebSocket(ports[service], { remixIdeUrl: program.remixIde }, () => services[service](program.readOnly || false)) socket.start(callback) killCallBack.push(socket.close.bind(socket)) } +function errorHandler (error: any, service: string) { + const port = ports[service] + if (error.code && error.code === 'EADDRINUSE') { + console.log('\x1b[31m%s\x1b[0m', `[ERR] There is already a client running on port ${port}!`) + } else { + console.log('\x1b[31m%s\x1b[0m', '[ERR]', error) + } +} + (async () => { const { version } = require('../package.json') program.version(version, '-v, --version') @@ -76,7 +85,11 @@ function startService (service: S, callb console.log('\x1b[33m%s\x1b[0m', '[WARN] Any application that runs on your computer can potentially read from and write to all files in the directory.') console.log('\x1b[33m%s\x1b[0m', '[WARN] Symbolic links are not forwarded to Remix IDE\n') try { - startService('folder', (ws: WS, sharedFolderClient: servicesList.Sharedfolder) => { + startService('folder', (ws: WS, sharedFolderClient: servicesList.Sharedfolder, error: any) => { + if (error) { + errorHandler(error, 'hardhat') + return false + } sharedFolderClient.setWebSocket(ws) sharedFolderClient.setupNotifications(program.sharedFolder) sharedFolderClient.sharedFolder(program.sharedFolder) @@ -85,7 +98,11 @@ function startService (service: S, callb const hardhatConfigFilePath = absolutePath('./', program.sharedFolder) + '/hardhat.config.js' const isHardhatProject = fs.existsSync(hardhatConfigFilePath) if (isHardhatProject) { - startService('hardhat', (ws: WS, sharedFolderClient: servicesList.Sharedfolder) => { + startService('hardhat', (ws: WS, sharedFolderClient: servicesList.Sharedfolder, error: Error) => { + if (error) { + errorHandler(error, 'hardhat') + return false + } sharedFolderClient.setWebSocket(ws) sharedFolderClient.sharedFolder(program.sharedFolder) }) diff --git a/libs/remixd/src/websocket.ts b/libs/remixd/src/websocket.ts index cc3ca7b197..370dc48abb 100644 --- a/libs/remixd/src/websocket.ts +++ b/libs/remixd/src/websocket.ts @@ -9,7 +9,7 @@ export default class WebSocket { constructor (public port: number, public opt: WebsocketOpt, public getclient: () => ServiceClient) {} //eslint-disable-line - start (callback?: (ws: WS, client: ServiceClient) => void): void { + start (callback?: (ws: WS, client: ServiceClient, error?: Error) => void): void { this.server = http.createServer((request, response) => { console.log((new Date()) + ' Received request for ' + request.url) response.writeHead(404) @@ -21,9 +21,15 @@ export default class WebSocket { 65521: 'git', 65522: 'hardhat' } + + this.server.on('error', (error: Error) => { + if (callback)callback(null, null, error) + }) + this.server.listen(this.port, loopback, () => { console.log('\x1b[32m%s\x1b[0m', `[INFO] ${new Date()} ${listeners[this.port]} is listening on ${loopback}:${this.port}`) }) + this.wsServer = new WS.Server({ server: this.server, verifyClient: (info, done) => { From 075085364a178415b7ad2b96776560daf3e17779 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jun 2021 11:34:17 +0200 Subject: [PATCH 31/67] make sure contract is resolved --- apps/debugger/src/app/debugger-api.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/debugger/src/app/debugger-api.ts b/apps/debugger/src/app/debugger-api.ts index e9654dd343..0f99518e78 100644 --- a/apps/debugger/src/app/debugger-api.ts +++ b/apps/debugger/src/app/debugger-api.ts @@ -74,7 +74,10 @@ export const DebuggerApiMixin = (Base) => class extends Base { const targetAddress = target || receipt.contractAddress || receipt.to const codeAtAddress = await this._web3.eth.getCode(targetAddress) const output = await this.call('fetchAndCompile', 'resolve', targetAddress, codeAtAddress, 'browser/.debug') - return new CompilerAbstract(output.languageversion, output.data, output.source) + if (output) { + return new CompilerAbstract(output.languageversion, output.data, output.source) + } + return null } async getDebugWeb3 () { From 63a8d24b5e8dbf2725029e7e001c4adeb75964eb Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jun 2021 11:34:55 +0200 Subject: [PATCH 32/67] make async --- libs/remix-debug/src/debugger/VmDebugger.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/remix-debug/src/debugger/VmDebugger.ts b/libs/remix-debug/src/debugger/VmDebugger.ts index 621e3d3bb1..2a90d0ed2c 100644 --- a/libs/remix-debug/src/debugger/VmDebugger.ts +++ b/libs/remix-debug/src/debugger/VmDebugger.ts @@ -189,7 +189,7 @@ export class VmDebuggerLogic { }) }) - this.debugger.event.register('indexChanged', this, (index) => { + this.debugger.event.register('indexChanged', this, async (index) => { if (index < 0) return if (this.stepManager.currentStepIndex !== index) return if (!this.storageResolver) return @@ -201,11 +201,13 @@ export class VmDebuggerLogic { for (var k in this.addresses) { var address = this.addresses[k] var storageViewer = new StorageViewer({ stepIndex: this.stepManager.currentStepIndex, tx: this.tx, address: address }, this.storageResolver, this._traceManager) - storageViewer.storageRange().then((result) => { - storageJSON[address] = result - this.event.trigger('traceStorageUpdate', [storageJSON]) - }) + try { + storageJSON[address] = await storageViewer.storageRange() + } catch (e) { + console.error(e) + } } + this.event.trigger('traceStorageUpdate', [storageJSON]) }) } From 043f309ef5299397e4031a178c3592322cdffed0 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jun 2021 11:35:09 +0200 Subject: [PATCH 33/67] handle CREATE2 --- libs/remix-debug/src/trace/traceHelper.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/remix-debug/src/trace/traceHelper.ts b/libs/remix-debug/src/trace/traceHelper.ts index 7de74cd999..2c82f8c0c1 100644 --- a/libs/remix-debug/src/trace/traceHelper.ts +++ b/libs/remix-debug/src/trace/traceHelper.ts @@ -15,11 +15,11 @@ export function resolveCalledAddress (vmTraceIndex, trace) { } export function isCallInstruction (step) { - return ['CALL', 'STATICCALL', 'CALLCODE', 'CREATE', 'DELEGATECALL'].includes(step.op) + return ['CALL', 'STATICCALL', 'CALLCODE', 'CREATE', 'DELEGATECALL', 'CREATE2'].includes(step.op) } export function isCreateInstruction (step) { - return step.op === 'CREATE' + return step.op === 'CREATE' || step.op === 'CREATE2' } export function isReturnInstruction (step) { @@ -47,7 +47,7 @@ export function isSHA3Instruction (step) { } export function newContextStorage (step) { - return step.op === 'CREATE' || step.op === 'CALL' + return step.op === 'CREATE' || step.op === 'CALL' || step.op === 'CREATE2' } export function isCallToPrecompiledContract (index, trace) { From 9d0fdf23b6dffb55e90840b1cde1ba88bb172171 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Jun 2021 23:13:01 +0200 Subject: [PATCH 34/67] fix switch to code-sample workspace --- .../src/commands/currentWorkspace.ts | 17 +++++++++++++++++ apps/remix-ide-e2e/src/tests/url.spec.ts | 7 ++++++- apps/remix-ide-e2e/src/types/index.d.ts | 1 + .../workspace/src/lib/remix-ui-workspace.tsx | 5 +++-- 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 apps/remix-ide-e2e/src/commands/currentWorkspace.ts diff --git a/apps/remix-ide-e2e/src/commands/currentWorkspace.ts b/apps/remix-ide-e2e/src/commands/currentWorkspace.ts new file mode 100644 index 0000000000..a0bf9f4bbd --- /dev/null +++ b/apps/remix-ide-e2e/src/commands/currentWorkspace.ts @@ -0,0 +1,17 @@ +import { NightwatchBrowser } from 'nightwatch' +import EventEmitter from 'events' + +class CurrentWorkspace extends EventEmitter { + command (this: NightwatchBrowser, name: string): NightwatchBrowser { + this.api + .execute(() => { + return (document.querySelector('select[data-id="workspacesSelect"]') as any).value + }, [], (result) => { + this.api.assert.equal(result.value, name) + this.emit('complete') + }) + return this + } +} + +module.exports = CurrentWorkspace diff --git a/apps/remix-ide-e2e/src/tests/url.spec.ts b/apps/remix-ide-e2e/src/tests/url.spec.ts index c1714b01bf..89767f8e8d 100644 --- a/apps/remix-ide-e2e/src/tests/url.spec.ts +++ b/apps/remix-ide-e2e/src/tests/url.spec.ts @@ -10,7 +10,7 @@ const sources = [ module.exports = { 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&code=cHJhZ21hIHNvbGlkaXR5ID49MC42LjAgPDAuNy4wOwoKaW1wb3J0ICJodHRwczovL2dpdGh1Yi5jb20vT3BlblplcHBlbGluL29wZW56ZXBwZWxpbi1jb250cmFjdHMvYmxvYi9tYXN0ZXIvY29udHJhY3RzL2FjY2Vzcy9Pd25hYmxlLnNvbCI7Cgpjb250cmFjdCBHZXRQYWlkIGlzIE93bmFibGUgewogIGZ1bmN0aW9uIHdpdGhkcmF3KCkgZXh0ZXJuYWwgb25seU93bmVyIHsKICB9Cn0', 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 () { @@ -19,6 +19,11 @@ module.exports = { 'Should load the code from URL params': 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&code=cHJhZ21hIHNvbGlkaXR5ID49MC42LjAgPDAuNy4wOwoKaW1wb3J0ICJodHRwczovL2dpdGh1Yi5jb20vT3BlblplcHBlbGluL29wZW56ZXBwZWxpbi1jb250cmFjdHMvYmxvYi9tYXN0ZXIvY29udHJhY3RzL2FjY2Vzcy9Pd25hYmxlLnNvbCI7Cgpjb250cmFjdCBHZXRQYWlkIGlzIE93bmFibGUgewogIGZ1bmN0aW9uIHdpdGhkcmF3KCkgZXh0ZXJuYWwgb25seU93bmVyIHsKICB9Cn0') + .refresh() // we do one reload for making sure we already have the default workspace + .pause(5000) + .currentWorkspace('code-sample2') .getEditorValue((content) => { browser.assert.ok(content.indexOf( 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol') !== -1, diff --git a/apps/remix-ide-e2e/src/types/index.d.ts b/apps/remix-ide-e2e/src/types/index.d.ts index 140b3ee089..6225dd152c 100644 --- a/apps/remix-ide-e2e/src/types/index.d.ts +++ b/apps/remix-ide-e2e/src/types/index.d.ts @@ -56,6 +56,7 @@ declare module "nightwatch" { checkAnnotations(type: string, line: number): NightwatchBrowser checkAnnotationsNotPresent(type: string): NightwatchBrowser getLastTransactionHash(callback: (hash: string) => void) + currentWorkspace(name: string): NightwatchBrowser } export interface NightwatchBrowser { 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 cbb10f79eb..6a85a0febf 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -74,9 +74,10 @@ export const Workspace = (props: WorkspaceProps) => { let getWorkspaces = async () => { if (props.workspaces && Array.isArray(props.workspaces)) { if (props.workspaces.length > 0 && state.currentWorkspace === NO_WORKSPACE) { - await props.workspace.setWorkspace(props.workspaces[0]) + const currentWorkspace = props.workspace.getWorkspace() ? props.workspace.getWorkspace() : props.workspaces[0] + await props.workspace.setWorkspace(currentWorkspace) setState(prevState => { - return { ...prevState, workspaces: props.workspaces, currentWorkspace: props.workspaces[0] } + return { ...prevState, workspaces: props.workspaces, currentWorkspace } }) } else { setState(prevState => { From 050334d8e9f764f0665a8dff490706de2353154c Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 18 Jun 2021 14:47:58 +0200 Subject: [PATCH 35/67] rename command --- .../commands/{currentWorkspace.ts => currentWorkspaceIs.ts} | 5 +++-- apps/remix-ide-e2e/src/tests/url.spec.ts | 2 +- apps/remix-ide-e2e/src/types/index.d.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) rename apps/remix-ide-e2e/src/commands/{currentWorkspace.ts => currentWorkspaceIs.ts} (78%) diff --git a/apps/remix-ide-e2e/src/commands/currentWorkspace.ts b/apps/remix-ide-e2e/src/commands/currentWorkspaceIs.ts similarity index 78% rename from apps/remix-ide-e2e/src/commands/currentWorkspace.ts rename to apps/remix-ide-e2e/src/commands/currentWorkspaceIs.ts index a0bf9f4bbd..c9cb20e514 100644 --- a/apps/remix-ide-e2e/src/commands/currentWorkspace.ts +++ b/apps/remix-ide-e2e/src/commands/currentWorkspaceIs.ts @@ -1,12 +1,13 @@ import { NightwatchBrowser } from 'nightwatch' import EventEmitter from 'events' -class CurrentWorkspace extends EventEmitter { +class CurrentWorkspaceIs extends EventEmitter { command (this: NightwatchBrowser, name: string): NightwatchBrowser { this.api .execute(() => { return (document.querySelector('select[data-id="workspacesSelect"]') as any).value }, [], (result) => { + console.log(result) this.api.assert.equal(result.value, name) this.emit('complete') }) @@ -14,4 +15,4 @@ class CurrentWorkspace extends EventEmitter { } } -module.exports = CurrentWorkspace +module.exports = CurrentWorkspaceIs diff --git a/apps/remix-ide-e2e/src/tests/url.spec.ts b/apps/remix-ide-e2e/src/tests/url.spec.ts index 89767f8e8d..8caad7dbf0 100644 --- a/apps/remix-ide-e2e/src/tests/url.spec.ts +++ b/apps/remix-ide-e2e/src/tests/url.spec.ts @@ -23,7 +23,7 @@ module.exports = { .url('http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js&code=cHJhZ21hIHNvbGlkaXR5ID49MC42LjAgPDAuNy4wOwoKaW1wb3J0ICJodHRwczovL2dpdGh1Yi5jb20vT3BlblplcHBlbGluL29wZW56ZXBwZWxpbi1jb250cmFjdHMvYmxvYi9tYXN0ZXIvY29udHJhY3RzL2FjY2Vzcy9Pd25hYmxlLnNvbCI7Cgpjb250cmFjdCBHZXRQYWlkIGlzIE93bmFibGUgewogIGZ1bmN0aW9uIHdpdGhkcmF3KCkgZXh0ZXJuYWwgb25seU93bmVyIHsKICB9Cn0') .refresh() // we do one reload for making sure we already have the default workspace .pause(5000) - .currentWorkspace('code-sample2') + .currentWorkspaceIs('code-sample2') .getEditorValue((content) => { browser.assert.ok(content.indexOf( 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol') !== -1, diff --git a/apps/remix-ide-e2e/src/types/index.d.ts b/apps/remix-ide-e2e/src/types/index.d.ts index 6225dd152c..d195c8cf2a 100644 --- a/apps/remix-ide-e2e/src/types/index.d.ts +++ b/apps/remix-ide-e2e/src/types/index.d.ts @@ -56,7 +56,7 @@ declare module "nightwatch" { checkAnnotations(type: string, line: number): NightwatchBrowser checkAnnotationsNotPresent(type: string): NightwatchBrowser getLastTransactionHash(callback: (hash: string) => void) - currentWorkspace(name: string): NightwatchBrowser + currentWorkspaceIs(name: string): NightwatchBrowser } export interface NightwatchBrowser { From 2fe52a1f1dac5f48ea84d71ac3f2c7a3904afa27 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 18 Jun 2021 16:53:02 +0200 Subject: [PATCH 36/67] fix e2e --- apps/remix-ide-e2e/src/commands/currentWorkspaceIs.ts | 5 +++-- apps/remix-ide-e2e/src/tests/url.spec.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/currentWorkspaceIs.ts b/apps/remix-ide-e2e/src/commands/currentWorkspaceIs.ts index c9cb20e514..a090735f45 100644 --- a/apps/remix-ide-e2e/src/commands/currentWorkspaceIs.ts +++ b/apps/remix-ide-e2e/src/commands/currentWorkspaceIs.ts @@ -4,8 +4,9 @@ import EventEmitter from 'events' class CurrentWorkspaceIs extends EventEmitter { command (this: NightwatchBrowser, name: string): NightwatchBrowser { this.api - .execute(() => { - return (document.querySelector('select[data-id="workspacesSelect"]') as any).value + .execute(function () { + const el = document.querySelector('select[data-id="workspacesSelect"]') as HTMLSelectElement + return el.value }, [], (result) => { console.log(result) this.api.assert.equal(result.value, name) diff --git a/apps/remix-ide-e2e/src/tests/url.spec.ts b/apps/remix-ide-e2e/src/tests/url.spec.ts index 8caad7dbf0..898bc311d6 100644 --- a/apps/remix-ide-e2e/src/tests/url.spec.ts +++ b/apps/remix-ide-e2e/src/tests/url.spec.ts @@ -23,7 +23,7 @@ module.exports = { .url('http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js&code=cHJhZ21hIHNvbGlkaXR5ID49MC42LjAgPDAuNy4wOwoKaW1wb3J0ICJodHRwczovL2dpdGh1Yi5jb20vT3BlblplcHBlbGluL29wZW56ZXBwZWxpbi1jb250cmFjdHMvYmxvYi9tYXN0ZXIvY29udHJhY3RzL2FjY2Vzcy9Pd25hYmxlLnNvbCI7Cgpjb250cmFjdCBHZXRQYWlkIGlzIE93bmFibGUgewogIGZ1bmN0aW9uIHdpdGhkcmF3KCkgZXh0ZXJuYWwgb25seU93bmVyIHsKICB9Cn0') .refresh() // we do one reload for making sure we already have the default workspace .pause(5000) - .currentWorkspaceIs('code-sample2') + .currentWorkspaceIs('code-sample') .getEditorValue((content) => { browser.assert.ok(content.indexOf( 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol') !== -1, From 484f1fed2fabb9f28027788972c6e1eed368b282 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 21 Jun 2021 12:15:47 +0200 Subject: [PATCH 37/67] fix e2e --- apps/remix-ide-e2e/src/tests/url.spec.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/remix-ide-e2e/src/tests/url.spec.ts b/apps/remix-ide-e2e/src/tests/url.spec.ts index 898bc311d6..a2abb2cba2 100644 --- a/apps/remix-ide-e2e/src/tests/url.spec.ts +++ b/apps/remix-ide-e2e/src/tests/url.spec.ts @@ -33,6 +33,11 @@ module.exports = { 'Should load using URL compiler params': 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') + .refresh() + .pause(5000) + .clickLaunchIcon('solidity') .assert.containsText('#versionSelector option[selected="selected"]', '0.7.4+commit.3f05b770') .assert.containsText('#evmVersionSelector option[selected="selected"]', 'istanbul') .verify.elementPresent('#optimize:checked') From 10666349b64512d07ba478235f10135a65d5b523 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 29 Apr 2021 15:11:32 +0200 Subject: [PATCH 38/67] fork selection for javascript VM --- apps/debugger/src/app/debugger-api.ts | 3 +- .../remix-ide/src/app/tabs/runTab/settings.js | 29 ++++++++++++++---- apps/remix-ide/src/blockchain/blockchain.js | 4 +++ .../src/blockchain/execution-context.js | 21 +++++++++---- apps/remix-ide/src/blockchain/providers/vm.js | 12 ++++---- libs/remix-debug/src/Ethdebugger.ts | 4 +-- libs/remix-debug/src/code/codeManager.ts | 6 ++-- libs/remix-debug/src/code/codeResolver.ts | 6 ++-- libs/remix-debug/src/code/codeUtils.ts | 27 +++++++++++++---- libs/remix-debug/src/debugger/debugger.ts | 3 +- libs/remix-debug/src/trace/traceManager.ts | 6 ++++ libs/remix-simulator/src/provider.ts | 6 ++-- libs/remix-simulator/src/vm-context.ts | 30 +++++++++---------- 13 files changed, 107 insertions(+), 50 deletions(-) diff --git a/apps/debugger/src/app/debugger-api.ts b/apps/debugger/src/app/debugger-api.ts index 0f99518e78..e1b66a3d48 100644 --- a/apps/debugger/src/app/debugger-api.ts +++ b/apps/debugger/src/app/debugger-api.ts @@ -111,7 +111,8 @@ export const DebuggerApiMixin = (Base) => class extends Base { } return null }, - debugWithGeneratedSources: false + debugWithGeneratedSources: false, + fork: 'berlin' }) return await debug.debugger.traceManager.getTrace(hash) } diff --git a/apps/remix-ide/src/app/tabs/runTab/settings.js b/apps/remix-ide/src/app/tabs/runTab/settings.js index dd726c09be..21085d9e27 100644 --- a/apps/remix-ide/src/app/tabs/runTab/settings.js +++ b/apps/remix-ide/src/app/tabs/runTab/settings.js @@ -98,9 +98,17 @@ class SettingsUI {
    - - - - From df51743d06023648b9a3bb90e82a8e622e9cea15 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 21 Jun 2021 11:22:08 +0200 Subject: [PATCH 46/67] linting --- apps/remix-ide/src/blockchain/blockchain.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/blockchain/blockchain.js b/apps/remix-ide/src/blockchain/blockchain.js index 08a76c48e5..00986d1fa9 100644 --- a/apps/remix-ide/src/blockchain/blockchain.js +++ b/apps/remix-ide/src/blockchain/blockchain.js @@ -212,7 +212,7 @@ class Blockchain { * return the fork name applied to the current envionment * @return {String} - fork name */ - getCurrentFork () { + getCurrentFork () { return this.executionContext.getCurrentFork() } From 069ca0e5e00618d72a0670b0d6397455a6d6c770 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 21 Jun 2021 11:44:01 +0200 Subject: [PATCH 47/67] fix e2e --- apps/remix-ide-e2e/src/tests/transactionExecution.spec.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/transactionExecution.spec.ts b/apps/remix-ide-e2e/src/tests/transactionExecution.spec.ts index e922b59873..cb344ea5b9 100644 --- a/apps/remix-ide-e2e/src/tests/transactionExecution.spec.ts +++ b/apps/remix-ide-e2e/src/tests/transactionExecution.spec.ts @@ -142,7 +142,6 @@ module.exports = { 'Should Compile and Deploy a contract which define a custom error, the error should be logged in the terminal': function (browser: NightwatchBrowser) { browser.testContracts('customError.sol', sources[4]['customError.sol'], ['C']) .clickLaunchIcon('udapp') - .click('*[data-id="settingsWeb3Mode"]') .selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite .click('#runTabView button[class^="instanceButton"]') .waitForElementPresent('.instance:nth-of-type(3)') @@ -157,7 +156,6 @@ module.exports = { 'Should Compile and Deploy a contract which define a custom error, the error should be logged in the terminal , using London VM Fork': function (browser: NightwatchBrowser) { browser - .clickLaunchIcon('udapp') .click('*[data-id="settingsVMLondonMode"]') // switch to London fork .selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite .click('#runTabView button[class^="instanceButton"]') From a4becad03832882e33bc93b1cf36188e06800a4b Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 21 Jun 2021 12:33:27 +0200 Subject: [PATCH 48/67] fix e2e and update ethereumjsvm --- .../src/tests/transactionExecution.spec.ts | 4 +- libs/remix-analyzer/package.json | 2 +- libs/remix-astwalker/package.json | 2 +- libs/remix-debug/package.json | 2 +- libs/remix-lib/package.json | 2 +- libs/remix-simulator/package.json | 2 +- libs/remix-solidity/package.json | 2 +- libs/remix-tests/package.json | 2 +- package-lock.json | 619 +++++++----------- package.json | 2 +- 10 files changed, 235 insertions(+), 404 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/transactionExecution.spec.ts b/apps/remix-ide-e2e/src/tests/transactionExecution.spec.ts index cb344ea5b9..e1d5ebb82f 100644 --- a/apps/remix-ide-e2e/src/tests/transactionExecution.spec.ts +++ b/apps/remix-ide-e2e/src/tests/transactionExecution.spec.ts @@ -159,8 +159,8 @@ module.exports = { .click('*[data-id="settingsVMLondonMode"]') // switch to London fork .selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite .click('#runTabView button[class^="instanceButton"]') - .waitForElementPresent('.instance:nth-of-type(3)') - .click('.instance:nth-of-type(3) > div > button') + .waitForElementPresent('.instance:nth-of-type(2)') + .click('.instance:nth-of-type(2) > div > button') .clickFunction('g - transact (not payable)') .journalLastChildIncludes('Error provided by the contract:') .journalLastChildIncludes('CustomError') diff --git a/libs/remix-analyzer/package.json b/libs/remix-analyzer/package.json index 01eb9fc810..b5b53f9408 100644 --- a/libs/remix-analyzer/package.json +++ b/libs/remix-analyzer/package.json @@ -21,7 +21,7 @@ "dependencies": { "@ethereumjs/block": "^3.2.1", "@ethereumjs/tx": "^3.1.3", - "@ethereumjs/vm": "^5.3.2", + "@ethereumjs/vm": "^5.4.1", "@remix-project/remix-astwalker": "^0.0.26", "@remix-project/remix-lib": "^0.5.0", "async": "^2.6.2", diff --git a/libs/remix-astwalker/package.json b/libs/remix-astwalker/package.json index 1911bb1f4e..4f9b1f652e 100644 --- a/libs/remix-astwalker/package.json +++ b/libs/remix-astwalker/package.json @@ -36,7 +36,7 @@ "dependencies": { "@ethereumjs/block": "^3.2.1", "@ethereumjs/tx": "^3.1.3", - "@ethereumjs/vm": "^5.3.2", + "@ethereumjs/vm": "^5.4.1", "@remix-project/remix-lib": "^0.5.0", "@types/tape": "^4.2.33", "async": "^2.6.2", diff --git a/libs/remix-debug/package.json b/libs/remix-debug/package.json index 387ac0316d..0e496c8d5a 100644 --- a/libs/remix-debug/package.json +++ b/libs/remix-debug/package.json @@ -21,7 +21,7 @@ "@ethereumjs/block": "^3.2.1", "@ethereumjs/common": "^2.2.0", "@ethereumjs/tx": "^3.1.3", - "@ethereumjs/vm": "^5.3.2", + "@ethereumjs/vm": "^5.4.1", "@remix-project/remix-astwalker": "^0.0.26", "@remix-project/remix-lib": "^0.5.0", "async": "^2.6.2", diff --git a/libs/remix-lib/package.json b/libs/remix-lib/package.json index bf03b65c9d..5905ef3fc0 100644 --- a/libs/remix-lib/package.json +++ b/libs/remix-lib/package.json @@ -16,7 +16,7 @@ "dependencies": { "@ethereumjs/block": "^3.2.1", "@ethereumjs/tx": "^3.1.3", - "@ethereumjs/vm": "^5.3.2", + "@ethereumjs/vm": "^5.4.1", "async": "^2.1.2", "ethereumjs-util": "^7.0.10", "ethers": "^4.0.40", diff --git a/libs/remix-simulator/package.json b/libs/remix-simulator/package.json index b537ba76b0..02a1e79bd4 100644 --- a/libs/remix-simulator/package.json +++ b/libs/remix-simulator/package.json @@ -17,7 +17,7 @@ "@ethereumjs/block": "^3.2.1", "@ethereumjs/common": "^2.2.0", "@ethereumjs/tx": "^3.1.3", - "@ethereumjs/vm": "^5.3.2", + "@ethereumjs/vm": "^5.4.1", "@remix-project/remix-lib": "^0.5.0", "ansi-gray": "^0.1.1", "async": "^3.1.0", diff --git a/libs/remix-solidity/package.json b/libs/remix-solidity/package.json index c534241283..d2c589b111 100644 --- a/libs/remix-solidity/package.json +++ b/libs/remix-solidity/package.json @@ -17,7 +17,7 @@ "dependencies": { "@ethereumjs/block": "^3.2.1", "@ethereumjs/tx": "^3.1.3", - "@ethereumjs/vm": "^5.3.2", + "@ethereumjs/vm": "^5.4.1", "@remix-project/remix-lib": "^0.5.0", "async": "^2.6.2", "eslint-scope": "^5.0.0", diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index efd0407074..85c49ecba8 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -38,7 +38,7 @@ "@ethereumjs/block": "^3.2.1", "@ethereumjs/common": "^2.2.0", "@ethereumjs/tx": "^3.1.3", - "@ethereumjs/vm": "^5.3.2", + "@ethereumjs/vm": "^5.4.1", "@remix-project/remix-lib": "^0.5.0", "@remix-project/remix-simulator": "^0.2.0", "@remix-project/remix-solidity": "^0.4.0", diff --git a/package-lock.json b/package-lock.json index f2a9a1c3ff..eedcc2ed2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2729,45 +2729,49 @@ } }, "@ethereumjs/blockchain": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.2.1.tgz", - "integrity": "sha512-+hshP2qSOOFsiYvZCbaDQFG7jYTWafE8sfBi+pAsdhAHfP7BN7VLyob7qoQISgwS1s7NTR4c4+2t/woU9ahItw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.3.0.tgz", + "integrity": "sha512-B0Y5QDZcRDQISPilv3m8nzk97QmC98DnSE9WxzGpCxfef22Mw7xhwGipci5Iy0dVC2Np2Cr5d3F6bHAR7+yVmQ==", "requires": { - "@ethereumjs/block": "^3.2.0", - "@ethereumjs/common": "^2.2.0", + "@ethereumjs/block": "^3.3.0", + "@ethereumjs/common": "^2.3.0", "@ethereumjs/ethash": "^1.0.0", "debug": "^2.2.0", - "ethereumjs-util": "^7.0.9", + "ethereumjs-util": "^7.0.10", "level-mem": "^5.0.1", "lru-cache": "^5.1.1", "rlp": "^2.2.4", "semaphore-async-await": "^1.5.1" }, "dependencies": { - "@types/bn.js": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", - "integrity": "sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==", + "@ethereumjs/block": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.3.0.tgz", + "integrity": "sha512-WoefY9Rs4W8vZTxG9qwntAlV61xsSv0NPoXmHO7x3SH16dwJQtU15YvahPCz4HEEXbu7GgGgNgu0pv8JY7VauA==", "requires": { - "@types/node": "*" + "@ethereumjs/common": "^2.3.0", + "@ethereumjs/tx": "^3.2.0", + "ethereumjs-util": "^7.0.10", + "merkle-patricia-tree": "^4.2.0" } }, - "abstract-leveldown": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", - "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", + "@ethereumjs/common": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.3.1.tgz", + "integrity": "sha512-V8hrULExoq0H4HFs3cCmdRGbgmipmlNzak6Xg34nHYfQyqkSdrCuflvYjyWmsNpI8GtrcZhzifAbgX/1C1Cjwg==", "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" + "crc-32": "^1.2.0", + "ethereumjs-util": "^7.0.10" } }, - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "@ethereumjs/tx": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.2.1.tgz", + "integrity": "sha512-i9V39OtKvwWos1uVNZxdVhd7zFOyzFLjgt69CoiOY0EmXugS0HjO3uxpLBSglDKFMRriuGqw6ddKEv+RP1UNEw==", + "requires": { + "@ethereumjs/common": "^2.3.1", + "ethereumjs-util": "^7.0.10" + } }, "debug": { "version": "2.6.9", @@ -2777,150 +2781,10 @@ "ms": "2.0.0" } }, - "deferred-leveldown": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", - "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", - "requires": { - "abstract-leveldown": "~6.2.1", - "inherits": "^2.0.3" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - } - } - }, - "encoding-down": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", - "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", - "requires": { - "abstract-leveldown": "^6.2.1", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0" - } - }, - "ethereumjs-util": { - "version": "7.0.10", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.10.tgz", - "integrity": "sha512-c/xThw6A+EAnej5Xk5kOzFzyoSnw0WX0tSlZ6pAsfGVvQj3TItaDg9b1+Fz1RJXA+y2YksKwQnuzgt1eY6LKzw==", - "requires": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.4" - } - }, - "level-codec": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", - "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", - "requires": { - "buffer": "^5.6.0" - } - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", - "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.4.0", - "xtend": "^4.0.2" - } - }, - "level-mem": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-5.0.1.tgz", - "integrity": "sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg==", - "requires": { - "level-packager": "^5.0.3", - "memdown": "^5.0.0" - } - }, - "level-packager": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-5.1.1.tgz", - "integrity": "sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==", - "requires": { - "encoding-down": "^6.3.0", - "levelup": "^4.3.2" - } - }, - "levelup": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", - "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", - "requires": { - "deferred-leveldown": "~5.3.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~4.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "memdown": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-5.1.0.tgz", - "integrity": "sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw==", - "requires": { - "abstract-leveldown": "~6.2.1", - "functional-red-black-tree": "~1.0.1", - "immediate": "~3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.2.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "immediate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" - } - } - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" } } }, @@ -2944,19 +2808,6 @@ "miller-rabin": "^4.0.0" }, "dependencies": { - "@types/bn.js": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", - "integrity": "sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==", - "requires": { - "@types/node": "*" - } - }, - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - }, "buffer-xor": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", @@ -2964,19 +2815,6 @@ "requires": { "safe-buffer": "^5.1.1" } - }, - "ethereumjs-util": { - "version": "7.0.10", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.10.tgz", - "integrity": "sha512-c/xThw6A+EAnej5Xk5kOzFzyoSnw0WX0tSlZ6pAsfGVvQj3TItaDg9b1+Fz1RJXA+y2YksKwQnuzgt1eY6LKzw==", - "requires": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.4" - } } } }, @@ -3018,49 +2856,53 @@ } }, "@ethereumjs/vm": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.3.2.tgz", - "integrity": "sha512-QmCUQrW6xbhgEbQh9njue4kAJdM056C+ytBFUTF/kDYa3kNDm4Qxp9HUyTlt1OCSXvDhws0qqlh8+q+pmXpN7g==", - "requires": { - "@ethereumjs/block": "^3.2.1", - "@ethereumjs/blockchain": "^5.2.1", - "@ethereumjs/common": "^2.2.0", - "@ethereumjs/tx": "^3.1.3", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.4.1.tgz", + "integrity": "sha512-cpQcg5CtjzXJBn8QNiobaiWckeN/ZQwsDHLYa9df2wBEUvzuEZgFWK48YEXSpx3CnUY9fNT/lgA9CzKdq8HTzQ==", + "requires": { + "@ethereumjs/block": "^3.3.0", + "@ethereumjs/blockchain": "^5.3.0", + "@ethereumjs/common": "^2.3.1", + "@ethereumjs/tx": "^3.2.1", "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", "debug": "^2.2.0", "ethereumjs-util": "^7.0.10", "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", - "merkle-patricia-tree": "^4.1.0", + "merkle-patricia-tree": "^4.2.0", "rustbn.js": "~0.2.0", "util.promisify": "^1.0.1" }, "dependencies": { - "@types/bn.js": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", - "integrity": "sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==", + "@ethereumjs/block": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.3.0.tgz", + "integrity": "sha512-WoefY9Rs4W8vZTxG9qwntAlV61xsSv0NPoXmHO7x3SH16dwJQtU15YvahPCz4HEEXbu7GgGgNgu0pv8JY7VauA==", "requires": { - "@types/node": "*" + "@ethereumjs/common": "^2.3.0", + "@ethereumjs/tx": "^3.2.0", + "ethereumjs-util": "^7.0.10", + "merkle-patricia-tree": "^4.2.0" } }, - "abstract-leveldown": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", - "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", + "@ethereumjs/common": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.3.1.tgz", + "integrity": "sha512-V8hrULExoq0H4HFs3cCmdRGbgmipmlNzak6Xg34nHYfQyqkSdrCuflvYjyWmsNpI8GtrcZhzifAbgX/1C1Cjwg==", "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" + "crc-32": "^1.2.0", + "ethereumjs-util": "^7.0.10" } }, - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "@ethereumjs/tx": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.2.1.tgz", + "integrity": "sha512-i9V39OtKvwWos1uVNZxdVhd7zFOyzFLjgt69CoiOY0EmXugS0HjO3uxpLBSglDKFMRriuGqw6ddKEv+RP1UNEw==", + "requires": { + "@ethereumjs/common": "^2.3.1", + "ethereumjs-util": "^7.0.10" + } }, "debug": { "version": "2.6.9", @@ -3070,174 +2912,10 @@ "ms": "2.0.0" } }, - "deferred-leveldown": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", - "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", - "requires": { - "abstract-leveldown": "~6.2.1", - "inherits": "^2.0.3" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - } - } - }, - "encoding-down": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", - "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", - "requires": { - "abstract-leveldown": "^6.2.1", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0" - } - }, - "ethereumjs-util": { - "version": "7.0.10", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.10.tgz", - "integrity": "sha512-c/xThw6A+EAnej5Xk5kOzFzyoSnw0WX0tSlZ6pAsfGVvQj3TItaDg9b1+Fz1RJXA+y2YksKwQnuzgt1eY6LKzw==", - "requires": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.4" - } - }, - "level-codec": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", - "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", - "requires": { - "buffer": "^5.6.0" - } - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", - "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.4.0", - "xtend": "^4.0.2" - } - }, - "level-mem": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-5.0.1.tgz", - "integrity": "sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg==", - "requires": { - "level-packager": "^5.0.3", - "memdown": "^5.0.0" - } - }, - "level-packager": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-5.1.1.tgz", - "integrity": "sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==", - "requires": { - "encoding-down": "^6.3.0", - "levelup": "^4.3.2" - } - }, - "level-ws": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-2.0.0.tgz", - "integrity": "sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA==", - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^3.1.0", - "xtend": "^4.0.1" - } - }, - "levelup": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", - "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", - "requires": { - "deferred-leveldown": "~5.3.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~4.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "memdown": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-5.1.0.tgz", - "integrity": "sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw==", - "requires": { - "abstract-leveldown": "~6.2.1", - "functional-red-black-tree": "~1.0.1", - "immediate": "~3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.2.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "immediate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" - } - } - }, - "merkle-patricia-tree": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-4.1.0.tgz", - "integrity": "sha512-vmP1J7FwIpprFMVjjSMM1JAwFce85Q+tp0TYIedYv8qaMh2oLUZ3ETXn9wbgi9S6elySzKzGa+Ai6VNKGEwSlg==", - "requires": { - "@types/levelup": "^4.3.0", - "ethereumjs-util": "^7.0.8", - "level-mem": "^5.0.1", - "level-ws": "^2.0.0", - "readable-stream": "^3.6.0", - "rlp": "^2.2.3", - "semaphore-async-await": "^1.5.1" - } - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" } } }, @@ -8993,6 +8671,18 @@ "event-target-shim": "^5.0.0" } }, + "abstract-leveldown": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", + "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, "accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -9732,16 +9422,6 @@ "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", "requires": { "async": "^2.4.0" - }, - "dependencies": { - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "requires": { - "lodash": "^4.17.14" - } - } } }, "async-limiter": { @@ -15261,6 +14941,29 @@ "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==" }, + "deferred-leveldown": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", + "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", + "requires": { + "abstract-leveldown": "~6.2.1", + "inherits": "^2.0.3" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + } + } + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -15950,6 +15653,17 @@ } } }, + "encoding-down": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", + "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", + "requires": { + "abstract-leveldown": "^6.2.1", + "inherits": "^2.0.3", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0" + } + }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -24916,11 +24630,55 @@ } } }, + "level-codec": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", + "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", + "requires": { + "buffer": "^5.6.0" + } + }, "level-concat-iterator": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", + "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.4.0", + "xtend": "^4.0.2" + } + }, + "level-mem": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-5.0.1.tgz", + "integrity": "sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg==", + "requires": { + "level-packager": "^5.0.3", + "memdown": "^5.0.0" + } + }, + "level-packager": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-5.1.1.tgz", + "integrity": "sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==", + "requires": { + "encoding-down": "^6.3.0", + "levelup": "^4.3.2" + } + }, "level-supports": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", @@ -24936,6 +24694,28 @@ } } }, + "level-ws": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-2.0.0.tgz", + "integrity": "sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA==", + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^3.1.0", + "xtend": "^4.0.1" + } + }, + "levelup": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", + "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", + "requires": { + "deferred-leveldown": "~5.3.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~4.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, "leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -25955,9 +25735,9 @@ "dev": true }, "mcl-wasm": { - "version": "0.7.6", - "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.6.tgz", - "integrity": "sha512-cbRl3sUOkBeRY2hsM4t1EIln2TIdQBkSiTOqNTv/4Hu5KOECnMWCgjIf+a9Ebunyn22VKqkMF3zj6ejRzz7YBw==" + "version": "0.7.7", + "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.7.tgz", + "integrity": "sha512-jDGiCQA++5hX37gdH6RDZ3ZsA0raet7xyY/R5itj5cbcdf4Gvw+YyxWX/ZZ0Z2UPxJiw1ktRsCJZzpnqlQILdw==" }, "md5.js": { "version": "1.3.5", @@ -25991,6 +25771,38 @@ "p-is-promise": "^2.0.0" } }, + "memdown": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-5.1.0.tgz", + "integrity": "sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw==", + "requires": { + "abstract-leveldown": "~6.2.1", + "functional-red-black-tree": "~1.0.1", + "immediate": "~3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.2.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + } + } + }, "memoize-one": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.1.1.tgz", @@ -26320,6 +26132,20 @@ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true }, + "merkle-patricia-tree": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-4.2.0.tgz", + "integrity": "sha512-0sBVXs7z1Q1/kxzWZ3nPnxSPiaHKF/f497UQzt9O7isRcS10tel9jM/4TivF6Jv7V1yFq4bWyoATxbDUOen5vQ==", + "requires": { + "@types/levelup": "^4.3.0", + "ethereumjs-util": "^7.0.10", + "level-mem": "^5.0.1", + "level-ws": "^2.0.0", + "readable-stream": "^3.6.0", + "rlp": "^2.2.4", + "semaphore-async-await": "^1.5.1" + } + }, "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -43392,6 +43218,11 @@ "integrity": "sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM=", "dev": true }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + }, "y18n": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", diff --git a/package.json b/package.json index a8c367df3b..ea06c25301 100644 --- a/package.json +++ b/package.json @@ -133,7 +133,7 @@ "@ethereumjs/block": "^3.2.1", "@ethereumjs/common": "^2.2.0", "@ethereumjs/tx": "^3.1.3", - "@ethereumjs/vm": "^5.3.2", + "@ethereumjs/vm": "^5.4.1", "@remixproject/engine": "^0.3.17", "@remixproject/engine-web": "^0.3.17", "@remixproject/plugin": "^0.3.17", From 9c5fd73b080c668677c9341b4a7f2dcbcd2f4662 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 21 Jun 2021 13:00:26 +0200 Subject: [PATCH 49/67] update @ethereumjs version --- libs/remix-analyzer/package.json | 4 +- libs/remix-astwalker/package.json | 4 +- libs/remix-debug/package.json | 4 +- libs/remix-lib/package.json | 4 +- libs/remix-simulator/package.json | 4 +- libs/remix-solidity/package.json | 4 +- libs/remix-tests/package.json | 4 +- package-lock.json | 249 ++++-------------------------- package.json | 6 +- 9 files changed, 43 insertions(+), 240 deletions(-) diff --git a/libs/remix-analyzer/package.json b/libs/remix-analyzer/package.json index b5b53f9408..2e3aafc990 100644 --- a/libs/remix-analyzer/package.json +++ b/libs/remix-analyzer/package.json @@ -19,8 +19,8 @@ } ], "dependencies": { - "@ethereumjs/block": "^3.2.1", - "@ethereumjs/tx": "^3.1.3", + "@ethereumjs/block": "^3.3.0", + "@ethereumjs/tx": "^3.2.1", "@ethereumjs/vm": "^5.4.1", "@remix-project/remix-astwalker": "^0.0.26", "@remix-project/remix-lib": "^0.5.0", diff --git a/libs/remix-astwalker/package.json b/libs/remix-astwalker/package.json index 4f9b1f652e..1d4f0b68eb 100644 --- a/libs/remix-astwalker/package.json +++ b/libs/remix-astwalker/package.json @@ -34,8 +34,8 @@ ] }, "dependencies": { - "@ethereumjs/block": "^3.2.1", - "@ethereumjs/tx": "^3.1.3", + "@ethereumjs/block": "^3.3.0", + "@ethereumjs/tx": "^3.2.1", "@ethereumjs/vm": "^5.4.1", "@remix-project/remix-lib": "^0.5.0", "@types/tape": "^4.2.33", diff --git a/libs/remix-debug/package.json b/libs/remix-debug/package.json index 0e496c8d5a..2896f9667c 100644 --- a/libs/remix-debug/package.json +++ b/libs/remix-debug/package.json @@ -18,9 +18,9 @@ ], "main": "src/index.js", "dependencies": { - "@ethereumjs/block": "^3.2.1", + "@ethereumjs/block": "^3.3.0", "@ethereumjs/common": "^2.2.0", - "@ethereumjs/tx": "^3.1.3", + "@ethereumjs/tx": "^3.2.1", "@ethereumjs/vm": "^5.4.1", "@remix-project/remix-astwalker": "^0.0.26", "@remix-project/remix-lib": "^0.5.0", diff --git a/libs/remix-lib/package.json b/libs/remix-lib/package.json index 5905ef3fc0..3ba80fbefc 100644 --- a/libs/remix-lib/package.json +++ b/libs/remix-lib/package.json @@ -14,8 +14,8 @@ ], "main": "src/index.js", "dependencies": { - "@ethereumjs/block": "^3.2.1", - "@ethereumjs/tx": "^3.1.3", + "@ethereumjs/block": "^3.3.0", + "@ethereumjs/tx": "^3.2.1", "@ethereumjs/vm": "^5.4.1", "async": "^2.1.2", "ethereumjs-util": "^7.0.10", diff --git a/libs/remix-simulator/package.json b/libs/remix-simulator/package.json index 02a1e79bd4..d44fcd9c9f 100644 --- a/libs/remix-simulator/package.json +++ b/libs/remix-simulator/package.json @@ -14,9 +14,9 @@ ], "main": "src/index.js", "dependencies": { - "@ethereumjs/block": "^3.2.1", + "@ethereumjs/block": "^3.3.0", "@ethereumjs/common": "^2.2.0", - "@ethereumjs/tx": "^3.1.3", + "@ethereumjs/tx": "^3.2.1", "@ethereumjs/vm": "^5.4.1", "@remix-project/remix-lib": "^0.5.0", "ansi-gray": "^0.1.1", diff --git a/libs/remix-solidity/package.json b/libs/remix-solidity/package.json index d2c589b111..142bc2ee68 100644 --- a/libs/remix-solidity/package.json +++ b/libs/remix-solidity/package.json @@ -15,8 +15,8 @@ } ], "dependencies": { - "@ethereumjs/block": "^3.2.1", - "@ethereumjs/tx": "^3.1.3", + "@ethereumjs/block": "^3.3.0", + "@ethereumjs/tx": "^3.2.1", "@ethereumjs/vm": "^5.4.1", "@remix-project/remix-lib": "^0.5.0", "async": "^2.6.2", diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index 85c49ecba8..58ef31c564 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -35,9 +35,9 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-tests#readme", "dependencies": { - "@ethereumjs/block": "^3.2.1", + "@ethereumjs/block": "^3.3.0", "@ethereumjs/common": "^2.2.0", - "@ethereumjs/tx": "^3.1.3", + "@ethereumjs/tx": "^3.2.1", "@ethereumjs/vm": "^5.4.1", "@remix-project/remix-lib": "^0.5.0", "@remix-project/remix-simulator": "^0.2.0", diff --git a/package-lock.json b/package-lock.json index eedcc2ed2d..89edc2e43a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2527,204 +2527,24 @@ } }, "@ethereumjs/block": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.2.1.tgz", - "integrity": "sha512-FCxo5KwwULne2A2Yuae4iaGGqSsRjwzXOlDhGalOFiBbLfP3hE04RHaHGw4c8vh1PfOrLauwi0dQNUBkOG3zIA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.3.0.tgz", + "integrity": "sha512-WoefY9Rs4W8vZTxG9qwntAlV61xsSv0NPoXmHO7x3SH16dwJQtU15YvahPCz4HEEXbu7GgGgNgu0pv8JY7VauA==", "requires": { - "@ethereumjs/common": "^2.2.0", - "@ethereumjs/tx": "^3.1.3", + "@ethereumjs/common": "^2.3.0", + "@ethereumjs/tx": "^3.2.0", "ethereumjs-util": "^7.0.10", - "merkle-patricia-tree": "^4.1.0" + "merkle-patricia-tree": "^4.2.0" }, "dependencies": { - "@types/bn.js": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", - "integrity": "sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==", - "requires": { - "@types/node": "*" - } - }, - "abstract-leveldown": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", - "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - }, - "deferred-leveldown": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", - "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", - "requires": { - "abstract-leveldown": "~6.2.1", - "inherits": "^2.0.3" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - } - } - }, - "encoding-down": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", - "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", - "requires": { - "abstract-leveldown": "^6.2.1", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0" - } - }, - "ethereumjs-util": { - "version": "7.0.10", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.10.tgz", - "integrity": "sha512-c/xThw6A+EAnej5Xk5kOzFzyoSnw0WX0tSlZ6pAsfGVvQj3TItaDg9b1+Fz1RJXA+y2YksKwQnuzgt1eY6LKzw==", - "requires": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.4" - } - }, - "level-codec": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", - "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", - "requires": { - "buffer": "^5.6.0" - } - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", - "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.4.0", - "xtend": "^4.0.2" - } - }, - "level-mem": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-5.0.1.tgz", - "integrity": "sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg==", - "requires": { - "level-packager": "^5.0.3", - "memdown": "^5.0.0" - } - }, - "level-packager": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-5.1.1.tgz", - "integrity": "sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==", - "requires": { - "encoding-down": "^6.3.0", - "levelup": "^4.3.2" - } - }, - "level-ws": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-2.0.0.tgz", - "integrity": "sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA==", - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^3.1.0", - "xtend": "^4.0.1" - } - }, - "levelup": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", - "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", - "requires": { - "deferred-leveldown": "~5.3.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~4.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "memdown": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-5.1.0.tgz", - "integrity": "sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw==", - "requires": { - "abstract-leveldown": "~6.2.1", - "functional-red-black-tree": "~1.0.1", - "immediate": "~3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.2.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "immediate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" - } - } - }, - "merkle-patricia-tree": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-4.1.0.tgz", - "integrity": "sha512-vmP1J7FwIpprFMVjjSMM1JAwFce85Q+tp0TYIedYv8qaMh2oLUZ3ETXn9wbgi9S6elySzKzGa+Ai6VNKGEwSlg==", + "@ethereumjs/common": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.3.1.tgz", + "integrity": "sha512-V8hrULExoq0H4HFs3cCmdRGbgmipmlNzak6Xg34nHYfQyqkSdrCuflvYjyWmsNpI8GtrcZhzifAbgX/1C1Cjwg==", "requires": { - "@types/levelup": "^4.3.0", - "ethereumjs-util": "^7.0.8", - "level-mem": "^5.0.1", - "level-ws": "^2.0.0", - "readable-stream": "^3.6.0", - "rlp": "^2.2.3", - "semaphore-async-await": "^1.5.1" + "crc-32": "^1.2.0", + "ethereumjs-util": "^7.0.10" } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" } } }, @@ -2789,12 +2609,12 @@ } }, "@ethereumjs/common": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.2.0.tgz", - "integrity": "sha512-PyQiTG00MJtBRkJmv46ChZL8u2XWxNBeAthznAUIUiefxPAXjbkuiCZOuncgJS34/XkMbNc9zMt/PlgKRBElig==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.3.1.tgz", + "integrity": "sha512-V8hrULExoq0H4HFs3cCmdRGbgmipmlNzak6Xg34nHYfQyqkSdrCuflvYjyWmsNpI8GtrcZhzifAbgX/1C1Cjwg==", "requires": { "crc-32": "^1.2.0", - "ethereumjs-util": "^7.0.9" + "ethereumjs-util": "^7.0.10" } }, "@ethereumjs/ethash": { @@ -2819,38 +2639,21 @@ } }, "@ethereumjs/tx": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.1.3.tgz", - "integrity": "sha512-DJBu6cbwYtiPTFeCUR8DF5p+PF0jxs+0rALJZiEcTz2tiRPIEkM72GEbrkGuqzENLCzBrJHT43O0DxSYTqeo+g==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.2.1.tgz", + "integrity": "sha512-i9V39OtKvwWos1uVNZxdVhd7zFOyzFLjgt69CoiOY0EmXugS0HjO3uxpLBSglDKFMRriuGqw6ddKEv+RP1UNEw==", "requires": { - "@ethereumjs/common": "^2.2.0", + "@ethereumjs/common": "^2.3.1", "ethereumjs-util": "^7.0.10" }, "dependencies": { - "@types/bn.js": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", - "integrity": "sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==", - "requires": { - "@types/node": "*" - } - }, - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - }, - "ethereumjs-util": { - "version": "7.0.10", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.10.tgz", - "integrity": "sha512-c/xThw6A+EAnej5Xk5kOzFzyoSnw0WX0tSlZ6pAsfGVvQj3TItaDg9b1+Fz1RJXA+y2YksKwQnuzgt1eY6LKzw==", + "@ethereumjs/common": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.3.1.tgz", + "integrity": "sha512-V8hrULExoq0H4HFs3cCmdRGbgmipmlNzak6Xg34nHYfQyqkSdrCuflvYjyWmsNpI8GtrcZhzifAbgX/1C1Cjwg==", "requires": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.4" + "crc-32": "^1.2.0", + "ethereumjs-util": "^7.0.10" } } } diff --git a/package.json b/package.json index ea06c25301..8b46065d43 100644 --- a/package.json +++ b/package.json @@ -130,9 +130,9 @@ }, "dependencies": { "@erebos/bzz-node": "^0.13.0", - "@ethereumjs/block": "^3.2.1", - "@ethereumjs/common": "^2.2.0", - "@ethereumjs/tx": "^3.1.3", + "@ethereumjs/block": "^3.3.0", + "@ethereumjs/common": "^2.3.1", + "@ethereumjs/tx": "^3.2.1", "@ethereumjs/vm": "^5.4.1", "@remixproject/engine": "^0.3.17", "@remixproject/engine-web": "^0.3.17", From 9496a7306624c55bf3d5cd89752f6e1963cf64e2 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 21 Jun 2021 13:31:02 +0200 Subject: [PATCH 50/67] use maxPriorityFeePerGas and maxFeePerGas --- libs/remix-lib/src/execution/txRunnerVM.ts | 32 ++++++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/libs/remix-lib/src/execution/txRunnerVM.ts b/libs/remix-lib/src/execution/txRunnerVM.ts index f99636b1fe..2ce5e47b15 100644 --- a/libs/remix-lib/src/execution/txRunnerVM.ts +++ b/libs/remix-lib/src/execution/txRunnerVM.ts @@ -1,5 +1,5 @@ 'use strict' -import { Transaction } from '@ethereumjs/tx' +import { Transaction, FeeMarketEIP1559Transaction } from '@ethereumjs/tx' import { Block } from '@ethereumjs/block' import { BN, bufferToHex, Address } from 'ethereumjs-util' import { EventManager } from '../eventManager' @@ -71,14 +71,28 @@ export class TxRunnerVM { } } } - const tx = Transaction.fromTxData({ - nonce: new BN(res.nonce), - gasPrice: '0x1', - gasLimit: gasLimit, - to: to, - value: value, - data: Buffer.from(data.slice(2), 'hex') - }, { common: this.commonContext }).sign(account.privateKey) + + let tx + if (this.commonContext.hardfork === 'berlin' || this.commonContext.hardfork === 'muirglacier') { + tx = Transaction.fromTxData({ + nonce: new BN(res.nonce), + gasPrice: '0x1', + gasLimit: gasLimit, + to: to, + value: value, + data: Buffer.from(data.slice(2), 'hex') + }, { common: this.commonContext }).sign(account.privateKey) + } else { + tx = FeeMarketEIP1559Transaction.fromTxData({ + nonce: new BN(res.nonce), + maxPriorityFeePerGas: '0x01', + maxFeePerGas: '0x1', + gasLimit: gasLimit, + to: to, + value: value, + data: Buffer.from(data.slice(2), 'hex') + }).sign(account.privateKey) + } const coinbases = ['0x0e9281e9c6a0808672eaba6bd1220e144c9bb07a', '0x8945a1288dc78a6d8952a92c77aee6730b414778', '0x94d76e24f818426ae84aa404140e8d5f60e10e7e'] const difficulties = [new BN('69762765929000', 10), new BN('70762765929000', 10), new BN('71762765929000', 10)] From a3bc997d734aeb2e0358b5d1d044811122d410f1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 21 Jun 2021 14:47:56 +0200 Subject: [PATCH 51/67] remove muirglacier & ensure 1559 tx are used --- apps/remix-ide/src/app/tabs/runTab/settings.js | 4 ---- libs/remix-lib/src/execution/txRunnerVM.ts | 6 ++++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/runTab/settings.js b/apps/remix-ide/src/app/tabs/runTab/settings.js index 55916cdf0d..f99a2bc461 100644 --- a/apps/remix-ide/src/app/tabs/runTab/settings.js +++ b/apps/remix-ide/src/app/tabs/runTab/settings.js @@ -102,10 +102,6 @@ class SettingsUI { title="Execution environment does not connect to any node, everything is local and in memory only." value="vm-berlin" name="executionContext" fork="berlin" > JavaScript VM (Berlin) -