pass getCurrentCalledAddressAt to SolidityProxy

pull/451/head
Iuri Matias 4 years ago
parent 3203797861
commit 151c8bcc2b
  1. 4
      libs/remix-debug/src/Ethdebugger.js
  2. 6
      libs/remix-debug/src/solidity-decoder/solidityProxy.js
  3. 2
      libs/remix-debug/test/decoder/localsTests/int.js
  4. 2
      libs/remix-debug/test/decoder/localsTests/misc.js
  5. 2
      libs/remix-debug/test/decoder/localsTests/misc2.js
  6. 2
      libs/remix-debug/test/decoder/localsTests/structArray.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 })

@ -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]
}

@ -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 })

@ -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 })

@ -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 })

@ -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 })

Loading…
Cancel
Save