pass getCode to SolidityProxy

pull/451/head
Iuri Matias 4 years ago
parent f5352f82c6
commit c37caa9dc6
  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.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({traceManager: this.traceManager, getCode: this.codeManager.getCode.bind(this.codeManager)})
this.storageResolver = null this.storageResolver = null
this.callTree = new InternalCallTree(this.event, this.traceManager, this.solidityProxy, this.codeManager, { includeLocalVariables: true }) 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 () { Ethdebugger.prototype.setManagers = function () {
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({traceManager: this.traceManager, getCode: this.codeManager.getCode.bind(this.codeManager)})
this.storageResolver = null this.storageResolver = null
this.callTree = new InternalCallTree(this.event, this.traceManager, this.solidityProxy, this.codeManager, { includeLocalVariables: true }) this.callTree = new InternalCallTree(this.event, this.traceManager, this.solidityProxy, this.codeManager, { includeLocalVariables: true })

@ -6,11 +6,11 @@ const astHelper = require('./astHelper')
const util = remixLib.util const util = remixLib.util
class SolidityProxy { class SolidityProxy {
constructor (traceManager, codeManager) { constructor ({traceManager, getCode}) {
this.cache = new Cache() this.cache = new Cache()
this.reset({}) this.reset({})
this.traceManager = traceManager this.traceManager = traceManager
this.codeManager = codeManager this.getCode = getCode
} }
/** /**
@ -44,7 +44,7 @@ class SolidityProxy {
if (this.cache.contractNameByAddress[address]) { if (this.cache.contractNameByAddress[address]) {
return this.cache.contractNameByAddress[address] return this.cache.contractNameByAddress[address]
} }
const code = await this.codeManager.getCode(address) const code = await this.getCode(address)
const contractName = contractNameFromCode(this.contracts, code.bytecode, address) const contractName = contractNameFromCode(this.contracts, code.bytecode, address)
this.cache.contractNameByAddress[address] = contractName this.cache.contractNameByAddress[address] = contractName
return contractName return contractName

@ -25,7 +25,7 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu
var traceManager = new TraceManager({web3: vm.web3}) var traceManager = new TraceManager({web3: vm.web3})
var codeManager = new CodeManager(traceManager) var codeManager = new CodeManager(traceManager)
codeManager.clear() codeManager.clear()
var solidityProxy = new SolidityProxy(traceManager, codeManager) var solidityProxy = new SolidityProxy({traceManager, getCode: codeManager.getCode.bind(codeManager)})
solidityProxy.reset(compilationResult) solidityProxy.reset(compilationResult)
var debuggerEvent = new EventManager() var debuggerEvent = new EventManager()
var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true }) 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 traceManager = new TraceManager({web3: vm.web3})
var codeManager = new CodeManager(traceManager) var codeManager = new CodeManager(traceManager)
codeManager.clear() codeManager.clear()
var solidityProxy = new SolidityProxy(traceManager, codeManager) var solidityProxy = new SolidityProxy({traceManager, getCode: codeManager.getCode.bind(codeManager)})
solidityProxy.reset(compilationResult) solidityProxy.reset(compilationResult)
var debuggerEvent = new EventManager() var debuggerEvent = new EventManager()
var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true }) 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 traceManager = new TraceManager({web3: vm.web3})
var codeManager = new CodeManager(traceManager) var codeManager = new CodeManager(traceManager)
codeManager.clear() codeManager.clear()
var solidityProxy = new SolidityProxy(traceManager, codeManager) var solidityProxy = new SolidityProxy({traceManager, getCode: codeManager.getCode.bind(codeManager)})
solidityProxy.reset(compilationResult) solidityProxy.reset(compilationResult)
var debuggerEvent = new EventManager() var debuggerEvent = new EventManager()
var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true }) 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 traceManager = new TraceManager({web3: vm.web3})
var codeManager = new CodeManager(traceManager) var codeManager = new CodeManager(traceManager)
codeManager.clear() codeManager.clear()
var solidityProxy = new SolidityProxy(traceManager, codeManager) var solidityProxy = new SolidityProxy({traceManager, getCode: codeManager.getCode.bind(codeManager)})
solidityProxy.reset(compilationResult) solidityProxy.reset(compilationResult)
var debuggerEvent = new EventManager() var debuggerEvent = new EventManager()
var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true }) var callTree = new InternalCallTree(debuggerEvent, traceManager, solidityProxy, codeManager, { includeLocalVariables: true })

Loading…
Cancel
Save