From 90de6b28c04d9a6c9ebc09841b32c7c0c6637846 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Thu, 8 Oct 2020 06:59:37 -0400 Subject: [PATCH] remove unused file --- .../remix-debug/src/cmdline/contextManager.js | 57 ------------------- 1 file changed, 57 deletions(-) delete mode 100644 libs/remix-debug/src/cmdline/contextManager.js diff --git a/libs/remix-debug/src/cmdline/contextManager.js b/libs/remix-debug/src/cmdline/contextManager.js deleted file mode 100644 index f44af570d1..0000000000 --- a/libs/remix-debug/src/cmdline/contextManager.js +++ /dev/null @@ -1,57 +0,0 @@ -const remixLib = require('@remix-project/remix-lib') - -const EventManager = remixLib.EventManager -const Web3Providers = remixLib.vm.Web3Providers -const DummyProvider = remixLib.vm.DummyProvider -const init = remixLib.init - -class ContextManager { - constructor (executionContext) { - this.executionContext = executionContext - this.web3 = this.executionContext.web3() - this.event = new EventManager() - } - - initProviders () { - this.web3Providers = new Web3Providers() - this.addProvider('DUMMYWEB3', new DummyProvider()) - this.switchProvider('DUMMYWEB3') - - this.addProvider('vm', this.executionContext.vm()) - this.addProvider('injected', this.executionContext.internalWeb3()) - this.addProvider('web3', this.executionContext.internalWeb3()) - this.switchProvider(this.executionContext.getProvider()) - } - - getWeb3 () { - return this.web3 - } - - addProvider (type, obj) { - this.web3Providers.addProvider(type, obj) - this.event.trigger('providerAdded', [type]) - } - - switchProvider(type, cb) { - this.web3Providers.get(type, (error, obj) => { - if (error) { - return console.log('provider ' + type + ' not defined') - } - this.web3 = obj - this.executionContext.detectNetwork((error, network) => { - if (error || !network) { - this.web3 = obj - } else { - var webDebugNode = init.web3DebugNode(network.name) - this.web3 = (!webDebugNode ? obj : webDebugNode) - } - this.event.trigger('providerChanged', [type, this.web3]) - if (cb) return cb() - }) - this.event.trigger('providerChanged', [type, this.web3]) - }) - } - -} - -module.exports = ContextManager