pull/7/head
yann300 8 years ago
parent a8e008432d
commit 5238b8c862
  1. 3
      src/ui/TxBrowser.js
  2. 5
      src/ui/VmDebugger.js
  3. 10
      test-browser/init.js
  4. 27
      test-browser/vmdebugger.js

@ -36,8 +36,7 @@ TxBrowser.prototype.setDefaultValues = function () {
this.blockNumber = ''
this.txNumber = ''
this.connectInfo = ''
this.basicPanel.data = {}
this.basicPanel.update()
this.basicPanel.update({})
this.basicPanel.hide()
this.updateWeb3Url(util.web3.currentProvider.host)
if (this.view) {

@ -30,11 +30,10 @@ function VmDebugger (_parent, _traceManager, _codeManager, _solidityProxy, _call
var self = this
_traceManager.getReturnValue(index, function (error, returnValue) {
if (error) {
self.data = [error]
self.update([error])
} else if (_parent.currentStepIndex === index) {
self.data = [returnValue]
self.update([returnValue])
}
self.update()
})
})
/* Return values - */

@ -32,7 +32,7 @@ function extendBrowser (browser) {
}
browser.assertStepDetail = function (vmtracestepinfo, stepinfo, addmemoryinfo, gasinfo, remaininggasinfo, loadedaddressinfo) {
assertPanel('#stepdetail', browser, ['vmtracestep' + vmtracestepinfo, 'executionstep' + stepinfo, 'addmemory' + addmemoryinfo, 'gas' + gasinfo, 'remaininggas' + remaininggasinfo, 'loadedaddress' + loadedaddressinfo])
assertPanel('#stepdetail', browser, ['vmtracestep:' + vmtracestepinfo, 'executionstep:' + stepinfo, 'addmemory:' + addmemoryinfo, 'gas:' + gasinfo, 'remaininggas:' + remaininggasinfo, 'loadedaddress:' + loadedaddressinfo])
return browser
}
@ -141,8 +141,12 @@ function assertPanel (id, browser, value) {
return ret
}, [id, selector], function (returnValues) {
value.map(function (item, index) {
var testValue = returnValues.value[index].replace(/\r\n/g, '').replace(/\t/g, '').replace(/\s/g, '')
browser.assert.equal(testValue, value[index])
if (returnValues.value.length) {
var testValue = returnValues.value[index].replace(/\r\n/g, '').replace(/\t/g, '').replace(/\s/g, '')
browser.assert.equal(testValue, value[index])
} else {
browser.assert.equal(item, '')
}
})
})
return browser

@ -63,21 +63,20 @@ function panels (browser) {
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load')
.click('#nextcall')
.assertStack(['0x', '0x60', '0x65', '0x38', '0x55', '0x60fe47b1'])
.pause(5000)
.assertStorageChanges(['0x000x38'])
.assertCallData(['0x60fe47b10000000000000000000000000000000000000000000000000000000000000038'])
.assertCallStack(['0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5'])
.assertStackValue(1, '0x60')
.assertMemoryValue(6, '0x6060606040526040516020806045833981????R??Q????E?9?')
.assertMemoryValue(7, '0x7001604052808051906020019091905050???R??Q???????PP')
.assertMemoryValue(8, '0x805b806001016000600050819055505b50?????????P??UP?P')
.assertStack(['0:0x', '1:0x60', '2:0x65', '3:0x38', '4:0x55', '5:0x60fe47b1'])
.assertStorageChanges(['0x00:0x38'])
.assertCallData(['0:0x60fe47b10000000000000000000000000000000000000000000000000000000000000038'])
.assertCallStack(['0:0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5'])
.assertStackValue(1, '1:0x60')
.assertMemoryValue(6, '0x60:60606040526040516020806045833981????R??Q????E?9?')
.assertMemoryValue(7, '0x70:01604052808051906020019091905050???R??Q???????PP')
.assertMemoryValue(8, '0x80:5b806001016000600050819055505b50?????????P??UP?P')
.click('#intoforward') // CREATE
.assertStack(['Empty'])
.assertStorageChanges(['Empty'])
.assertMemory(['Empty'])
.assertCallData(['0x0000000000000000000000000000000000000000000000000000000000000000000000000000006060606040526040516020806045833981016040528080519060200190919050505b806001016000600050819055'])
.assertCallStack(['0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', '(ContractCreation-Step63)'])
.assertStack([''])
.assertStorageChanges([''])
.assertMemory([''])
.assertCallData(['0:0x0000000000000000000000000000000000000000000000000000000000000000000000000000006060606040526040516020806045833981016040528080519060200190919050505b806001016000600050819055'])
.assertCallStack(['0:0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', '1:(ContractCreation-Step63)'])
return browser
}

Loading…
Cancel
Save