Merge branch 'master' into fix-import

pull/2038/head
David Disu 3 years ago committed by GitHub
commit 633291a5e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      libs/remix-ui/run-tab/src/lib/actions/index.ts
  2. 12
      libs/remix-ui/workspace/src/lib/reducers/workspace.ts
  3. 2
      package-lock.json
  4. 2
      package.json

@ -559,7 +559,6 @@ export const clearInstances = () => {
} }
export const loadAddress = (contract: ContractData, address: string) => { export const loadAddress = (contract: ContractData, address: string) => {
if (!contract) return dispatch(displayPopUp('No compiled contracts found.'))
loadContractFromAddress(address, loadContractFromAddress(address,
(cb) => { (cb) => {
dispatch(displayNotification('At Address', `Do you really want to interact with ${address} using the current ABI definition?`, 'OK', 'Cancel', cb, null)) dispatch(displayNotification('At Address', `Do you really want to interact with ${address} using the current ABI definition?`, 'OK', 'Cancel', cb, null))
@ -568,16 +567,17 @@ export const loadAddress = (contract: ContractData, address: string) => {
if (error) { if (error) {
return dispatch(displayNotification('Alert', error, 'OK', null)) return dispatch(displayNotification('Alert', error, 'OK', null))
} }
if (loadType === 'abi') {
return addInstance({ abi, address, name: '<at address>' })
} else if (loadType === 'instance') {
if (!contract) return dispatch(displayPopUp('No compiled contracts found.'))
const compiler = plugin.REACT_API.contracts.contractList.find(item => item.alias === contract.name) const compiler = plugin.REACT_API.contracts.contractList.find(item => item.alias === contract.name)
const contractData = getSelectedContract(contract.name, compiler.name) const contractData = getSelectedContract(contract.name, compiler.name)
return addInstance({ contractData, address, name: contract.name })
if (loadType === 'abi') {
return addInstance({ contractData, address, name: '<at address>' })
} }
addInstance({ contractData, address, name: contract.name })
} }
) )
} }
export const getContext = () => { export const getContext = () => {
return plugin.blockchain.context() return plugin.blockchain.context()

@ -608,12 +608,12 @@ const fileAdded = (state: BrowserState, path: string): { [x: string]: Record<str
let files = state.mode === 'browser' ? state.browser.files : state.localhost.files let files = state.mode === 'browser' ? state.browser.files : state.localhost.files
const _path = splitPath(state, path) const _path = splitPath(state, path)
files = _.set(files, _path, { files = _.setWith(files, _path, {
path: path, path: path,
name: extractNameFromKey(path), name: extractNameFromKey(path),
isDirectory: false, isDirectory: false,
type: 'file' type: 'file'
}) }, Object)
return files return files
} }
@ -638,13 +638,13 @@ const removeInputField = (state: BrowserState, path: string): { [x: string]: Rec
if (prevFiles) { if (prevFiles) {
prevFiles.child && prevFiles.child[path + '/' + 'blank'] && delete prevFiles.child[path + '/' + 'blank'] prevFiles.child && prevFiles.child[path + '/' + 'blank'] && delete prevFiles.child[path + '/' + 'blank']
files = _.set(files, _path, { files = _.setWith(files, _path, {
isDirectory: true, isDirectory: true,
path, path,
name: extractNameFromKey(path).indexOf('gist-') === 0 ? extractNameFromKey(path).split('-')[1] : extractNameFromKey(path), name: extractNameFromKey(path).indexOf('gist-') === 0 ? extractNameFromKey(path).split('-')[1] : extractNameFromKey(path),
type: extractNameFromKey(path).indexOf('gist-') === 0 ? 'gist' : 'folder', type: extractNameFromKey(path).indexOf('gist-') === 0 ? 'gist' : 'folder',
child: prevFiles ? prevFiles.child : {} child: prevFiles ? prevFiles.child : {}
}) }, Object)
} }
return files return files
@ -674,7 +674,7 @@ const fetchDirectoryContent = (state: BrowserState, payload: { fileTree, path: s
delete prevFiles.child[deletePath] delete prevFiles.child[deletePath]
} }
} }
files = _.set(files, _path, prevFiles) files = _.setWith(files, _path, prevFiles, Object)
} else if (payload.fileTree && payload.path) { } else if (payload.fileTree && payload.path) {
files = { [payload.path]: normalize(payload.fileTree, payload.path, payload.type) } files = { [payload.path]: normalize(payload.fileTree, payload.path, payload.type) }
} }
@ -703,7 +703,7 @@ const fetchDirectoryContent = (state: BrowserState, payload: { fileTree, path: s
delete prevFiles.child[deletePath] delete prevFiles.child[deletePath]
} }
} }
files = _.set(files, _path, prevFiles) files = _.setWith(files, _path, prevFiles, Object)
} else { } else {
files = { [payload.path]: normalize(payload.fileTree, payload.path, payload.type) } files = { [payload.path]: normalize(payload.fileTree, payload.path, payload.type) }
} }

2
package-lock.json generated

@ -1,6 +1,6 @@
{ {
"name": "remix-project", "name": "remix-project",
"version": "0.21.1-dev", "version": "0.21.2-dev",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

@ -1,6 +1,6 @@
{ {
"name": "remix-project", "name": "remix-project",
"version": "0.21.1-dev", "version": "0.21.2-dev",
"license": "MIT", "license": "MIT",
"description": "Ethereum Remix Monorepo", "description": "Ethereum Remix Monorepo",
"keywords": [ "keywords": [

Loading…
Cancel
Save