From 522187408c4c440ef5845f6966df2291dc8fb5a4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 2 Mar 2018 09:52:47 +0100 Subject: [PATCH] add debug node ref --- remix-debugger/src/ui/Ethdebugger.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/remix-debugger/src/ui/Ethdebugger.js b/remix-debugger/src/ui/Ethdebugger.js index ba6aa7c71f..b799c0cc59 100644 --- a/remix-debugger/src/ui/Ethdebugger.js +++ b/remix-debugger/src/ui/Ethdebugger.js @@ -6,6 +6,8 @@ var TraceManager = remixCore.trace.TraceManager var VmDebugger = require('./VmDebugger') var remixLib = require('remix-lib') var global = remixLib.global +var init = remixLib.init +var executionContext = remixLib.execution.executionContext var EventManager = remixLib.EventManager var yo = require('yo-yo') var csjs = require('csjs-inject') @@ -97,6 +99,14 @@ Ethdebugger.prototype.switchProvider = function (type) { console.log('provider ' + type + ' not defined') } else { global.web3 = obj + executionContext.detectNetwork((error, network) => { + if (error || !network) { + global.web3Debug = obj + } else { + var webDebugNode = init.web3DebugNode(network.name) + global.web3Debug = !webDebugNode ? obj : webDebugNode + } + }) self.event.trigger('providerChanged', [type]) } })