Commit 7fee4f36 authored by Iuri Matias's avatar Iuri Matias

move setManagers to debugger; cleanup

parent dd209448
...@@ -40,10 +40,6 @@ function Ethdebugger (opts) { ...@@ -40,10 +40,6 @@ function Ethdebugger (opts) {
this.tx this.tx
// this.web3Providers = new Web3Providers()
// this.addProvider('DUMMYWEB3', new DummyProvider())
// this.switchProvider('DUMMYWEB3')
this.traceManager = new TraceManager({web3: this.web3}) this.traceManager = new TraceManager({web3: this.web3})
this.codeManager = new CodeManager(this.traceManager) this.codeManager = new CodeManager(this.traceManager)
this.solidityProxy = new SolidityProxy(this.traceManager, this.codeManager) this.solidityProxy = new SolidityProxy(this.traceManager, this.codeManager)
...@@ -160,45 +156,12 @@ Ethdebugger.prototype.storageViewAt = function (step, address) { ...@@ -160,45 +156,12 @@ Ethdebugger.prototype.storageViewAt = function (step, address) {
address: address address: address
}, this.storageResolver, this.traceManager) }, this.storageResolver, this.traceManager)
} }
/* set env */
// Ethdebugger.prototype.web3 = function () {
// return this.web3
// }
Ethdebugger.prototype.updateWeb3 = function (web3) { Ethdebugger.prototype.updateWeb3 = function (web3) {
this.web3 = web3 this.web3 = web3
this.setManagers()
} }
// Ethdebugger.prototype.addProvider = function (type, obj) {
// this.web3Providers.addProvider(type, obj)
// this.event.trigger('providerAdded', [type])
// }
//
// Ethdebugger.prototype.switchProvider = function (type) {
// var self = this
// this.web3Providers.get(type, function (error, obj) {
// if (error) {
// console.log('provider ' + type + ' not defined')
// } else {
// self.web3 = obj
// self.setManagers()
// // self.traceManager.web3 = self.web3
// self.executionContext.detectNetwork((error, network) => {
// if (error || !network) {
// self.web3Debug = obj
// self.web3 = obj
// } else {
// var webDebugNode = init.web3DebugNode(network.name)
// self.web3Debug = !webDebugNode ? obj : webDebugNode
// self.web3 = !webDebugNode ? obj : webDebugNode
// }
// self.setManagers()
// })
// self.event.trigger('providerChanged', [type])
// }
// })
// }
Ethdebugger.prototype.debug = function (tx) { Ethdebugger.prototype.debug = function (tx) {
this.setCompilationResult(this.opts.compilationResult()) this.setCompilationResult(this.opts.compilationResult())
if (tx instanceof Object) { if (tx instanceof Object) {
......
...@@ -79,22 +79,14 @@ Debugger.prototype.switchProvider = function (type) { ...@@ -79,22 +79,14 @@ Debugger.prototype.switchProvider = function (type) {
if (error) { if (error) {
console.log('provider ' + type + ' not defined') console.log('provider ' + type + ' not defined')
} else { } else {
//self.web3 = obj
self.debugger.updateWeb3(obj) self.debugger.updateWeb3(obj)
self.debugger.setManagers()
// self.traceManager.web3 = self.web3
self.executionContext.detectNetwork((error, network) => { self.executionContext.detectNetwork((error, network) => {
if (error || !network) { if (error || !network) {
// self.web3Debug = obj
// self.web3 = obj
self.debugger.updateWeb3(obj) self.debugger.updateWeb3(obj)
} else { } else {
var webDebugNode = init.web3DebugNode(network.name) var webDebugNode = init.web3DebugNode(network.name)
// self.web3Debug = !webDebugNode ? obj : webDebugNode
// self.web3 = !webDebugNode ? obj : webDebugNode
self.debugger.updateWeb3(!webDebugNode ? obj : webDebugNode) self.debugger.updateWeb3(!webDebugNode ? obj : webDebugNode)
} }
self.debugger.setManagers()
}) })
self.event.trigger('providerChanged', [type]) self.event.trigger('providerChanged', [type])
} }
...@@ -103,9 +95,6 @@ Debugger.prototype.switchProvider = function (type) { ...@@ -103,9 +95,6 @@ Debugger.prototype.switchProvider = function (type) {
Debugger.prototype.registerAndHighlightCodeItem = function (index) { Debugger.prototype.registerAndHighlightCodeItem = function (index) {
const self = this const self = this
// register selected code item, highlight the corresponding source location // register selected code item, highlight the corresponding source location
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment