Skip to content

Commit de4fa14

Browse files
authored
Merge branch 'master' into delFS
2 parents 414a50f + 6b7131b commit de4fa14

File tree

49 files changed

+396
-215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+396
-215
lines changed

.env renamed to .env.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ gist_token=<token>
22
account_passphrase=<passphrase>
33
account_password=<password>
44
NODE_OPTIONS=--max-old-space-size=2048
5-
# WALLET_CONNECT_PROJECT_ID=<walletconnect cloud PROJECT_ID>
5+
WALLET_CONNECT_PROJECT_ID=<project_id>

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ soljson.js
1616
*_group*.ts
1717
stats.json
1818
release
19+
.env
1920

2021

2122
# compiled output

apps/remix-dapp/src/locales/en/udapp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"udapp.contractOptionsTitle2": "Select a compiled contract to deploy or to use with At Address.",
2727
"udapp.contractOptionsTitle3": "Select and compile *.sol file to deploy or access a contract.",
2828
"udapp.contractOptionsTitle4": "When there is a compiled .sol file, choose the contract to deploy or to use with At Address.",
29-
"udapp.checkSumWarning": "It seems you are not using a checksumed address.A checksummed address is an address that contains uppercase letters, as specified in {a}.Checksummed addresses are meant to help prevent users from sending transactions to the wrong address.",
29+
"udapp.checkSumWarning": "It seems you are not using a checksummed address.A checksummed address is an address that contains uppercase letters, as specified in {a}.Checksummed addresses are meant to help prevent users from sending transactions to the wrong address.",
3030
"udapp.isOverSizePromptEip170": "Contract creation initialization returns data with length of more than 24576 bytes. The deployment will likely fail if the current network has activated the eip 170. More info: {a}",
3131
"udapp.isOverSizePromptEip3860": "Contract creation init code exceeds the allowed max code size of 49152 bytes. The deployment will likely fail if the current network has activated the eip 3860. More info: {a}",
3232
"udapp.thisContractMayBeAbstract": "This contract may be abstract, it may not implement an abstract parent's methods completely or it may not invoke an inherited contract's constructor correctly.",

apps/remix-dapp/src/locales/zh/udapp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"udapp.contractOptionsTitle2": "选择要部署或与 At Address 一起使用的已编译合约。",
2424
"udapp.contractOptionsTitle3": "选择并编译 *.sol 文件以部署或访问合约。",
2525
"udapp.contractOptionsTitle4": "当有编译的 .sol 文件时,选择 {br} 合约进行部署或与 AtAddress 一起使用。",
26-
"udapp.checkSumWarning": "您似乎没有使用 checksumed address 。{br} checksumed address 是包含大写字母的地址,如 {a} 中所指定。{br} checksumed address 旨在帮助防止用户将交易发送到错误地址。",
26+
"udapp.checkSumWarning": "您似乎没有使用 checksummed address 。{br} checksummed address 是包含大写字母的地址,如 {a} 中所指定。{br} checksummed address 旨在帮助防止用户将交易发送到错误地址。",
2727
"udapp.isOverSizePromptEip170": "合约创建初始化返回长度超过24576字节的数据。部署可能会失败。 {br}更多信息:{a}",
2828
"udapp.isOverSizePromptEip3860": "合约创建初始化代码超出了允许的最大代码大小 49152 字节。如果当前网络已激活 eip 3860,则部署可能会失败。更多信息:{a}",
2929
"udapp.thisContractMayBeAbstract": "这个合约可能是抽象的,它可能没有完全实现抽象父类的方法,或者它可能没有正确调用继承合约的构造函数。",

apps/remix-ide-e2e/src/commands/selectContract.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,14 @@ import EventEmitter from 'events'
44
const selector = '.udapp_contractNames'
55

66
class SelectContract extends EventEmitter {
7-
command (this: NightwatchBrowser, contractName: string): NightwatchBrowser {
8-
this.api.waitForElementVisible(selector).perform((done) => {
9-
selectContract(this.api, contractName, () => {
10-
done()
11-
this.emit('complete')
12-
})
13-
})
7+
command(this: NightwatchBrowser, contractName: string): NightwatchBrowser {
8+
this.api
9+
.waitForElementVisible(selector)
10+
.waitForElementPresent(`${selector} option[value="${contractName}"]`)
11+
.click(`${selector} option[value="${contractName}"]`)
12+
.perform(() => this.emit('complete'))
1413
return this
1514
}
1615
}
1716

18-
function selectContract (browser: NightwatchBrowser, contractName: string, callback: VoidFunction) {
19-
browser.click(`${selector} option[value="${contractName}"]`).perform(() => callback())
20-
}
21-
2217
module.exports = SelectContract

apps/remix-ide-e2e/src/tests/terminal.test.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,18 +209,16 @@ module.exports = {
209209
.createContract('')
210210
.getAddressAtPosition(0, (address) => {
211211
addressRef = address
212-
})
213-
.perform((done) => {
214212
browser.addFile('scripts/test_filtering_event.ts', { content: test_filtering_event.replace('<ADDRESS>', addressRef) })
215-
.perform(() => done())
213+
.executeScriptInTerminal('remix.execute(\'scripts/test_filtering_event.ts\')')
214+
.pause(1000)
215+
.waitForElementContainsText('*[data-id="terminalJournal"]', '1')
216+
.waitForElementContainsText('*[data-id="terminalJournal"]', 'true')
217+
.executeScriptInTerminal('remix.execute(\'scripts/test_filtering_event.ts\')') // re-emit the event
218+
.waitForElementContainsText('*[data-id="terminalJournal"]', '2')
219+
.waitForElementContainsText('*[data-id="terminalJournal"]', 'false')
216220
})
217-
.executeScriptInTerminal('remix.execute(\'scripts/test_filtering_event.ts\')')
218-
.pause(1000)
219-
.waitForElementContainsText('*[data-id="terminalJournal"]', '1')
220-
.waitForElementContainsText('*[data-id="terminalJournal"]', 'true')
221-
.executeScriptInTerminal('remix.execute(\'scripts/test_filtering_event.ts\')') // re-emit the event
222-
.waitForElementContainsText('*[data-id="terminalJournal"]', '2')
223-
.waitForElementContainsText('*[data-id="terminalJournal"]', 'false')
221+
224222
},
225223

226224
'Should display auto-complete menu #group4': function (browser: NightwatchBrowser) {
Lines changed: 78 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@ import { WalkthroughService } from './walkthroughService'
2626

2727
import { OffsetToLineColumnConverter, CompilerMetadata, CompilerArtefacts, FetchAndCompile, CompilerImports, GistHandler } from '@remix-project/core-plugin'
2828

29-
import {Registry} from '@remix-project/remix-lib'
30-
import {ConfigPlugin} from './app/plugins/config'
31-
import {StoragePlugin} from './app/plugins/storage'
32-
import {Layout} from './app/panels/layout'
33-
import {NotificationPlugin} from './app/plugins/notification'
34-
import {Blockchain} from './blockchain/blockchain'
35-
import {MergeVMProvider, LondonVMProvider, BerlinVMProvider, ShanghaiVMProvider, CancunVMProvider} from './app/providers/vm-provider'
36-
import {MainnetForkVMProvider} from './app/providers/mainnet-vm-fork-provider'
37-
import {SepoliaForkVMProvider} from './app/providers/sepolia-vm-fork-provider'
38-
import {GoerliForkVMProvider} from './app/providers/goerli-vm-fork-provider'
39-
import {CustomForkVMProvider} from './app/providers/custom-vm-fork-provider'
40-
import {HardhatProvider} from './app/providers/hardhat-provider'
41-
import {GanacheProvider} from './app/providers/ganache-provider'
42-
import {FoundryProvider} from './app/providers/foundry-provider'
43-
import {ExternalHttpProvider} from './app/providers/external-http-provider'
29+
import { Registry } from '@remix-project/remix-lib'
30+
import { ConfigPlugin } from './app/plugins/config'
31+
import { StoragePlugin } from './app/plugins/storage'
32+
import { Layout } from './app/panels/layout'
33+
import { NotificationPlugin } from './app/plugins/notification'
34+
import { Blockchain } from './blockchain/blockchain'
35+
import { MergeVMProvider, LondonVMProvider, BerlinVMProvider, ShanghaiVMProvider, CancunVMProvider } from './app/providers/vm-provider'
36+
import { MainnetForkVMProvider } from './app/providers/mainnet-vm-fork-provider'
37+
import { SepoliaForkVMProvider } from './app/providers/sepolia-vm-fork-provider'
38+
import { GoerliForkVMProvider } from './app/providers/goerli-vm-fork-provider'
39+
import { CustomForkVMProvider } from './app/providers/custom-vm-fork-provider'
40+
import { HardhatProvider } from './app/providers/hardhat-provider'
41+
import { GanacheProvider } from './app/providers/ganache-provider'
42+
import { FoundryProvider } from './app/providers/foundry-provider'
43+
import { ExternalHttpProvider } from './app/providers/external-http-provider'
4444
import { EnvironmentExplorer } from './app/providers/environment-explorer'
4545
import { FileDecorator } from './app/plugins/file-decorator'
4646
import { CodeFormat } from './app/plugins/code-format'
@@ -58,7 +58,7 @@ import { xtermPlugin } from './app/plugins/electron/xtermPlugin'
5858
import { ripgrepPlugin } from './app/plugins/electron/ripgrepPlugin'
5959
import { compilerLoaderPlugin, compilerLoaderPluginDesktop } from './app/plugins/electron/compilerLoaderPlugin'
6060
import { appUpdaterPlugin } from './app/plugins/electron/appUpdaterPlugin'
61-
import { remixAIDesktopPlugin } from './app/plugins/electron/remixAIDesktopPlugin'
61+
import { remixAIDesktopPlugin } from './app/plugins/electron/remixAIDesktopPlugin'
6262
import { RemixAIPlugin } from './app/plugins/remixAIPlugin'
6363
import { SlitherHandleDesktop } from './app/plugins/electron/slitherPlugin'
6464
import { SlitherHandle } from './app/files/slither-handle'
@@ -72,37 +72,37 @@ import { Matomo } from './app/plugins/matomo'
7272

7373
import { TemplatesSelectionPlugin } from './app/plugins/templates-selection/templates-selection-plugin'
7474

75-
const isElectron = require('is-electron')
75+
import isElectron from 'is-electron'
7676

77-
const remixLib = require('@remix-project/remix-lib')
77+
import * as remixLib from '@remix-project/remix-lib'
7878

7979
import { QueryParams } from '@remix-project/remix-lib'
8080
import { SearchPlugin } from './app/tabs/search'
8181
import { ScriptRunnerUIPlugin } from './app/tabs/script-runner-ui'
8282
import { ElectronProvider } from './app/files/electronProvider'
8383

8484
const Storage = remixLib.Storage
85-
const RemixDProvider = require('./app/files/remixDProvider')
86-
const Config = require('./config')
85+
import RemixDProvider from './app/files/remixDProvider'
86+
import Config from './config'
8787

88-
const FileManager = require('./app/files/fileManager')
88+
import FileManager from './app/files/fileManager'
8989
import FileProvider from "./app/files/fileProvider"
9090
import { appPlatformTypes } from '@remix-ui/app'
9191

92-
const DGitProvider = require('./app/files/dgitProvider')
93-
const WorkspaceFileProvider = require('./app/files/workspaceFileProvider')
92+
import DGitProvider from './app/files/dgitProvider'
93+
import WorkspaceFileProvider from './app/files/workspaceFileProvider'
9494

95-
const PluginManagerComponent = require('./app/components/plugin-manager-component')
95+
import PluginManagerComponent from './app/components/plugin-manager-component'
9696

97-
const CompileTab = require('./app/tabs/compile-tab')
98-
const SettingsTab = require('./app/tabs/settings-tab')
99-
const AnalysisTab = require('./app/tabs/analysis-tab')
100-
const { DebuggerTab } = require('./app/tabs/debugger-tab')
101-
const TestTab = require('./app/tabs/test-tab')
102-
const FilePanel = require('./app/panels/file-panel')
103-
const Editor = require('./app/editor/editor')
104-
const Terminal = require('./app/panels/terminal')
105-
const { TabProxy } = require('./app/panels/tab-proxy.js')
97+
import CompileTab from './app/tabs/compile-tab'
98+
import SettingsTab from './app/tabs/settings-tab'
99+
import AnalysisTab from './app/tabs/analysis-tab'
100+
import DebuggerTab from './app/tabs/debugger-tab'
101+
import TestTab from './app/tabs/test-tab'
102+
import Filepanel from './app/panels/file-panel'
103+
import Editor from './app/editor/editor'
104+
import Terminal from './app/panels/terminal'
105+
import TabProxy from './app/panels/tab-proxy.js'
106106

107107
const _paq = (window._paq = window._paq || [])
108108

@@ -115,16 +115,49 @@ export class platformApi {
115115
}
116116
}
117117

118+
type Components = {
119+
filesProviders: {
120+
browser?: any
121+
localhost?: any
122+
workspace?: any
123+
electron?: any
124+
}
125+
}
126+
118127
class AppComponent {
128+
appManager: RemixAppManager
129+
queryParams: QueryParams
130+
private _components: Components
131+
panels: any
132+
workspace: any
133+
engine: RemixEngine
134+
matomoConfAlreadySet: any
135+
matomoCurrentSetting: any
136+
showMatomo: boolean
137+
walkthroughService: WalkthroughService
138+
platform: 'desktop' | 'web'
139+
gistHandler: GistHandler
140+
themeModule: ThemeModule
141+
localeModule: LocaleModule
142+
notification: NotificationPlugin
143+
layout: Layout
144+
mainview: any
145+
menuicons: VerticalIcons
146+
sidePanel: SidePanel
147+
hiddenPanel: HiddenPanel
148+
pinnedPanel: PinnedPanel
149+
popupPanel: PopupPanel
150+
statusBar: StatusBar
151+
settings: SettingsTab
119152
constructor() {
120153
const PlatFormAPi = new platformApi()
121154
Registry.getInstance().put({
122155
api: PlatFormAPi,
123156
name: 'platform'
124157
})
125-
this.appManager = new RemixAppManager({})
158+
this.appManager = new RemixAppManager()
126159
this.queryParams = new QueryParams()
127-
this._components = {}
160+
this._components = {} as Components
128161
// setup storage
129162
const configStorage = new Storage('config-v0.8:')
130163

@@ -161,7 +194,6 @@ class AppComponent {
161194
name: 'fileproviders'
162195
})
163196

164-
165197
}
166198

167199
async run() {
@@ -184,7 +216,7 @@ class AppComponent {
184216
this.matomoConfAlreadySet = Registry.getInstance().get('config').api.exists('settings/matomo-analytics')
185217
this.matomoCurrentSetting = Registry.getInstance().get('config').api.get('settings/matomo-analytics')
186218

187-
let electronTracking = window.electronAPI ? await window.electronAPI.canTrackMatomo() : false
219+
const electronTracking = (window as any).electronAPI ? await (window as any).electronAPI.canTrackMatomo() : false
188220

189221
const lastMatomoCheck = window.localStorage.getItem('matomo-analytics-consent')
190222
const sixMonthsAgo = new Date();
@@ -193,11 +225,11 @@ class AppComponent {
193225
const e2eforceMatomoToShow = window.localStorage.getItem('showMatomo') && window.localStorage.getItem('showMatomo') === 'true'
194226
const contextShouldShowMatomo = matomoDomains[window.location.hostname] || e2eforceMatomoToShow || electronTracking
195227
const shouldRenewConsent = this.matomoCurrentSetting === false && (!lastMatomoCheck || new Date(Number(lastMatomoCheck)) < sixMonthsAgo) // it is set to false for more than 6 months.
196-
this.showMatomo = contextShouldShowMatomo && (!this.matomoConfAlreadySet || shouldRenewConsent)
228+
this.showMatomo = contextShouldShowMatomo && (!this.matomoConfAlreadySet || shouldRenewConsent)
197229

198230
if (this.showMatomo && shouldRenewConsent) {
199231
_paq.push(['trackEvent', 'Matomo', 'refreshMatomoPermissions']);
200-
}
232+
}
201233

202234
this.walkthroughService = new WalkthroughService(appManager)
203235

@@ -387,7 +419,7 @@ class AppComponent {
387419
ganacheProvider,
388420
foundryProvider,
389421
externalHttpProvider,
390-
environmentExplorer,
422+
environmentExplorer,
391423
this.walkthroughService,
392424
search,
393425
solidityumlgen,
@@ -456,10 +488,10 @@ class AppComponent {
456488
this.popupPanel = new PopupPanel()
457489

458490
const pluginManagerComponent = new PluginManagerComponent(appManager, this.engine)
459-
const filePanel = new FilePanel(appManager, contentImport)
491+
const filePanel = new Filepanel(appManager, contentImport)
460492
this.statusBar = new StatusBar(filePanel, this.menuicons)
461493
const landingPage = new LandingPage(appManager, this.menuicons, fileManager, filePanel, contentImport)
462-
this.settings = new SettingsTab(Registry.getInstance().get('config').api, editor, appManager)
494+
this.settings = new SettingsTab(Registry.getInstance().get('config').api, editor)//, appManager)
463495

464496
this.engine.register([this.menuicons, landingPage, this.hiddenPanel, this.sidePanel, this.statusBar, filePanel, pluginManagerComponent, this.settings, this.pinnedPanel, this.popupPanel])
465497

@@ -514,7 +546,7 @@ class AppComponent {
514546

515547
async activate() {
516548
const queryParams = new QueryParams()
517-
const params = queryParams.get()
549+
const params: any = queryParams.get()
518550

519551
try {
520552
this.engine.register(await this.appManager.registeredPlugins())
@@ -610,10 +642,11 @@ class AppComponent {
610642
}
611643

612644
if (params.call) {
613-
const callDetails = params.call.split('//')
645+
const callDetails: any = params.call.split('//')
614646
if (callDetails.length > 1) {
615647
this.appManager.call('notification', 'toast', `initiating ${callDetails[0]} and calling "${callDetails[1]}" ...`)
616648
// @todo(remove the timeout when activatePlugin is on 0.3.0)
649+
//@ts-ignore
617650
await this.appManager.call(...callDetails).catch(console.error)
618651
}
619652
}
@@ -629,6 +662,7 @@ class AppComponent {
629662

630663
// @todo(remove the timeout when activatePlugin is on 0.3.0)
631664
try {
665+
//@ts-ignore
632666
await this.appManager.call(...callDetails)
633667
} catch (e) {
634668
console.error(e)

apps/remix-ide/src/app/components/main-panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const profile = {
1515
export class MainPanel extends AbstractPanel {
1616
element: HTMLDivElement
1717
dispatch: React.Dispatch<any> = () => {}
18-
constructor(config) {
18+
constructor(config = null) {
1919
super(profile)
2020
this.element = document.createElement('div')
2121
this.element.setAttribute('data-id', 'mainPanelPluginsContainer')

apps/remix-ide/src/app/components/plugin-manager-component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const profile = {
1919
maintainedBy: "Remix"
2020
}
2121

22-
class PluginManagerComponent extends ViewPlugin {
22+
export default class PluginManagerComponent extends ViewPlugin {
2323
constructor (appManager, engine) {
2424
super(profile)
2525
this.appManager = appManager

apps/remix-ide/src/app/components/popup-panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class PopupPanel extends AbstractPanel {
2424
dispatch: React.Dispatch<any> = () => { }
2525
appStateDispatch: React.Dispatch<AppAction> = () => { }
2626

27-
constructor(config) {
27+
constructor(config = null) {
2828
super(profile)
2929
this.event = new EventEmitter()
3030
}

0 commit comments

Comments
 (0)