Skip to content

Commit ca68f12

Browse files
authored
Merge branch 'master' into bootstrap_5
2 parents 33339e9 + 8bc4664 commit ca68f12

File tree

71 files changed

+4984
-2741
lines changed

Some content is hidden

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

71 files changed

+4984
-2741
lines changed

.env.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
gist_token=<token>
22
account_passphrase=<passphrase>
33
account_password=<password>
4-
NODE_OPTIONS=--max-old-space-size=2048
4+
NODE_OPTIONS=--max-old-space-size=4096
55
WALLET_CONNECT_PROJECT_ID=<project_id>
66
NOIR_COMPILER_BASE_URL_DEV=<dev_base_endpoint>
77
NOIR_COMPILER_BASE_URL_PROD=<prod_base_endpoint>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ class CurrentWorkspaceIs extends EventEmitter {
1111
selector: xpath,
1212
timeout: 20000
1313
})
14-
.perform((done) => {
15-
done()
16-
this.emit('complete')
17-
})
14+
.perform((done) => {
15+
done()
16+
this.emit('complete')
17+
})
1818
return this
1919
}
2020
}

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,31 @@ function openFile (browser: NightwatchBrowser, name: string, done: VoidFunction)
3333
}
3434
})
3535
})
36-
.perform(async () => {
37-
if (await browser.isVisible({ selector: 'li[data-id="treeViewLitreeViewItem' + name + '"]', suppressNotFoundErrors: true})) {
36+
.perform(async () => {
37+
if (await browser.isVisible({ selector: 'li[data-id="treeViewLitreeViewItem' + name + '"]', suppressNotFoundErrors: true })) {
3838
browser.click('li[data-id="treeViewLitreeViewItem' + name + '"]')
3939
done()
4040
return
41-
}
42-
let it = 0
43-
const split = name.split('/')
44-
let current = split.splice(0, 1)
45-
while (true) {
46-
if (await browser.isVisible({ selector: 'li[data-id="treeViewLitreeViewItem' + current.join('/') + '"]', suppressNotFoundErrors: true }) &&
47-
!await browser.isPresent({ selector: 'li[data-id="treeViewLitreeViewItem' + current.join('/') + '"] .fa-folder-open', suppressNotFoundErrors: true })) {
48-
browser.click('li[data-id="treeViewLitreeViewItem' + current.join('/') + '"]')
4941
}
50-
if (current.join('/') === name) {
51-
break
52-
}
53-
current.push(split.shift())
54-
it++
55-
if (it > 15) {
56-
browser.assert.fail(name, current.join('/'), 'cannot open file ' + name)
42+
let it = 0
43+
const split = name.split('/')
44+
const current = split.splice(0, 1)
45+
while (true) {
46+
if (await browser.isVisible({ selector: 'li[data-id="treeViewLitreeViewItem' + current.join('/') + '"]', suppressNotFoundErrors: true }) &&
47+
!await browser.isPresent({ selector: 'li[data-id="treeViewLitreeViewItem' + current.join('/') + '"] .fa-folder-open', suppressNotFoundErrors: true })) {
48+
browser.click('li[data-id="treeViewLitreeViewItem' + current.join('/') + '"]')
49+
}
50+
if (current.join('/') === name) {
51+
break
52+
}
53+
current.push(split.shift())
54+
it++
55+
if (it > 15) {
56+
browser.assert.fail(name, current.join('/'), 'cannot open file ' + name)
57+
}
5758
}
58-
}
59-
done()
60-
})
59+
done()
60+
})
6161
}
6262

6363
module.exports = OpenFile

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ import EventEmitter from 'events'
44
class switchWorkspace extends EventEmitter {
55
command (this: NightwatchBrowser, workspaceName: string): NightwatchBrowser {
66
this.api
7-
.waitForElementVisible('[data-id="workspacesSelect"]')
8-
.click('[data-id="workspacesSelect"]')
9-
.waitForElementVisible(`[data-id="dropdown-item-${workspaceName}"]`)
10-
.click(`[data-id="dropdown-item-${workspaceName}"]`)
11-
.pause(7000)
12-
.perform((done) => {
13-
done()
14-
this.emit('complete')
15-
})
7+
.waitForElementVisible('[data-id="workspacesSelect"]')
8+
.click('[data-id="workspacesSelect"]')
9+
.waitForElementVisible(`[data-id="dropdown-item-${workspaceName}"]`)
10+
.click(`[data-id="dropdown-item-${workspaceName}"]`)
11+
.pause(7000)
12+
.perform((done) => {
13+
done()
14+
this.emit('complete')
15+
})
1616
return this
1717
}
1818
}
1919

20-
module.exports = switchWorkspace
20+
module.exports = switchWorkspace

apps/remix-ide-e2e/src/helpers/init.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,15 @@ function initModules(browser: NightwatchBrowser, callback: VoidFunction) {
9999
.scrollAndClick('[data-id="pluginManagerComponentActivateButtonsolidityStaticAnalysis"]')
100100
.scrollAndClick('[data-id="pluginManagerComponentActivateButtondebugger"]')
101101
.scrollAndClick('[data-id="verticalIconsKindfilePanel"]')
102-
.clickLaunchIcon('settings')
102+
.waitForElementVisible('*[data-id="topbar-settingsIcon"]')
103+
.click('*[data-id="topbar-settingsIcon"]')
103104
.click('*[data-id="settingsTabGenerateContractMetadataLabel"]')
104105
.setValue('[data-id="settingsTabGistAccessToken"]', process.env.gist_token)
105106
.click('[data-id="settingsTabSaveGistToken"]')
106-
.click('[data-id="settingsTabThemeLabelFlatly"]') // e2e tests were initially developed with Flatly. Some tests are failing with the default one (Dark), because the dark theme put uppercase everywhere.
107+
.waitForElementVisible('*[data-id="topbar-themeIcon-toggle"]')
108+
.click('*[data-id="topbar-themeIcon-toggle"]')
109+
.waitForElementVisible('*[data-id="topbar-themeIcon-light"]')
110+
.click('*[data-id="topbar-themeIcon-light"]')
111+
// .click('[data-id="settingsTabThemeLabelFlatly"]') // e2e tests were initially developed with Flatly. Some tests are failing with the default one (Dark), because the dark theme put uppercase everywhere.
107112
.perform(() => { callback() })
108113
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ module.exports = {
9595
'Compile with remappings set in remappings.txt file #group1': function (browser: NightwatchBrowser) {
9696
browser
9797
.clickLaunchIcon('filePanel')
98-
.click('*[data-id="workspacesMenuDropdown"]')
98+
.click('*[data-id="workspacesSelect"]')
9999
.click('*[data-id="workspacecreate"]')
100100
.waitForElementPresent('*[data-id="create-remixDefault"]')
101101
.scrollAndClick('*[data-id="create-remixDefault"]')
@@ -169,7 +169,7 @@ module.exports = {
169169
suppressNotFoundErrors: true,
170170
timeout: 1000
171171
})
172-
172+
173173
.waitForElementVisible('*[data-id="scConfigFilePathInput"]', 10000)
174174
.sendKeys('*[data-id="scConfigFilePathInput"]', 'cf.json')
175175
.sendKeys('*[data-id="scConfigFilePathInput"]', browser.Keys.ENTER)
@@ -200,7 +200,7 @@ module.exports = {
200200
suppressNotFoundErrors: true,
201201
timeout: 1000
202202
})
203-
203+
204204
.waitForElementVisible('*[data-id="scConfigFilePathInput"]', 10000)
205205
.sendKeys('*[data-id="scConfigFilePathInput"]', 'cf.json')
206206
.sendKeys('*[data-id="scConfigFilePathInput"]', browser.Keys.ENTER)
@@ -233,7 +233,7 @@ module.exports = {
233233
suppressNotFoundErrors: true,
234234
timeout: 1000
235235
})
236-
236+
237237
.waitForElementVisible('*[data-id="scConfigFilePathInput"]', 10000)
238238
.sendKeys('*[data-id="scConfigFilePathInput"]', 'cf.json')
239239
.sendKeys('*[data-id="scConfigFilePathInput"]', browser.Keys.ENTER)

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import init from '../helpers/init'
55
module.exports = {
66
'@disabled': true,
77
before: function (browser: NightwatchBrowser, done: VoidFunction) {
8-
browser.globals.asyncHookTimeout = 30000000;
8+
browser.globals.asyncHookTimeout = 30000000;
99
init(browser, done)
1010
},
1111

1212
'Should create semaphore workspace template #group1 #group2 #group3 #group4': function (browser: NightwatchBrowser) {
1313
browser
1414
.clickLaunchIcon('filePanel')
15-
.click('*[data-id="workspacesMenuDropdown"]')
15+
.click('*[data-id="workspacesSelect"]')
1616
.click('*[data-id="workspacecreate"]')
1717
.waitForElementPresent('*[data-id="create-semaphore"]')
1818
.scrollAndClick('*[data-id="create-semaphore"]')
@@ -41,7 +41,7 @@ module.exports = {
4141
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Everything went okay')
4242
.waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/.bin/simple_js"]')
4343
.openFile('circuits/.bin/simple_js')
44-
.waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/.bin/simple_js/simple.wasm"]')
44+
.waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/.bin/simple_js/simple.wasm"]')
4545
},
4646
'Should compute a witness for a simple circuit #group1': function (browser: NightwatchBrowser) {
4747
browser
@@ -118,12 +118,15 @@ module.exports = {
118118
.waitForElementPresent('[data-id="verticalIconsKindcircuit-compiler"]')
119119
.waitForElementVisible('[data-id="verticalIconsKindcircuit-compiler"]')
120120
.perform(function () {
121-
const actions = this.actions({async: true})
121+
const actions = this.actions({ async: true })
122122

123-
return actions.keyDown(this.Keys.CONTROL).sendKeys('s')
123+
actions.keyDown(this.Keys.CONTROL).sendKeys('s').perform()
124+
return actions.keyUp(this.Keys.CONTROL).perform()
124125
})
125-
.pause(2000)
126-
.openFile('circuits/.bin/simple_js/simple.wasm')
126+
.click('[data-id="treeViewDivtreeViewItemREADME.md"]')
127+
.waitForElementVisible('*[data-id="treeViewDivtreeViewItemcircuits/.bin/simple_js"]')
128+
.click('*[data-id="treeViewDivtreeViewItemcircuits/.bin/simple_js"]')
129+
// .openFile('circuits/.bin/simple_js/simple.wasm')
127130
.waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/.bin/simple_js/simple.wasm"]')
128131
.waitForElementVisible('[data-id="treeViewLitreeViewItemcircuits/.bin/simple_js/simple.wasm"]')
129132
},
@@ -178,7 +181,7 @@ module.exports = {
178181
'Should create a new workspace using hash checker template #group5 #group6': function (browser: NightwatchBrowser) {
179182
browser
180183
.clickLaunchIcon('filePanel')
181-
.click('*[data-id="workspacesMenuDropdown"]')
184+
.click('*[data-id="workspacesSelect"]')
182185
.click('*[data-id="workspacecreate"]')
183186
.waitForElementPresent('*[data-id="create-hashchecker"]')
184187
.scrollAndClick('*[data-id="create-hashchecker"]')

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module.exports = {
4646
browser
4747
.openFile('contracts/3_Ballot.sol')
4848
.click('[data-id="compile-dropdown-trigger"]')
49-
.waitForElementVisible('[data-id="compile-dropdown-panel"]', 5000)
49+
.waitForElementVisible('[data-id="compile-dropdown-panel"]', 5000)
5050
.click('[data-id="compile-run-analysis-menu-item"]')
5151
.waitForElementVisible('[data-id="compile-run-analysis-menu-item-panel"]', 5000)
5252
.click('[data-id="run-solidity-scan-submenu-item"]')
@@ -56,6 +56,4 @@ module.exports = {
5656
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Scan Summary:', 30000)
5757
.verifyContracts(['Ballot'])
5858
}
59-
60-
61-
}
59+
}

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
init(browser, done)
88
},
99
'@sources': () => sources,
10-
'Should flatten contract after creation': function (browser: NightwatchBrowser) {
10+
'Should flatten contract after creation': function (browser: NightwatchBrowser) {
1111
browser.addFile('TestContract.sol', sources[0]['TestContract.sol'])
1212
.pause(10000)
1313
.waitForElementVisible('*[data-id="treeViewLitreeViewItemTestContract.sol"]')
@@ -18,7 +18,7 @@ module.exports = {
1818
.waitForElementVisible('*[data-id="treeViewLitreeViewItemTestContract_flattened.sol"]')
1919
},
2020
'Should not be able to flatten contract without imports': function (browser: NightwatchBrowser) {
21-
browser.click('*[data-id="treeViewLitreeViewItemcontracts"]')
21+
browser.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]')
2222
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]')
2323
.pause(1000)
2424
.click('*[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]')
@@ -43,53 +43,53 @@ const sources = [
4343
content: `
4444
// SPDX-License-Identifier: MIT
4545
pragma solidity ^0.8.20;
46-
46+
4747
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
4848
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
4949
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Pausable.sol";
5050
import "@openzeppelin/contracts/access/Ownable.sol";
5151
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
52-
52+
5353
contract MyToken is ERC20, ERC20Burnable, ERC20Pausable, Ownable, ERC20Permit {
5454
constructor(address initialOwner)
5555
ERC20("MyToken", "MTK")
5656
Ownable(initialOwner)
5757
ERC20Permit("MyToken")
5858
{}
59-
59+
6060
function pause() public onlyOwner {
6161
_pause();
6262
}
63-
63+
6464
function unpause() public onlyOwner {
6565
_unpause();
6666
}
67-
67+
6868
function mint(address to, uint256 amount) public onlyOwner {
6969
_mint(to, amount);
7070
}
71-
71+
7272
// The following functions are overrides required by Solidity.
73-
73+
7474
function _update(address from, address to, uint256 value)
7575
internal
7676
override(ERC20, ERC20Pausable)
7777
{
7878
super._update(from, to, value);
7979
}
8080
}
81-
81+
8282
`
8383
},
84-
}
84+
}
8585
]
8686

8787
const content = `
8888
// SPDX-License-Identifier: GPL-3.0
8989
9090
pragma solidity >=0.7.0 <0.9.0;
9191
92-
/**
92+
/**
9393
* @title Ballot
9494
* @dev Implements voting process along with vote delegation
9595
*/
@@ -103,7 +103,7 @@ const content = `
103103
}
104104
105105
struct Proposal {
106-
// If you can limit the length to a certain number of bytes,
106+
// If you can limit the length to a certain number of bytes,
107107
// always use one of bytes1 to bytes32 because they are much cheaper
108108
bytes32 name; // short name (up to 32 bytes)
109109
uint voteCount; // number of accumulated votes
@@ -115,7 +115,7 @@ const content = `
115115
116116
Proposal[] public proposals;
117117
118-
/**
118+
/**
119119
* @dev Create a new ballot to choose one of 'proposalNames'.
120120
* @param proposalNames names of proposals
121121
*/
@@ -134,7 +134,7 @@ const content = `
134134
}
135135
}
136136
137-
/**
137+
/**
138138
* @dev Give 'voter' the right to vote on this ballot. May only be called by 'chairperson'.
139139
* @param voter address of voter
140140
*/
@@ -197,7 +197,7 @@ const content = `
197197
proposals[proposal].voteCount += sender.weight;
198198
}
199199
200-
/**
200+
/**
201201
* @dev Computes the winning proposal taking all previous votes into account.
202202
* @return winningProposal_ index of winning proposal in the proposals array
203203
*/
@@ -213,7 +213,7 @@ const content = `
213213
}
214214
}
215215
216-
/**
216+
/**
217217
* @dev Calls winningProposal() function to get the index of the winner contained in the proposals array and then
218218
* @return winnerName_ the name of the winner
219219
*/
@@ -223,4 +223,4 @@ const content = `
223223
winnerName_ = proposals[winningProposal()].name;
224224
}
225225
}
226-
`
226+
`

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
.waitForElementVisible('div[data-id="verticalIconsHomeIcon"]')
1313
.waitForElementVisible('div[plugin="filePanel"]')
1414
.waitForElementVisible('div[plugin="pluginManager"]')
15-
.waitForElementVisible('div[plugin="settings"]')
15+
.waitForElementVisible('*[data-id="topbar-settingsIcon"]')
1616
},
1717

1818
'Loads Side Panel': function (browser: NightwatchBrowser) {

0 commit comments

Comments
 (0)