diff --git a/.env b/.env deleted file mode 100644 index 8db17993d7..0000000000 --- a/.env +++ /dev/null @@ -1,4 +0,0 @@ -gist_token= -account_passphrase= -account_password= -NODE_OPTIONS=--max-old-space-size=2048 \ No newline at end of file diff --git a/apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts b/apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts index 0a759aa332..ec513b9831 100644 --- a/apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts +++ b/apps/remix-ide-e2e/src/tests/libraryDeployment.test.ts @@ -77,6 +77,7 @@ function checkDeployShouldFail (browser: NightwatchBrowser, callback: VoidFuncti .clickLaunchIcon('udapp') .selectContract('test') // deploy lib .createContract('') + .pause(60000) .getText('div[class^="terminal"]', (value) => { console.log('value: ', value) }) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts index bd9eb57f26..9b01adeaf5 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts @@ -158,6 +158,8 @@ module.exports = { .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') // eslint-disable-next-line dot-notation .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_new' }) + .pause(5000) + .waitForElementPresent('*[data-id="workspacesModalDialogModalDialogModalFooter-react"] .modal-ok') .click('*[data-id="workspacesModalDialogModalDialogModalFooter-react"] .modal-ok') .click('*[data-id="workspacesSelect"] option[value="workspace_new"]') // end of creating @@ -184,6 +186,29 @@ module.exports = { .waitForElementContainsText('#solidityUnittestsOutput', '✓ Check winnin proposal with return value', 60000) }, + 'Solidity Unit tests with hardhat console log': function (browser: NightwatchBrowser) { + browser + .waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') + .addFile('tests/hhLogs_test.sol', sources[0]['tests/hhLogs_test.sol']) + .clickLaunchIcon('solidityUnitTesting') + .waitForElementVisible('*[id="singleTesttests/4_Ballot_test.sol"]', 60000) + .click('*[id="singleTesttests/4_Ballot_test.sol"]') + .click('#runTestsTabRunAction') + .pause(2000) + .waitForElementVisible('*[data-id="testTabSolidityUnitTestsOutputheader"]', 120000) + .waitForElementPresent('#solidityUnittestsOutput div[class^="testPass"]', 60000) + .waitForElementContainsText('#solidityUnittestsOutput', 'tests/hhLogs_test.sol', 60000) + .assert.containsText('#journal > div:nth-child(2) > span ', 'Before all:') + .assert.containsText('#journal > div:nth-child(2) > span', 'Inside beforeAll') + .assert.containsText('#journal > div:nth-child(3) > span', 'Check sender:') + .assert.containsText('#journal > div:nth-child(3) > span', 'msg.sender is 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4') + .assert.containsText('#journal > div:nth-child(4) > span', 'Check int logs:') + .assert.containsText('#journal > div:nth-child(4) > span', '10 20') + .assert.containsText('#journal > div:nth-child(4) > span', 'Number is 25') + .openFile('tests/hhLogs_test.sol') + .removeFile('tests/hhLogs_test.sol', 'workspace_new') + }, + 'Debug failed test using debugger': function (browser: NightwatchBrowser) { browser .waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') @@ -460,6 +485,31 @@ const sources = [ return ballotToTest.winningProposal() == 0; } }` + }, + 'tests/hhLogs_test.sol': { + content: `// SPDX-License-Identifier: GPL-3.0 + + pragma solidity >=0.7.0 <0.9.0; + import "remix_tests.sol"; // this import is automatically injected by Remix. + import "hardhat/console.sol"; + + contract hhLogs { + + function beforeAll () public { + console.log('Inside beforeAll'); + } + + function checkSender () public { + console.log('msg.sender is %s', msg.sender); + Assert.ok(true, "should be true"); + } + + function checkIntLogs () public { + console.log(10,20); + console.log('Number is %d', 25); + Assert.ok(true, "should be true"); + } + }` } } ] diff --git a/apps/remix-ide/src/app/files/fileManager.js b/apps/remix-ide/src/app/files/fileManager.js index 3164390cfe..00f0f701a7 100644 --- a/apps/remix-ide/src/app/files/fileManager.js +++ b/apps/remix-ide/src/app/files/fileManager.js @@ -22,7 +22,7 @@ const profile = { icon: 'assets/img/fileManager.webp', permission: true, version: packageJson.version, - methods: ['closeAllFiles', 'closeFile', 'file', 'exists', 'open', 'writeFile', 'readFile', 'copyFile', 'copyDir', 'rename', 'mkdir', 'readdir', 'remove', 'getCurrentFile', 'getFile', 'getFolder', 'setFile', 'switchFile', 'refresh', 'getProviderOf', 'getProviderByName', 'getPathFromUrl', 'getUrlFromPath'], + methods: ['closeAllFiles', 'closeFile', 'file', 'exists', 'open', 'writeFile', 'readFile', 'copyFile', 'copyDir', 'rename', 'mkdir', 'readdir', 'remove', 'getCurrentFile', 'getFile', 'getFolder', 'setFile', 'switchFile', 'refresh', 'getProviderOf', 'getProviderByName', 'getPathFromUrl', 'getUrlFromPath', 'saveCurrentFile'], kind: 'file-system' } const errorMsg = { diff --git a/apps/remix-ide/src/app/tabs/compile-tab.js b/apps/remix-ide/src/app/tabs/compile-tab.js index 42c2f6d11c..baecfc8e6e 100644 --- a/apps/remix-ide/src/app/tabs/compile-tab.js +++ b/apps/remix-ide/src/app/tabs/compile-tab.js @@ -139,7 +139,7 @@ class CompileTab extends CompilerApiMixin(ViewPlugin) { // implements ICompilerA } getAppParameter (name) { - // first look in the URL params then in the local storPage + // first look in the URL params then in the local storage const params = this.queryParams.get() const param = params[name] ? params[name] : this.config.get(name) if (param === 'true') return true diff --git a/libs/remix-lib/src/index.ts b/libs/remix-lib/src/index.ts index 5295649938..1ba94fdd21 100644 --- a/libs/remix-lib/src/index.ts +++ b/libs/remix-lib/src/index.ts @@ -18,7 +18,6 @@ import * as typeConversion from './execution/typeConversion' import { TxRunnerVM } from './execution/txRunnerVM' import { TxRunnerWeb3 } from './execution/txRunnerWeb3' import * as txResultHelper from './helpers/txResultHelper' - export { ICompilerApi, ConfigurationSettings } from './types/ICompilerApi' const helpers = { diff --git a/libs/remix-lib/src/types/ICompilerApi.ts b/libs/remix-lib/src/types/ICompilerApi.ts index 56e9f6a9ad..210ac72099 100644 --- a/libs/remix-lib/src/types/ICompilerApi.ts +++ b/libs/remix-lib/src/types/ICompilerApi.ts @@ -50,5 +50,8 @@ export interface ConfigurationSettings { language: string, optimize: boolean, runs: string +<<<<<<< HEAD +======= +>>>>>>> 0e36c001f098047cf4fec47ae9611d1e4e4a8355 } diff --git a/libs/remix-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx b/libs/remix-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx index 44ba3de3c2..c8b4f8fbcd 100644 --- a/libs/remix-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx +++ b/libs/remix-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx @@ -5,7 +5,7 @@ import { Toaster } from '@remix-ui/toaster' import { IframePlugin, WebsocketPlugin } from '@remixproject/engine-web' import { localPluginReducerActionType, localPluginToastReducer } from '../reducers/pluginManagerReducer' -import { FormStateProps, PluginManagerComponent } from '../../types' +import { canActivate, FormStateProps, PluginManagerComponent } from '../../types' interface LocalPluginFormProps { closeModal: () => void diff --git a/libs/remix-ui/solidity-compiler/src/lib/types/index.ts b/libs/remix-ui/solidity-compiler/src/lib/types/index.ts index 5c33ffec17..4932b1456c 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/types/index.ts +++ b/libs/remix-ui/solidity-compiler/src/lib/types/index.ts @@ -23,5 +23,4 @@ export interface ContractSelectionProps { } | Record, modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, contractsDetails: Record - } diff --git a/libs/remix-ui/terminal/src/lib/reducers/terminalReducer.ts b/libs/remix-ui/terminal/src/lib/reducers/terminalReducer.ts index 58666b76df..da6fe4378c 100644 --- a/libs/remix-ui/terminal/src/lib/reducers/terminalReducer.ts +++ b/libs/remix-ui/terminal/src/lib/reducers/terminalReducer.ts @@ -139,9 +139,12 @@ export const remixWelcomeTextReducer = (state, action) => { } export const registerScriptRunnerReducer = (state, action) => { - const result = Object.assign([], action.payload.message) - console.log({ result }) switch (action.type) { + case 'html': + return { + ...state, + journalBlocks: initialState.journalBlocks.push({ message: action.payload.message, style: 'text-log' }) + } case 'log': return { ...state, diff --git a/nx.json b/nx.json index e063294259..2173f95aff 100644 --- a/nx.json +++ b/nx.json @@ -122,6 +122,12 @@ "tags": [] }, "remix-ui-terminal": { +<<<<<<< HEAD +======= + "tags": [] + }, + "solidity-compiler": { +>>>>>>> 0e36c001f098047cf4fec47ae9611d1e4e4a8355 "tags": [] }, "solidity-compiler": { diff --git a/tsconfig.base.json b/tsconfig.base.json index 9ea326c5c3..c13d1c3553 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -43,9 +43,9 @@ "@remix-project/core-plugin": ["libs/remix-core-plugin/src/index.ts"], "@remix-ui/solidity-compiler": ["libs/remix-ui/solidity-compiler/src/index.ts"], "@remix-ui/publish-to-storage": ["libs/remix-ui/publish-to-storage/src/index.ts"], - "@remix-ui/plugin-manager": ["libs/remix-ui/plugin-manager/src/index.ts"], "@remix-ui/renderer": ["libs/remix-ui/renderer/src/index.ts"], - "@remix-ui/terminal": ["libs/remix-ui/terminal/src/index.ts"] + "@remix-ui/terminal": ["libs/remix-ui/terminal/src/index.ts"], + "@remix-ui/plugin-manager": ["libs/remix-ui/plugin-manager/src/index.ts"], } }, "exclude": ["node_modules", "tmp"] diff --git a/tsconfig.json b/tsconfig.json index 6204014228..0eb7a675f5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,8 +14,7 @@ "skipLibCheck": true, "skipDefaultLibCheck": true, "baseUrl": ".", - "paths": {}, - "allowSyntheticDefaultImports": true + "paths": {} }, "exclude": ["node_modules", "tmp"] } diff --git a/{ b/{ deleted file mode 100644 index e69de29bb2..0000000000