diff --git a/.circleci/config.yml b/.circleci/config.yml
index bde004212a..e2f5431ee1 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -238,8 +238,8 @@ jobs:
steps:
- checkout
- run: npm install
- - run: npx nx build remix-ide --with-deps
- run: npm run downloadsolc_assets
+ - run: npx nx build remix-ide --with-deps
- run:
name: Deploy
command: |
@@ -267,6 +267,7 @@ jobs:
- checkout
- setup_remote_docker
- run: npm install
+ - run: npm run downloadsolc_assets
- run: npx nx build remix-ide --with-deps
- run: ./apps/remix-ide/ci/copy_resources.sh
- run: ./apps/remix-ide/ci/publishIpfs
@@ -291,8 +292,8 @@ jobs:
steps:
- checkout
- run: npm install
- - run: npx nx build remix-ide --with-deps
- run: npm run downloadsolc_assets
+ - run: npx nx build remix-ide --with-deps
- run:
name: Deploy
command: |
@@ -320,8 +321,8 @@ jobs:
- checkout
- run: npm install
- run: npm run build:libs
- - run: npm run build
- run: npm run downloadsolc_assets
+ - run: npm run build
- run:
name: Deploy
command: |
diff --git a/apps/remix-ide-e2e/src/helpers/init.ts b/apps/remix-ide-e2e/src/helpers/init.ts
index 8782c7a44b..484645b391 100644
--- a/apps/remix-ide-e2e/src/helpers/init.ts
+++ b/apps/remix-ide-e2e/src/helpers/init.ts
@@ -2,18 +2,11 @@ import { NightwatchBrowser } from 'nightwatch'
require('dotenv').config()
-export default function (browser: NightwatchBrowser, callback: VoidFunction, url?: string, preloadPlugins = true, closeWorkspaceAlert = true): void {
+export default function (browser: NightwatchBrowser, callback: VoidFunction, url?: string, preloadPlugins = true): void {
browser
.url(url || 'http://127.0.0.1:8080')
.pause(5000)
.switchBrowserTab(0)
- .perform((done) => {
- if (closeWorkspaceAlert) {
- browser.waitForElementVisible('*[data-id="modalDialogModalBody"]', 60000)
- .modalFooterOKClick()
- }
- done()
- })
.fullscreenWindow(() => {
if (preloadPlugins) {
initModules(browser, () => {
diff --git a/apps/remix-ide-e2e/src/tests/ballot.test.ts b/apps/remix-ide-e2e/src/tests/ballot.test.ts
index 09ec283572..b44b17746e 100644
--- a/apps/remix-ide-e2e/src/tests/ballot.test.ts
+++ b/apps/remix-ide-e2e/src/tests/ballot.test.ts
@@ -49,7 +49,7 @@ module.exports = {
'Debug Ballot / delegate': function (browser: NightwatchBrowser) {
browser.pause(500)
- .click('*[data-id="txLoggerDebugButton0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3"]')
+ .click('*[data-id="txLoggerDebugButton0xf88bc0ac0761f78d8c883b32550c68dadcdb095595c30e1a1b7c583e5e958dcb"]')
.waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]')
.click('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]')
.pause(2000)
diff --git a/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts b/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts
index 04439e0185..a3bf500ec0 100644
--- a/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts
+++ b/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts
@@ -45,7 +45,7 @@ module.exports = {
'Debug Ballot / delegate': function (browser: NightwatchBrowser) {
browser.pause(500)
- .click('*[data-id="txLoggerDebugButton0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3"]')
+ .click('*[data-id="txLoggerDebugButton0xf88bc0ac0761f78d8c883b32550c68dadcdb095595c30e1a1b7c583e5e958dcb"]')
.pause(2000)
.waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]')
.click('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]')
diff --git a/apps/remix-ide-e2e/src/tests/debugger.spec.ts b/apps/remix-ide-e2e/src/tests/debugger.spec.ts
index 6365793479..d6b1cb2743 100644
--- a/apps/remix-ide-e2e/src/tests/debugger.spec.ts
+++ b/apps/remix-ide-e2e/src/tests/debugger.spec.ts
@@ -420,7 +420,7 @@ const localVariable_step717_ABIEncoder = { // eslint-disable-line
const jsGetTrace = `(async () => {
try {
- const result = await remix.call('debugger', 'getTrace', '0xbf309c0d71579d595f04a42e89d66d1ec17523dd3edea710b03f46a9b82ee0af')
+ const result = await remix.call('debugger', 'getTrace', '0xa38bff6f06e7c4fc91df1db6aa31a69ab5d5882faa953b1e7a88bfa523268ed7')
console.log('result ', result)
} catch (e) {
console.log(e.message)
@@ -429,7 +429,7 @@ const jsGetTrace = `(async () => {
const jsDebug = `(async () => {
try {
- const result = await remix.call('debugger', 'debug', '0xbf309c0d71579d595f04a42e89d66d1ec17523dd3edea710b03f46a9b82ee0af')
+ const result = await remix.call('debugger', 'debug', '0xa38bff6f06e7c4fc91df1db6aa31a69ab5d5882faa953b1e7a88bfa523268ed7')
console.log('result ', result)
} catch (e) {
console.log(e.message)
diff --git a/apps/remix-ide-e2e/src/tests/gist.spec.ts b/apps/remix-ide-e2e/src/tests/gist.spec.ts
index 214aacae47..a46dba097f 100644
--- a/apps/remix-ide-e2e/src/tests/gist.spec.ts
+++ b/apps/remix-ide-e2e/src/tests/gist.spec.ts
@@ -54,8 +54,8 @@ module.exports = {
.click('[data-id="default_workspace-modal-footer-cancel-react"]')
.executeScript(`remix.loadgist('${gistid}')`)
// .perform((done) => { if (runtimeBrowser === 'chrome') { browser.openFile('gists') } done() })
- .waitForElementVisible(`[data-id="treeViewLitreeViewItem/gist-${gistid}"]`)
- .click(`[data-id="treeViewLitreeViewItem/gist-${gistid}"]`)
+ .waitForElementVisible(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`)
+ .click(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`)
.openFile(`gist-${gistid}/README.txt`)
}
})
diff --git a/apps/remix-ide-e2e/src/tests/url.spec.ts b/apps/remix-ide-e2e/src/tests/url.spec.ts
index 40a52bd073..c1714b01bf 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, false)
+ 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)
},
'@sources': function () {
diff --git a/apps/remix-ide/src/app/panels/file-panel.js b/apps/remix-ide/src/app/panels/file-panel.js
index 57d42f02a8..e8e3617ce8 100644
--- a/apps/remix-ide/src/app/panels/file-panel.js
+++ b/apps/remix-ide/src/app/panels/file-panel.js
@@ -166,12 +166,26 @@ module.exports = class Filepanel extends ViewPlugin {
return
}
// insert example contracts if there are no files to show
- this._deps.fileProviders.browser.resolveDirectory('/', async (error, filesList) => {
- if (error) console.error(error)
- if (Object.keys(filesList).length === 0) {
- await this.createWorkspace('default_workspace')
- }
- this.getWorkspaces()
+ return new Promise((resolve, reject) => {
+ this._deps.fileProviders.browser.resolveDirectory('/', async (error, filesList) => {
+ if (error) return reject(error)
+ if (Object.keys(filesList).length === 0) {
+ await this.createWorkspace('default_workspace')
+ resolve('default_workspace')
+ } else {
+ this._deps.fileProviders.browser.resolveDirectory('.workspaces', async (error, filesList) => {
+ if (error) return reject(error)
+ if (Object.keys(filesList).length > 0) {
+ const workspacePath = Object.keys(filesList)[0].split('/').filter(val => val)
+ const workspaceName = workspacePath[workspacePath.length - 1]
+
+ this._deps.fileProviders.workspace.setWorkspace(workspaceName)
+ return resolve(workspaceName)
+ }
+ return reject(new Error('Can\'t find available workspace.'))
+ })
+ }
+ })
})
}
@@ -213,13 +227,11 @@ module.exports = class Filepanel extends ViewPlugin {
await this.request.setWorkspace(workspaceName) // tells the react component to switch to that workspace
if (setDefaults) {
for (const file in examples) {
- setTimeout(async () => { // space creation of files to give react ui time to update.
- try {
- await workspaceProvider.set(examples[file].name, examples[file].content)
- } catch (error) {
- console.error(error)
- }
- }, 10)
+ try {
+ await workspaceProvider.set(examples[file].name, examples[file].content)
+ } catch (error) {
+ console.error(error)
+ }
}
}
}
diff --git a/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js b/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js
index 6c09d0586e..dfb0cfc5a4 100644
--- a/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js
+++ b/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js
@@ -170,6 +170,7 @@ class CompilerContainer {
_retrieveVersion (version) {
if (!version) version = this._view.versionSelector.value
+ if (version === 'builtin') version = this.data.defaultVersion
return semver.coerce(version) ? semver.coerce(version).version : ''
}
@@ -487,7 +488,7 @@ class CompilerContainer {
this._view.versionSelector.appendChild(option)
}
})
- if (semver.lt(this._retrieveVersion(), 'v0.4.12+commit.194ff033.js')) {
+ if (this.data.selectedVersion !== 'builtin' && semver.lt(this._retrieveVersion(), 'v0.4.12+commit.194ff033.js')) {
toaster(yo`
Old compiler usage detected.
@@ -500,7 +501,7 @@ class CompilerContainer {
// Workers cannot load js on "file:"-URLs and we get a
// "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium,
// resort to non-worker version in that case.
- if (this.data.selectedVersion !== 'builtin' && canUseWorker(this.data.selectedVersion)) {
+ if (canUseWorker(this._retrieveVersion())) {
this.compileTabLogic.compiler.loadVersion(true, url)
this.setVersionText('(loading using worker)')
} else {
diff --git a/libs/remix-debug/src/solidity-decoder/astHelper.ts b/libs/remix-debug/src/solidity-decoder/astHelper.ts
index abf2a3c16a..d3ecfa0c16 100644
--- a/libs/remix-debug/src/solidity-decoder/astHelper.ts
+++ b/libs/remix-debug/src/solidity-decoder/astHelper.ts
@@ -26,6 +26,27 @@ export function extractContractDefinitions (sourcesList) {
return ret
}
+/**
+ * return nodes from an ast @arg sourcesList that are declared outside of a ContractDefinition @astList
+ *
+ * @param {Object} sourcesList - sources list (containing root AST node)
+ * @return {Object} - returns a list of node
+ */
+export function extractOrphanDefinitions (sourcesList) {
+ const ret = []
+ for (const k in sourcesList) {
+ const ast = sourcesList[k].ast
+ if (ast.nodes && ast.nodes.length) {
+ for (const node of ast.nodes) {
+ if (node.nodeType !== 'ContractDefinition') {
+ ret.push(node)
+ }
+ }
+ }
+ }
+ return ret
+}
+
/**
* returns the linearized base contracts of the contract @arg id
*
@@ -54,7 +75,7 @@ export function extractStateDefinitions (contractName, sourcesList, contracts) {
if (!node) {
return null
}
- const stateItems = []
+ const stateItems = extractOrphanDefinitions(sourcesList)
const stateVar = []
const baseContracts = getLinearizedBaseContracts(node.id, contracts.contractsById)
baseContracts.reverse()
diff --git a/libs/remix-debug/src/solidity-decoder/decodeInfo.ts b/libs/remix-debug/src/solidity-decoder/decodeInfo.ts
index ec5b31706d..5384b1af86 100644
--- a/libs/remix-debug/src/solidity-decoder/decodeInfo.ts
+++ b/libs/remix-debug/src/solidity-decoder/decodeInfo.ts
@@ -233,11 +233,11 @@ function getEnum (type, stateDefinitions, contractName) {
* @return {Array} containing all members of the current struct type
*/
function getStructMembers (type, stateDefinitions, contractName, location) {
- const split = type.split('.')
- if (!split.length) {
+ if (type.indexOf('.') === -1) {
type = contractName + '.' + type
- } else {
- contractName = split[0]
+ }
+ if (!contractName) {
+ contractName = type.split('.')[0]
}
const state = stateDefinitions[contractName]
if (state) {
diff --git a/libs/remix-simulator/src/methods/transactions.ts b/libs/remix-simulator/src/methods/transactions.ts
index c3a43f5bc4..2ea3d11d54 100644
--- a/libs/remix-simulator/src/methods/transactions.ts
+++ b/libs/remix-simulator/src/methods/transactions.ts
@@ -113,7 +113,7 @@ export class Transactions {
}
eth_estimateGas (payload, cb) {
- cb(null, 3000000)
+ cb(null, 10000000 * 8)
}
eth_getCode (payload, cb) {
diff --git a/libs/remix-simulator/src/vm-context.ts b/libs/remix-simulator/src/vm-context.ts
index a72be89d1e..a6406b2391 100644
--- a/libs/remix-simulator/src/vm-context.ts
+++ b/libs/remix-simulator/src/vm-context.ts
@@ -122,7 +122,8 @@ export class VMContext {
const vm = new VM({
common,
activatePrecompiles: true,
- stateManager: stateManager
+ stateManager: stateManager,
+ allowUnlimitedContractSize: true
})
const web3vm = new remixLibVm.Web3VMProvider()
diff --git a/libs/remix-tests/src/deployer.ts b/libs/remix-tests/src/deployer.ts
index 1e3fcb8d88..aeefac3faa 100644
--- a/libs/remix-tests/src/deployer.ts
+++ b/libs/remix-tests/src/deployer.ts
@@ -110,7 +110,7 @@ export function deployAll (compileResult: compilationInterface, web3: Web3, with
const params = '' // we suppose that the test contract does not have any param in the constructor
execution.txFormat.encodeConstructorCallAndDeployLibraries(contractName, contract.raw, compileResult, params, funAbi, encodeDataFinalCallback, encodeDataStepCallback, encodeDataDeployLibraryCallback)
}, function (err) {
- if (err) next(err)
+ if (err) return next(err)
next(null, contracts)
})
}
diff --git a/libs/remix-tests/src/runTestFiles.ts b/libs/remix-tests/src/runTestFiles.ts
index 6bde83e44e..b447452f22 100644
--- a/libs/remix-tests/src/runTestFiles.ts
+++ b/libs/remix-tests/src/runTestFiles.ts
@@ -63,9 +63,16 @@ export function runTestFiles (filepath: string, isDirectory: boolean, web3: Web3
}
deployAll(compilationResult, web3, false, (err, contracts) => {
if (err) {
- next(err)
- }
- next(null, compilationResult, contracts)
+ // If contract deployment fails because of 'Out of Gas' error, try again with double gas
+ // This is temporary, should be removed when remix-tests will have a dedicated UI to
+ // accept deployment params from UI
+ if (err.message.includes('The contract code couldn\'t be stored, please check your gas limit')) {
+ deployAll(compilationResult, web3, true, (error, contracts) => {
+ if (error) next([{ message: 'contract deployment failed after trying twice: ' + error.message, severity: 'error' }]) // IDE expects errors in array
+ else next(null, compilationResult, contracts)
+ })
+ } else { next([{ message: 'contract deployment failed: ' + err.message, severity: 'error' }]) } // IDE expects errors in array
+ } else { next(null, compilationResult, contracts) }
})
},
function determineTestContractsToRun (compilationResult: compilationInterface, contracts: any, next) {
diff --git a/libs/remix-tests/src/testRunner.ts b/libs/remix-tests/src/testRunner.ts
index d64398b390..66efa143fe 100644
--- a/libs/remix-tests/src/testRunner.ts
+++ b/libs/remix-tests/src/testRunner.ts
@@ -238,7 +238,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
sender = opts.accounts[sender]
}
}
- let sendParams: Record
| null = null
+ let sendParams: Record | null = null
if (sender) sendParams = { from: sender }
if (func.inputs && func.inputs.length > 0) { return resultsCallback(new Error(`Method '${func.name}' can not have parameters inside a test contract`), { passingNum, failureNum, timePassed }) }
const method = testObject.methods[func.name].apply(testObject.methods[func.name], [])
@@ -280,6 +280,8 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
else sendParams = { value }
}
}
+ if (!sendParams) sendParams = {}
+ sendParams.gas = 10000000 * 8
method.send(sendParams).on('receipt', (receipt) => {
try {
const time: number = (Date.now() - startTime) / 1000.0
diff --git a/libs/remix-ui/file-explorer/src/lib/actions/fileSystem.ts b/libs/remix-ui/file-explorer/src/lib/actions/fileSystem.ts
index 3ddc315af2..8813d610e1 100644
--- a/libs/remix-ui/file-explorer/src/lib/actions/fileSystem.ts
+++ b/libs/remix-ui/file-explorer/src/lib/actions/fileSystem.ts
@@ -2,6 +2,12 @@ import React from 'react'
import { File } from '../types'
import { extractNameFromKey, extractParentFromKey } from '../utils'
+const queuedEvents = []
+const pendingEvents = {}
+let provider = null
+let plugin = null
+let dispatch: React.Dispatch = null
+
export const fetchDirectoryError = (error: any) => {
return {
type: 'FETCH_DIRECTORY_ERROR',
@@ -183,35 +189,25 @@ export const fileRenamedSuccess = (path: string, removePath: string, files) => {
}
}
-export const init = (provider, workspaceName: string, plugin, registry) => (dispatch: React.Dispatch) => {
+export const init = (fileProvider, filePanel, registry) => (reducerDispatch: React.Dispatch) => {
+ provider = fileProvider
+ plugin = filePanel
+ dispatch = reducerDispatch
if (provider) {
provider.event.on('fileAdded', async (filePath) => {
- if (extractParentFromKey(filePath) === '/.workspaces') return
- const path = extractParentFromKey(filePath) || provider.workspace || provider.type || ''
- const data = await fetchDirectoryContent(provider, path)
-
- dispatch(fileAddedSuccess(path, data))
- if (filePath.includes('_test.sol')) {
- plugin.emit('newTestFileCreated', filePath)
- }
+ await executeEvent('fileAdded', filePath)
})
provider.event.on('folderAdded', async (folderPath) => {
- if (extractParentFromKey(folderPath) === '/.workspaces') return
- const path = extractParentFromKey(folderPath) || provider.workspace || provider.type || ''
- const data = await fetchDirectoryContent(provider, path)
-
- dispatch(folderAddedSuccess(path, data))
+ await executeEvent('folderAdded', folderPath)
})
provider.event.on('fileRemoved', async (removePath) => {
- const path = extractParentFromKey(removePath) || provider.workspace || provider.type || ''
-
- dispatch(fileRemovedSuccess(path, removePath))
+ await executeEvent('fileRemoved', removePath)
})
provider.event.on('fileRenamed', async (oldPath) => {
- const path = extractParentFromKey(oldPath) || provider.workspace || provider.type || ''
- const data = await fetchDirectoryContent(provider, path)
-
- dispatch(fileRenamedSuccess(path, oldPath, data))
+ await executeEvent('fileRenamed', oldPath)
+ })
+ provider.event.on('rootFolderChanged', async () => {
+ await executeEvent('rootFolderChanged')
})
provider.event.on('fileExternallyChanged', async (path: string, file: { content: string }) => {
const config = registry.get('config').api
@@ -232,10 +228,6 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp
provider.event.on('fileRenamedError', async () => {
dispatch(displayNotification('File Renamed Failed', '', 'Ok', 'Cancel'))
})
- provider.event.on('rootFolderChanged', async () => {
- workspaceName = provider.workspace || provider.type || ''
- fetchDirectory(provider, workspaceName)(dispatch)
- })
dispatch(fetchProviderSuccess(provider))
} else {
dispatch(fetchProviderError('No provider available'))
@@ -294,3 +286,99 @@ export const hideNotification = () => {
export const closeNotificationModal = () => (dispatch: React.Dispatch) => {
dispatch(hideNotification())
}
+
+const fileAdded = async (filePath: string) => {
+ if (extractParentFromKey(filePath) === '/.workspaces') return
+ const path = extractParentFromKey(filePath) || provider.workspace || provider.type || ''
+ const data = await fetchDirectoryContent(provider, path)
+
+ await dispatch(fileAddedSuccess(path, data))
+ if (filePath.includes('_test.sol')) {
+ plugin.emit('newTestFileCreated', filePath)
+ }
+}
+
+const folderAdded = async (folderPath: string) => {
+ if (extractParentFromKey(folderPath) === '/.workspaces') return
+ const path = extractParentFromKey(folderPath) || provider.workspace || provider.type || ''
+ const data = await fetchDirectoryContent(provider, path)
+
+ await dispatch(folderAddedSuccess(path, data))
+}
+
+const fileRemoved = async (removePath: string) => {
+ const path = extractParentFromKey(removePath) || provider.workspace || provider.type || ''
+
+ await dispatch(fileRemovedSuccess(path, removePath))
+}
+
+const fileRenamed = async (oldPath: string) => {
+ const path = extractParentFromKey(oldPath) || provider.workspace || provider.type || ''
+ const data = await fetchDirectoryContent(provider, path)
+
+ await dispatch(fileRenamedSuccess(path, oldPath, data))
+}
+
+const rootFolderChanged = async () => {
+ const workspaceName = provider.workspace || provider.type || ''
+
+ await fetchDirectory(provider, workspaceName)(dispatch)
+}
+
+const executeEvent = async (eventName: 'fileAdded' | 'folderAdded' | 'fileRemoved' | 'fileRenamed' | 'rootFolderChanged', path?: string) => {
+ if (Object.keys(pendingEvents).length) {
+ return queuedEvents.push({ eventName, path })
+ }
+ pendingEvents[eventName + path] = { eventName, path }
+ switch (eventName) {
+ case 'fileAdded':
+ await fileAdded(path)
+ delete pendingEvents[eventName + path]
+ if (queuedEvents.length) {
+ const next = queuedEvents.pop()
+
+ await executeEvent(next.eventName, next.path)
+ }
+ break
+
+ case 'folderAdded':
+ await folderAdded(path)
+ delete pendingEvents[eventName + path]
+ if (queuedEvents.length) {
+ const next = queuedEvents.pop()
+
+ await executeEvent(next.eventName, next.path)
+ }
+ break
+
+ case 'fileRemoved':
+ await fileRemoved(path)
+ delete pendingEvents[eventName + path]
+ if (queuedEvents.length) {
+ const next = queuedEvents.pop()
+
+ await executeEvent(next.eventName, next.path)
+ }
+ break
+
+ case 'fileRenamed':
+ await fileRenamed(path)
+ delete pendingEvents[eventName + path]
+ if (queuedEvents.length) {
+ const next = queuedEvents.pop()
+
+ await executeEvent(next.eventName, next.path)
+ }
+ break
+
+ case 'rootFolderChanged':
+ await rootFolderChanged()
+ delete pendingEvents[eventName + path]
+ if (queuedEvents.length) {
+ const next = queuedEvents.pop()
+
+ await executeEvent(next.eventName, next.path)
+ }
+ 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 a433300e68..854454d9ce 100644
--- a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
+++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
@@ -126,7 +126,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
const editRef = useRef(null)
useEffect(() => {
- init(props.filesProvider, props.name, props.plugin, props.registry)(dispatch)
+ init(props.filesProvider, props.plugin, props.registry)(dispatch)
}, [])
useEffect(() => {
diff --git a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
index 5bb91441af..be7e405499 100644
--- a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
+++ b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
@@ -66,13 +66,16 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
}, [])
useEffect(() => {
+ setWarningState([])
if (autoRun) {
if (state.data !== null) {
run(state.data, state.source, state.file)
}
+ } else {
+ props.event.trigger('staticAnaysisWarning', [])
}
return () => { }
- }, [autoRun, categoryIndex, state])
+ }, [state])
const message = (name, warning, more, fileName, locationString) : string => {
return (`
@@ -302,7 +305,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
label="Autorun"
onChange={() => {}}
/>
-
@@ -323,22 +326,22 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
{state.file}
- { categoryIndex.length > 0 && Object.entries(warningState).length > 0 &&
+ {Object.entries(warningState).length > 0 &&
{
- (Object.entries(warningState).map((element) => (
- <>
+ (Object.entries(warningState).map((element, index) => (
+
{element[0]}
- {element[1].map(x => (
+ {element[1].map((x, i) => (
x.hasWarning ? (
-
)))
}
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 c844986a40..307ca0fb7c 100644
--- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
+++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
@@ -71,7 +71,7 @@ export const Workspace = (props: WorkspaceProps) => {
}
useEffect(() => {
- const getWorkspaces = async () => {
+ let getWorkspaces = async () => {
if (props.workspaces && Array.isArray(props.workspaces)) {
if (props.workspaces.length > 0 && state.currentWorkspace === NO_WORKSPACE) {
props.workspace.setWorkspace(props.workspaces[0])
@@ -87,6 +87,10 @@ export const Workspace = (props: WorkspaceProps) => {
}
getWorkspaces()
+
+ return () => {
+ getWorkspaces = async () => {}
+ }
}, [props.workspaces])
const localhostDisconnect = () => {
diff --git a/package.json b/package.json
index 403e253716..ccafdfdadf 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"bumpVersion:libs": "gulp & gulp syncLibVersions;",
"browsertest": "sleep 5 && npm run nightwatch_local",
"csslint": "csslint --ignore=order-alphabetical --errors='errors,duplicate-properties,empty-rules' --exclude-list='apps/remix-ide/src/assets/css/font-awesome.min.css' apps/remix-ide/src/assets/css/",
- "downloadsolc_assets": "wget --no-check-certificate https://binaries.soliditylang.org/bin/soljson-v0.8.4+commit.c7e474f2.js -O ./apps/remix-ide/src/assets/js/soljson.js",
+ "downloadsolc_assets": "wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.4+commit.c7e474f2.js -O ./apps/remix-ide/src/assets/js/soljson.js",
"make-mock-compiler": "node apps/remix-ide/ci/makeMockCompiler.js",
"minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false",
"nightwatch_parallel": "npm run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome,firefox",