Commit c00a995d authored by yann300's avatar yann300

remove tx from traceManager

parent ecbfbf1b
......@@ -2,3 +2,4 @@ build
node_modules
npm-debug.log
lint.xml
.vscode
......@@ -57,7 +57,6 @@ module.exports = React.createClass({
this.setState({
tx: tx
})
traceManager.setTransaction(tx)
var self = this
traceManager.resolveTrace(blockNumber, txIndex, function (success) {
console.log('trace loaded ' + success)
......
......@@ -4,7 +4,8 @@ var BasicPanel = require('./basicPanel')
module.exports = React.createClass({
contextTypes: {
traceManager: React.PropTypes.object
traceManager: React.PropTypes.object,
tx: React.PropTypes.object
},
getDefaultProps: function () {
......@@ -30,7 +31,7 @@ module.exports = React.createClass({
if (window.ethDebuggerSelectedItem !== nextProps.currentStepIndex) return
var self = this
this.context.traceManager.getStorageAt(nextProps.currentStepIndex, function (storage) {
this.context.traceManager.getStorageAt(nextProps.currentStepIndex, this.context.tx.blockNumber.toString(), this.context.tx.transactionIndex, function (storage) {
if (window.ethDebuggerSelectedItem === nextProps.currentStepIndex) {
self.setState({
data: storage
......
......@@ -22,10 +22,6 @@ module.exports = {
this.web3 = web3
},
setTransaction: function (tx) {
this.transaction = tx
},
resolveTrace: function (blockNumber, txNumber, callback) {
this.isLoading = true
this.init()
......@@ -144,7 +140,7 @@ module.exports = {
callback(this.trace.length)
},
getStorageAt: function (stepIndex, callback) {
getStorageAt: function (stepIndex, blockNumber, txIndex, callback) {
var stoChange = this.findLowerBound(stepIndex, this.vmTraceChangesRef)
if (!stoChange) {
return {}
......@@ -153,7 +149,7 @@ module.exports = {
var changeRefs = this.vmTraceIndexByStorageChange[stoChange]
var address = this.storageChanges[changeRefs.context].address
var self = this
this.retrieveStorage(address, function (storage) {
this.retrieveStorage(address, blockNumber, txIndex, function (storage) {
for (var k = 0; k < changeRefs.context; k++) {
var context = self.storageChanges[k]
if (context.address === address) {
......@@ -319,13 +315,13 @@ module.exports = {
},
// retrieve the storage of an account just after the execution of tx
retrieveStorage: function (address, callBack) {
retrieveStorage: function (address, blockNumber, txIndex, callBack) {
if (this.storages[address]) {
callBack(this.storages[address])
}
var self = this
if (this.transaction) {
this.web3.debug.storageAt(this.transaction.blockNumber.toString(), this.transaction.transactionIndex, address, function (error, result) {
if (blockNumber !== null && txIndex !== null) {
this.web3.debug.storageAt(blockNumber, txIndex, address, function (error, result) {
if (error) {
console.log(error)
} else {
......@@ -334,7 +330,7 @@ module.exports = {
}
})
} else {
console.log('transaction is not defined')
console.log('blockNumber/txIndex are not defined')
}
}
}
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