From 15696e6871735096984ddc6a16f0f1c7b753e829 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 31 May 2021 15:44:12 +0200 Subject: [PATCH 1/3] await for workspace creation (#1236) fix https://github.com/ethereum/remix-project/issues/1235 --- libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 0e05ee6765..c844986a40 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -53,13 +53,13 @@ export const Workspace = (props: WorkspaceProps) => { return setWorkspace(workspaceName) } - props.request.createNewFile = () => { - if (!state.workspaces.length) createNewWorkspace('default_workspace') + props.request.createNewFile = async () => { + if (!state.workspaces.length) await createNewWorkspace('default_workspace') props.plugin.resetNewFile() } - props.request.uploadFile = (target) => { - if (!state.workspaces.length) createNewWorkspace('default_workspace') + props.request.uploadFile = async (target) => { + if (!state.workspaces.length) await createNewWorkspace('default_workspace') setState(prevState => { return { ...prevState, uploadFileEvent: target } From f974fcf823a6852c232ddc1e3357c722bb4d246e Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 31 May 2021 17:32:31 +0200 Subject: [PATCH 2/3] e2e debug nodes (#1237) fix https://github.com/ethereum/remix-project/issues/1231 --- apps/remix-ide-e2e/src/tests/debugger.spec.ts | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/apps/remix-ide-e2e/src/tests/debugger.spec.ts b/apps/remix-ide-e2e/src/tests/debugger.spec.ts index b43b94559b..6365793479 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.spec.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.spec.ts @@ -207,6 +207,25 @@ module.exports = { As we are only testing if debugger is active, this is ok to keep that for now. */ .waitForElementContainsText('*[data-id="stepdetail"]', 'vm trace step:\n154', 60000) + }, + + 'Should start debugging using remix debug nodes (rinkeby)': function (browser: NightwatchBrowser) { + browser.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"]') + .setValue('*[data-id="modalDialogCustomPromptText"]', 'https://remix-rinkeby.ethdevops.io') + .modalFooterOKClick() + .waitForElementPresent('*[title="Deploy - transact (not payable)"]', 65000) // wait for the compilation to succeed + .clickLaunchIcon('debugger') + .clearValue('*[data-id="debuggerTransactionInput"]') + .setValue('*[data-id="debuggerTransactionInput"]', '0x156dbf7d0f9b435dd900cfc8f3264d523dd25733418ddbea1ce53e294f421013') + .click('*[data-id="debugGeneratedSourcesLabel"]') // unselect debug with generated sources + .click('*[data-id="debuggerTransactionStartButton"]') + .waitForElementVisible('*[data-id="solidityLocals"]', 60000) + .pause(10000) + .checkVariableDebug('soliditylocals', { num: { value: '2', type: 'uint256' } }) + .checkVariableDebug('soliditystate', { number: { value: '0', type: 'uint256', constant: false } }) .end() } } @@ -297,6 +316,40 @@ const sources = [ } ` } + }, + { + 'useDebugNodes.sol': { + content: ` + // SPDX-License-Identifier: GPL-3.0 + + pragma solidity >=0.7.0 <0.9.0; + + /** + * @title Storage + * @dev Store & retrieve value in a variable + */ + contract Storage { + + uint256 number; + + /** + * @dev Store value in variable + * @param num value to store + */ + function store(uint256 num) public { + number = num; + } + + /** + * @dev Return value + * @return value of 'number' + */ + function retrieve() public view returns (uint256){ + return number; + } + } + ` + } } ] From db93a7f570476b1b4ae9bc68c637a4a14b16203c Mon Sep 17 00:00:00 2001 From: filip mertens Date: Tue, 1 Jun 2021 15:45:19 +0200 Subject: [PATCH 3/3] add dgit to required --- apps/remix-ide/src/remixAppManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index a483143ba3..26f684e432 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -9,7 +9,7 @@ const _paq = window._paq = window._paq || [] const requiredModules = [ // services + layout views + system views 'manager', 'compilerArtefacts', 'compilerMetadata', 'contextualListener', 'editor', 'offsetToLineColumnConverter', 'network', 'theme', 'fileManager', 'contentImport', 'web3Provider', 'scriptRunner', 'fetchAndCompile', 'mainPanel', 'hiddenPanel', 'sidePanel', 'menuicons', - 'filePanel', 'terminal', 'settings', 'pluginManager', 'tabs', 'udapp'] + 'filePanel', 'terminal', 'settings', 'pluginManager', 'tabs', 'udapp', 'dGitProvider'] const dependentModules = ['git', 'hardhat'] // module which shouldn't be manually activated (e.g git is activated by remixd)