fix loading trace

pull/1/head
yann300 6 years ago
parent df3e3340dd
commit 88af44035e
  1. 3
      src/app/debugger/debugger.js
  2. 14
      src/app/debugger/remix-debugger/src/ui/TxBrowser.js

@ -101,8 +101,7 @@ Debugger.prototype.debug = function (txHash) {
this.debugger.web3.eth.getTransaction(txHash, function (error, tx) { this.debugger.web3.eth.getTransaction(txHash, function (error, tx) {
if (!error) { if (!error) {
self.debugger_ui.txBrowser.event.trigger('newTraceRequested', [undefined, undefined, tx]) self.debugger_ui.debug(tx)
self.debugger.debug(tx)
} }
}) })
} }

@ -73,13 +73,17 @@ TxBrowser.prototype.setDefaultValues = function () {
} }
} }
TxBrowser.prototype.submit = function () { TxBrowser.prototype.submit = function (tx) {
var self = this
self.event.trigger('newTxLoading', [this.blockNumber, this.txNumber])
if (tx) {
return self.update(null, tx)
}
if (!this.txNumber) { if (!this.txNumber) {
self.update('no tx index or tx hash to look for')
return return
} }
this.event.trigger('newTxLoading', [this.blockNumber, this.txNumber])
try { try {
var self = this
if (this.txNumber.indexOf('0x') !== -1) { if (this.txNumber.indexOf('0x') !== -1) {
self.web3.eth.getTransaction(this.txNumber, function (error, result) { self.web3.eth.getTransaction(this.txNumber, function (error, result) {
self.update(error, result) self.update(error, result)
@ -150,9 +154,9 @@ TxBrowser.prototype.updateTxN = function (ev) {
this.txNumber = ev.target.value this.txNumber = ev.target.value
} }
TxBrowser.prototype.load = function (txHash) { TxBrowser.prototype.load = function (txHash, tx) {
this.txNumber = txHash this.txNumber = txHash
this.submit() this.submit(tx)
} }
TxBrowser.prototype.unload = function (txHash) { TxBrowser.prototype.unload = function (txHash) {

Loading…
Cancel
Save