Merge branch 'master' of https://github.com/ethereum/remix-project into fastcircle

pull/1754/head
bunsenstraat 3 years ago
commit d133e82bec
  1. 17
      .github/workflows/publish-remix-ide.yml
  2. 3
      apps/remix-ide/src/app/files/slither-handle.js
  3. 6
      apps/remix-ide/src/app/tabs/runTab/contractDropdown.js
  4. 8
      libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts
  5. 20
      libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx
  6. 6312
      package-lock.json

@ -1,17 +0,0 @@
name: remix-publish-action
on:
pull_request:
types: [ labeled ]
jobs:
build:
if: ${{ github.event.label.name == 'publish' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- run: cd ..
- run: npm install
- run: ls
- run: pwd
- run: nx build remix-ide --with-deps
- run: node ./apps/remix-ide/ci/publishIpfs

@ -8,7 +8,8 @@ const profile = {
methods: ['analyse'],
description: 'Using Remixd daemon, run slither static analysis',
kind: 'other',
version: packageJson.version
version: packageJson.version,
documentation: 'https://remix-ide.readthedocs.io/en/latest/slither.html'
}
export class SlitherHandle extends WebsocketPlugin {

@ -310,10 +310,10 @@ class ContractDropdownUI {
const data = self.runView.compilersArtefacts.getCompilerAbstract(contractObject.contract.file)
self.runView.compilersArtefacts.addResolvedContract(helper.addressToString(address), data)
if (self.ipfsCheckedState) {
_paq.push(['trackEvent', 'udapp', 'DeployAndPublish', this.networkName, this.networkId])
_paq.push(['trackEvent', 'udapp', 'DeployAndPublish', this.networkName + '_' + this.networkId])
publishToStorage('ipfs', self.runView.fileProvider, self.runView.fileManager, selectedContract)
} else {
_paq.push(['trackEvent', 'udapp', 'DeployOnly', this.networkName, this.networkId])
_paq.push(['trackEvent', 'udapp', 'DeployOnly', this.networkName + '_' + this.networkId])
}
}
@ -347,7 +347,7 @@ class ContractDropdownUI {
}
deployContract (selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) {
_paq.push(['trackEvent', 'udapp', 'DeployContractTo', this.networkName, this.networkId])
_paq.push(['trackEvent', 'udapp', 'DeployContractTo', this.networkName + '_' + this.networkId])
const { statusCb } = callbacks
if (!contractMetadata || (contractMetadata && contractMetadata.autoDeployLib)) {
return this.blockchain.deployContractAndLibraries(selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb)

@ -67,11 +67,9 @@ export class FetchAndCompile extends Plugin {
}
}
let name = network.name.toLowerCase()
name = name === 'main' ? 'mainnet' : name // source-verifier api expect "mainnet" and not "main"
let data
try {
data = await this.call('source-verification', 'fetchByNetwork', contractAddress, name.toLowerCase())
data = await this.call('source-verification', 'fetchByNetwork', contractAddress, network.id)
} catch (e) {
setTimeout(_ => this.emit('notFound', contractAddress), 0) // plugin framework returns a time out error although it actually didn't find the source...
this.unresolvedAddresses.push(contractAddress)
@ -84,7 +82,7 @@ export class FetchAndCompile extends Plugin {
}
// set the solidity contract code using metadata
await this.call('fileManager', 'setFile', `${targetPath}/${name}/${contractAddress}/metadata.json`, JSON.stringify(data.metadata, null, '\t'))
await this.call('fileManager', 'setFile', `${targetPath}/${network.id}/${contractAddress}/metadata.json`, JSON.stringify(data.metadata, null, '\t'))
const compilationTargets = {}
for (let file in data.metadata.sources) {
const urls = data.metadata.sources[file].urls
@ -96,7 +94,7 @@ export class FetchAndCompile extends Plugin {
// nothing to do, the compiler callback will handle those
} else {
file = file.replace('browser/', '') // should be fixed in the remix IDE end.
const path = `${targetPath}/${name}/${contractAddress}/${file}`
const path = `${targetPath}/${network.id}/${contractAddress}/${file}`
await this.call('fileManager', 'setFile', path, source.content)
compilationTargets[path] = { content: source.content }
}

@ -21,6 +21,8 @@ export const TabsUI = (props: TabsUIProps) => {
const [selectedIndex, setSelectedIndex] = useState(-1)
const currentIndexRef = useRef(-1)
const tabsRef = useRef({})
const tabsElement = useRef(null)
const tabs = useRef(props.tabs)
tabs.current = props.tabs // we do this to pass the tabs list to the onReady callbacks
@ -53,11 +55,22 @@ export const TabsUI = (props: TabsUIProps) => {
currentIndexRef.current = index
setSelectedIndex(index)
}
const transformScroll = (event) => {
if (!event.deltaY) {
return
}
event.currentTarget.scrollLeft += event.deltaY + event.deltaX
event.preventDefault()
}
useEffect(() => {
props.onReady({
activateTab,
active
})
return () => { tabsElement.current.removeEventListener('wheel', transformScroll) }
}, [])
return (
@ -70,8 +83,13 @@ export const TabsUI = (props: TabsUIProps) => {
<Tabs
className="tab-scroll"
selectedIndex={selectedIndex}
domRef={(domEl) => {
if (tabsElement.current) return
tabsElement.current = domEl
tabsElement.current.addEventListener('wheel', transformScroll)
}}
>
<TabList className="d-flex flex-row justify-content-center align-items-center">
<TabList className="d-flex flex-row align-items-center">
{props.tabs.map((tab, i) => <Tab className="py-1" key={tab.name}>{renderTab(tab, i)}</Tab>)}
</TabList>
{props.tabs.map((tab) => <TabPanel key={tab.name} ></TabPanel>)}

6312
package-lock.json generated

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save