only keep the "merge" provider

pull/5370/head
yann300 2 years ago
parent 798e573c78
commit 9a66d1657e
  1. 2
      apps/remix-ide-e2e/src/tests/plugin_api.ts
  2. 2
      apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts
  3. 2
      apps/remix-ide-e2e/src/tests/terminal.test.ts
  4. 2
      apps/remix-ide-e2e/src/tests/transactionExecution.test.ts
  5. 8
      apps/remix-ide/src/app.js
  6. 2
      apps/remix-ide/src/app/providers/abstract-provider.tsx
  7. 25
      apps/remix-ide/src/app/providers/vm-provider.tsx
  8. 9
      apps/remix-ide/src/app/udapp/run-tab.js
  9. 6
      apps/remix-ide/src/blockchain/execution-context.js
  10. 11
      libs/remix-ui/run-tab/src/lib/components/account.tsx
  11. 4
      libs/remix-ui/run-tab/src/lib/reducers/runTab.ts

@ -183,7 +183,7 @@ module.exports = {
}, },
'Should select another provider #group1': async function (browser: NightwatchBrowser) { 'Should select another provider #group1': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'udapp:setEnvironmentMode', null, null, { context: 'vm-berlin' }) await clickAndCheckLog(browser, 'udapp:setEnvironmentMode', null, null, { context: 'vm-merge' })
await browser await browser
.frameParent() .frameParent()
.useCss() .useCss()

@ -32,7 +32,7 @@ module.exports = {
'Should sign message using account key #group2': function (browser: NightwatchBrowser) { 'Should sign message using account key #group2': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="settingsRemixRunSignMsg"]') browser.waitForElementVisible('*[data-id="settingsRemixRunSignMsg"]')
.switchEnvironment('vm-berlin') .switchEnvironment('vm-merge')
.pause(2000) .pause(2000)
.click('*[data-id="settingsRemixRunSignMsg"]') .click('*[data-id="settingsRemixRunSignMsg"]')
.pause(2000) .pause(2000)

@ -94,7 +94,7 @@ module.exports = {
browser browser
.clickLaunchIcon('settings') .clickLaunchIcon('settings')
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.switchEnvironment('vm-london') .switchEnvironment('vm-merge')
.click('*[data-id="terminalClearConsole"]') // clear the terminal .click('*[data-id="terminalClearConsole"]') // clear the terminal
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.click('*[data-id="treeViewDivtreeViewItem"]') // make sure we create the file at the root folder .click('*[data-id="treeViewDivtreeViewItem"]') // make sure we create the file at the root folder

@ -159,7 +159,7 @@ module.exports = {
browser browser
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.clearTransactions() .clearTransactions()
.switchEnvironment('vm-london') // switch to London fork .switchEnvironment('vm-merge') // switch to London fork
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite .selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') // this account will be used for this test suite
.click('.udapp_contractActionsContainerSingle > button') .click('.udapp_contractActionsContainerSingle > button')
.clickInstance(0) .clickInstance(0)

@ -27,7 +27,7 @@ import { StoragePlugin } from './app/plugins/storage'
import { Layout } from './app/panels/layout' import { Layout } from './app/panels/layout'
import { NotificationPlugin } from './app/plugins/notification' import { NotificationPlugin } from './app/plugins/notification'
import { Blockchain } from './blockchain/blockchain.js' import { Blockchain } from './blockchain/blockchain.js'
import { BerlinVMProvider, LondonVMProvider } from './app/providers/vm-provider' import { MergeVMProvider } from './app/providers/vm-provider'
import { MainnetForkVMProvider } from './app/providers/mainnet-vm-fork-provider' import { MainnetForkVMProvider } from './app/providers/mainnet-vm-fork-provider'
import { SepoliaForkVMProvider } from './app/providers/sepolia-vm-fork-provider' import { SepoliaForkVMProvider } from './app/providers/sepolia-vm-fork-provider'
import { GoerliForkVMProvider } from './app/providers/goerli-vm-fork-provider' import { GoerliForkVMProvider } from './app/providers/goerli-vm-fork-provider'
@ -211,8 +211,7 @@ class AppComponent {
const vmProviderMainnetFork = new MainnetForkVMProvider(blockchain) const vmProviderMainnetFork = new MainnetForkVMProvider(blockchain)
const vmProviderSepoliaFork = new SepoliaForkVMProvider(blockchain) const vmProviderSepoliaFork = new SepoliaForkVMProvider(blockchain)
const vmProviderGoerliFork = new GoerliForkVMProvider(blockchain) const vmProviderGoerliFork = new GoerliForkVMProvider(blockchain)
const vmProviderBerlin = new BerlinVMProvider(blockchain) const vmProviderMerge = new MergeVMProvider(blockchain)
const vmProviderLondon = new LondonVMProvider(blockchain)
const hardhatProvider = new HardhatProvider(blockchain) const hardhatProvider = new HardhatProvider(blockchain)
const ganacheProvider = new GanacheProvider(blockchain) const ganacheProvider = new GanacheProvider(blockchain)
const foundryProvider = new FoundryProvider(blockchain) const foundryProvider = new FoundryProvider(blockchain)
@ -279,8 +278,7 @@ class AppComponent {
fetchAndCompile, fetchAndCompile,
dGitProvider, dGitProvider,
storagePlugin, storagePlugin,
vmProviderBerlin, vmProviderMerge,
vmProviderLondon,
vmProviderSepoliaFork, vmProviderSepoliaFork,
vmProviderGoerliFork, vmProviderGoerliFork,
vmProviderMainnetFork, vmProviderMainnetFork,

@ -113,7 +113,7 @@ export abstract class AbstractProvider extends Plugin implements IProvider {
} }
this.call('notification', 'alert', modalContent) this.call('notification', 'alert', modalContent)
} }
await this.call('udapp', 'setEnvironmentMode', { context: 'vm-london'}) await this.call('udapp', 'setEnvironmentMode', { context: 'vm-merge'})
return return
} }

@ -42,32 +42,17 @@ export class BasicVMProvider extends Plugin implements IProvider {
} }
} }
export class BerlinVMProvider extends BasicVMProvider { export class MergeVMProvider extends BasicVMProvider {
constructor (blockchain) { constructor (blockchain) {
super({ super({
name: 'vm-berlin', name: 'vm-merge',
displayName: 'Remix VM (Berlin)', displayName: 'Remix VM (Merge)',
kind: 'provider', kind: 'provider',
description: 'Remix VM (Berlin)', description: 'Remix VM (Merge)',
methods: ['sendAsync', 'init'], methods: ['sendAsync', 'init'],
version: packageJson.version version: packageJson.version
}, blockchain) }, blockchain)
this.blockchain = blockchain this.blockchain = blockchain
this.fork = 'berlin' this.fork = 'merge'
}
}
export class LondonVMProvider extends BasicVMProvider {
constructor (blockchain) {
super({
name: 'vm-london',
displayName: 'Remix VM (London)',
kind: 'provider',
description: 'Remix VM (London)',
methods: ['sendAsync', 'init'],
version: packageJson.version
}, blockchain)
this.blockchain = blockchain
this.fork = 'london'
} }
} }

@ -133,11 +133,10 @@ export class RunTab extends ViewPlugin {
// VM // VM
const titleVM = 'Execution environment is local to Remix. Data is only saved to browser memory and will vanish upon reload.' const titleVM = 'Execution environment is local to Remix. Data is only saved to browser memory and will vanish upon reload.'
await addProvider('vm-london', 'Remix VM (London)', false, true, 'london', 'settingsVMLondonMode', titleVM) await addProvider('vm-merge', 'Remix VM (Merge)', false, true, 'merge', 'settingsVMMergeMode', titleVM)
await addProvider('vm-berlin', 'Remix VM (Berlin)', false, true, 'berlin', 'settingsVMBerlinMode', titleVM) await addProvider('vm-mainnet-fork', 'Remix VM - Mainnet fork', false, true, 'merge', 'settingsVMMainnetMode', titleVM)
await addProvider('vm-mainnet-fork', 'Remix VM - Mainnet fork', false, true, 'london', 'settingsVMMainnetMode', titleVM) await addProvider('vm-sepolia-fork', 'Remix VM - Sepolia fork', false, true, 'merge', 'settingsVMSepoliaMode', titleVM)
await addProvider('vm-sepolia-fork', 'Remix VM - Sepolia fork', false, true, '', 'settingsVMSepoliaMode', titleVM) await addProvider('vm-goerli-fork', 'Remix VM - Goerli fork', false, true, 'merge', 'settingsVMGoerliMode', titleVM)
await addProvider('vm-goerli-fork', 'Remix VM - Goerli fork', false, true, '', 'settingsVMGoerliMode', titleVM)
await addProvider('vm-custom-fork', 'Remix VM - Custom fork', false, true, '', 'settingsVMCustomMode', titleVM) await addProvider('vm-custom-fork', 'Remix VM - Custom fork', false, true, '', 'settingsVMCustomMode', titleVM)
// external provider // external provider

@ -20,7 +20,7 @@ if (typeof window !== 'undefined' && typeof window.ethereum !== 'undefined') {
export class ExecutionContext { export class ExecutionContext {
constructor () { constructor () {
this.event = new EventManager() this.event = new EventManager()
this.executionContext = 'vm-london' this.executionContext = 'vm-merge'
this.lastBlock = null this.lastBlock = null
this.blockGasLimitDefault = 4300000 this.blockGasLimitDefault = 4300000
this.blockGasLimit = this.blockGasLimitDefault this.blockGasLimit = this.blockGasLimitDefault
@ -35,7 +35,7 @@ export class ExecutionContext {
init (config) { init (config) {
if (config.get('settings/always-use-vm')) { if (config.get('settings/always-use-vm')) {
this.executionContext = 'vm-london' this.executionContext = 'vm-merge'
} }
} }
@ -102,7 +102,7 @@ export class ExecutionContext {
removeProvider (name) { removeProvider (name) {
if (name && this.customNetWorks[name]) { if (name && this.customNetWorks[name]) {
if (this.executionContext === name) this.setContext('vm-london', null, null, null) if (this.executionContext === name) this.setContext('vm-merge', null, null, null)
delete this.customNetWorks[name] delete this.customNetWorks[name]
this.event.trigger('removeProvider', [name]) this.event.trigger('removeProvider', [name])
} }

@ -30,14 +30,7 @@ export function AccountUI (props: AccountProps) {
}) })
break break
case 'vm-london': case 'vm-merge':
setPlusOpt({
classList: '',
title: 'Create a new account'
})
break
case 'vm-berlin':
setPlusOpt({ setPlusOpt({
classList: '', classList: '',
title: 'Create a new account' title: 'Create a new account'
@ -76,7 +69,7 @@ export function AccountUI (props: AccountProps) {
return props.tooltip('Account list is empty, please make sure the current provider is properly connected to remix') return props.tooltip('Account list is empty, please make sure the current provider is properly connected to remix')
} }
if (props.selectExEnv !== 'vm-london' && props.selectExEnv !== 'vm-berlin' && props.selectExEnv !== 'injected') { if (props.selectExEnv !== 'vm-merge' && props.selectExEnv !== 'injected') {
return props.modal('Passphrase to sign a message', return props.modal('Passphrase to sign a message',
<PassphrasePrompt <PassphrasePrompt
message='Enter your passphrase for this account to sign the message' message='Enter your passphrase for this account to sign the message'

@ -115,7 +115,7 @@ export const runTabInitialState: RunTabState = {
sendValue: '0', sendValue: '0',
sendUnit: 'wei', sendUnit: 'wei',
gasLimit: 3000000, gasLimit: 3000000,
selectExEnv: 'vm-london', selectExEnv: 'vm-merge',
personalMode: false, personalMode: false,
networkName: 'VM', networkName: 'VM',
providers: { providers: {
@ -263,7 +263,7 @@ export const runTabReducer = (state: RunTabState = runTabInitialState, action: A
return { return {
...state, ...state,
selectExEnv: payload, selectExEnv: payload,
networkName: state.selectExEnv === 'vm-london' || state.selectExEnv === 'vm-berlin' ? 'VM' : state.networkName, networkName: state.selectExEnv === 'vm-merge' ? 'VM' : state.networkName,
accounts: { accounts: {
...state.accounts, ...state.accounts,
selectedAccount: '', selectedAccount: '',

Loading…
Cancel
Save