Skip to content

Commit b236413

Browse files
authored
Merge pull request #4171 from ethereum/fix_mainnet_fork
Fix mainnet fork
2 parents 3ad9ab3 + fa82ae6 commit b236413

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ class ClickInstance extends EventEmitter {
55
command (this: NightwatchBrowser, index: number): NightwatchBrowser {
66
const selector = `[data-id="universalDappUiTitleExpander${index}"]`
77

8-
this.api.waitForElementPresent(selector).waitForElementContainsText(selector, '', 60000).scrollAndClick(selector).perform(() => { this.emit('complete') })
8+
this.api.waitForElementPresent({
9+
locateStrategy: 'css selector',
10+
selector,
11+
timeout: 60000
12+
}).waitForElementContainsText(selector, '', 60000).scrollAndClick(selector).perform(() => { this.emit('complete') })
913
return this
1014
}
1115
}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ class VerifyCallReturnValue extends EventEmitter {
1515
}
1616

1717
function verifyCallReturnValue (browser: NightwatchBrowser, address: string, checks: string[] | callbackCheckVerifyCallReturnValue, done: VoidFunction) {
18-
browser.execute(function (address: string) {
18+
browser
19+
.waitForElementVisible({
20+
locateStrategy: 'css selector',
21+
selector: '#instance' + address + ' [data-id="udapp_value"]',
22+
timeout: 240000
23+
})
24+
.execute(function (address: string) {
1925
const nodes = document.querySelectorAll('#instance' + address + ' [data-id="udapp_value"]') as NodeListOf<HTMLElement>
2026
const ret = []
2127
for (let k = 0; k < nodes.length; k++) {

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,23 @@ module.exports = {
291291
browser
292292
.clickLaunchIcon('udapp')
293293
.switchEnvironment('vm-mainnet-fork')
294+
.waitForElementPresent({
295+
locateStrategy: 'css selector',
296+
selector: 'select[data-id="runTabSelectAccount"] option[value="0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]',
297+
timeout: 240000
298+
})
294299
.executeScriptInTerminal(`web3.eth.getCode('0x180587b00c8642e2c7ac3a758712d97e6f7bdcc7')`) // mainnet contract
295300
.waitForElementContainsText('*[data-id="terminalJournal"]', '0x608060405260043610601f5760003560e01c80635c60da1b14603157602b565b36602b576029605f565b005b6029605f565b348015603c57600080fd5b5060436097565b6040516001600160a01b03909116815260200160405180910390f35b609560917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b60d1565b565b600060c97f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b90565b3660008037600080366000845af43d6000803e80801560ef573d6000f35b3d6000fdfea2646970667358221220969dbb4b1d8aec2bb348e26488dc1a33b6bcf0190f567d161312ab7ca9193d8d64736f6c63430008110033', 120000)
296301
},
297302

298303
'Should connect to the sepolia fork and run web3.eth.getCode in the terminal #group9': function (browser: NightwatchBrowser) {
299304
browser
300305
.switchEnvironment('vm-custom-fork')
306+
.waitForElementPresent({
307+
locateStrategy: 'css selector',
308+
selector: 'select[data-id="runTabSelectAccount"] option[value="0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]',
309+
timeout: 240000
310+
})
301311
.waitForElementPresent('[data-id="vm-custom-fork-modal-footer-ok-react"]')
302312
.execute(() => {
303313
(document.querySelector('*[data-id="vm-custom-forkModalDialogContainer-react"] input[data-id="CustomForkNodeUrl"]') as any).focus()

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,11 @@ module.exports = {
237237
.setSolidityCompilerVersion('soljson-v0.8.17+commit.8df45f5f.js')
238238
.clickLaunchIcon('udapp')
239239
.switchEnvironment('vm-mainnet-fork')
240-
.waitForElementPresent('select[data-id="runTabSelectAccount"] option[value="0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]') // wait for the udapp to load the list of accounts
240+
.waitForElementPresent({
241+
locateStrategy: 'css selector',
242+
selector: 'select[data-id="runTabSelectAccount"] option[value="0xdD870fA1b7C4700F2BD7f44238821C26f7392148"]',
243+
timeout: 240000
244+
}) // wait for the udapp to load the list of accounts
241245
.selectContract('MyResolver')
242246
.createContract('')
243247
.clickInstance(0)

apps/remix-ide/src/app/providers/mainnet-vm-fork-provider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class MainnetForkVMProvider extends BasicVMProvider {
1818
)
1919
this.blockchain = blockchain
2020
this.fork = 'shanghai'
21-
this.nodeUrl = 'https://mainnet.infura.io/v3/08b2a484451e4635a28b3d8234f24332'
21+
this.nodeUrl = 'https://mainnet.infura.io/v3/7eed077ab9ee45eebbb3f053af9ecb29'
2222
this.blockNumber = 'latest'
2323
}
2424

0 commit comments

Comments
 (0)