diff --git a/libs/remix-debug/src/Ethdebugger.js b/libs/remix-debug/src/Ethdebugger.js index e2fab2af4b..d15d55458f 100644 --- a/libs/remix-debug/src/Ethdebugger.js +++ b/libs/remix-debug/src/Ethdebugger.js @@ -33,7 +33,7 @@ function Ethdebugger (opts) { this.traceManager = new TraceManager({web3: this.web3}) this.codeManager = new CodeManager(this.traceManager) - this.solidityProxy = new SolidityProxy({traceManager: this.traceManager, getCode: this.codeManager.getCode.bind(this.codeManager)}) + this.solidityProxy = new SolidityProxy({getCurrentCalledAddressAt: this.traceManager.getCurrentCalledAddressAt.bind(this.traceManager), getCode: this.codeManager.getCode.bind(this.codeManager)}) this.storageResolver = null this.callTree = new InternalCallTree(this.event, this.traceManager, this.solidityProxy, this.codeManager, { includeLocalVariables: true }) @@ -42,7 +42,7 @@ function Ethdebugger (opts) { Ethdebugger.prototype.setManagers = function () { this.traceManager = new TraceManager({web3: this.web3}) this.codeManager = new CodeManager(this.traceManager) - this.solidityProxy = new SolidityProxy({traceManager: this.traceManager, getCode: this.codeManager.getCode.bind(this.codeManager)}) + this.solidityProxy = new SolidityProxy({getCurrentCalledAddressAt: this.traceManager.getCurrentCalledAddressAt.bind(this.traceManager), getCode: this.codeManager.getCode.bind(this.codeManager)}) this.storageResolver = null this.callTree = new InternalCallTree(this.event, this.traceManager, this.solidityProxy, this.codeManager, { includeLocalVariables: true }) diff --git a/libs/remix-debug/src/solidity-decoder/solidityProxy.js b/libs/remix-debug/src/solidity-decoder/solidityProxy.js index a0cb434064..ac3d7052cb 100644 --- a/libs/remix-debug/src/solidity-decoder/solidityProxy.js +++ b/libs/remix-debug/src/solidity-decoder/solidityProxy.js @@ -6,10 +6,10 @@ const astHelper = require('./astHelper') const util = remixLib.util class SolidityProxy { - constructor ({traceManager, getCode}) { + constructor ({getCurrentCalledAddressAt, getCode}) { this.cache = new Cache() this.reset({}) - this.traceManager = traceManager + this.getCurrentCalledAddressAt = getCurrentCalledAddressAt this.getCode = getCode } @@ -40,7 +40,7 @@ class SolidityProxy { * @param {Function} cb - callback returns (error, contractName) */ async contractNameAt (vmTraceIndex) { - const address = this.traceManager.getCurrentCalledAddressAt(vmTraceIndex) + const address = this.getCurrentCalledAddressAt(vmTraceIndex) if (this.cache.contractNameByAddress[address]) { return this.cache.contractNameByAddress[address] } diff --git a/libs/remix-debug/test/decoder/localsTests/int.js b/libs/remix-debug/test/decoder/localsTests/int.js index 2df841237b..56bd0a249b 100644 --- a/libs/remix-debug/test/decoder/localsTests/int.js +++ b/libs/remix-debug/test/decoder/localsTests/int.js @@ -25,7 +25,7 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu var traceManager = new TraceManager({ web3: vm.web3 }) var codeManager = new CodeManager(traceManager) codeManager.clear() - var solidityProxy = new SolidityProxy({ traceManager, getCode: codeManager.getCode.bind(codeManager) }) + var solidityProxy = new SolidityProxy({ getCurrentCalledAddressAt: traceManager.getCurrentCalledAddressAt.bind(traceManager), getCode: codeManager.getCode.bind(codeManager) }) solidityProxy.reset(compilationResult) var debuggerEvent = new EventManager() var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true }) diff --git a/libs/remix-debug/test/decoder/localsTests/misc.js b/libs/remix-debug/test/decoder/localsTests/misc.js index 5286b82de9..283981bccb 100644 --- a/libs/remix-debug/test/decoder/localsTests/misc.js +++ b/libs/remix-debug/test/decoder/localsTests/misc.js @@ -22,7 +22,7 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu var traceManager = new TraceManager({ web3: vm.web3 }) var codeManager = new CodeManager(traceManager) codeManager.clear() - var solidityProxy = new SolidityProxy({ traceManager, getCode: codeManager.getCode.bind(codeManager) }) + var solidityProxy = new SolidityProxy({ getCurrentCalledAddressAt: traceManager.getCurrentCalledAddressAt.bind(traceManager), getCode: codeManager.getCode.bind(codeManager) }) solidityProxy.reset(compilationResult) var debuggerEvent = new EventManager() var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true }) diff --git a/libs/remix-debug/test/decoder/localsTests/misc2.js b/libs/remix-debug/test/decoder/localsTests/misc2.js index b5883c4d57..2380e1963c 100644 --- a/libs/remix-debug/test/decoder/localsTests/misc2.js +++ b/libs/remix-debug/test/decoder/localsTests/misc2.js @@ -23,7 +23,7 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu var traceManager = new TraceManager({ web3: vm.web3 }) var codeManager = new CodeManager(traceManager) codeManager.clear() - var solidityProxy = new SolidityProxy({ traceManager, getCode: codeManager.getCode.bind(codeManager) }) + var solidityProxy = new SolidityProxy({ getCurrentCalledAddressAt: traceManager.getCurrentCalledAddressAt.bind(traceManager), getCode: codeManager.getCode.bind(codeManager) }) solidityProxy.reset(compilationResult) var debuggerEvent = new EventManager() var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true }) diff --git a/libs/remix-debug/test/decoder/localsTests/structArray.js b/libs/remix-debug/test/decoder/localsTests/structArray.js index 022e3d9192..35a0f4cf50 100644 --- a/libs/remix-debug/test/decoder/localsTests/structArray.js +++ b/libs/remix-debug/test/decoder/localsTests/structArray.js @@ -22,7 +22,7 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu var traceManager = new TraceManager({ web3: vm.web3 }) var codeManager = new CodeManager(traceManager) codeManager.clear() - var solidityProxy = new SolidityProxy({ traceManager, getCode: codeManager.getCode.bind(codeManager) }) + var solidityProxy = new SolidityProxy({ getCurrentCalledAddressAt: traceManager.getCurrentCalledAddressAt.bind(traceManager), getCode: codeManager.getCode.bind(codeManager) }) solidityProxy.reset(compilationResult) var debuggerEvent = new EventManager() var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true })