gremove old test resources

pull/7/head
yann300 9 years ago
parent e739723762
commit 1bb64cd210
  1. 18
      ci/browser_tests.sh
  2. 72
      ci/sauceDisconnect.js
  3. 5
      src/BasicPanel.js
  4. 2
      src/CalldataPanel.js
  5. 2
      src/CallstackPanel.js
  6. 2
      src/MemoryPanel.js
  7. 2
      src/StackPanel.js
  8. 2
      src/StoragePanel.js
  9. 22
      src/VmDebugger.js
  10. 1
      test-browser/index.js
  11. 77
      test-browser/init.js
  12. 178
      test-browser/vmdebugger.js
  13. 31
      test-browser/vmdebugger/loadTraceFound.js
  14. 25
      test-browser/vmdebugger/loadTraceNotFound.js
  15. 40
      test-browser/vmdebugger/panels.js
  16. 37
      test-browser/vmdebugger/slider.js
  17. 43
      test-browser/vmdebugger/stepping.js
  18. 39
      test-browser/vmdebugger/sticker.js
  19. 11
      test/codeManager.js
  20. 1
      test/resources/contractInvokationCode.js
  21. 2
      test/resources/contractInvokationTrace.js
  22. 2
      test/resources/contractInvokationTx.js
  23. 7
      test/traceManager.js

@ -1,10 +1,12 @@
#!/bin/bash
SAUCECONNECT_URL="http://saucelabs.com/downloads/sc-4.3.16-linux.tar.gz"
SAUCECONNECT_USERNAME="yann300"
SAUCECONNECT_ACCESSKEY="e6f430f2-daa0-48bb-90fd-8bee20f429eb"
SAUCECONNECT_JOBIDENTIFIER="remix_tests_${TRAVIS_JOB_NUMBER}"
SAUCECONNECT_READYFILE="sc.ready"
TEST_EXITCODE=0
npm run build
npm run serve &
@ -18,7 +20,17 @@ done
npm run nightwatch_remote_firefox
npm run nightwatch_remote_chrome
#npm run nightwatch_remote_safari
#npm run nightwatch_remote_ie
npm run nightwatch_remote_safari
npm run nightwatch_remote_ie
if [ $? -eq 1 ]
then
TEST_EXITCODE=1
fi
node ci/sauceDisconnect.js $SAUCECONNECT_USERNAME $SAUCECONNECT_ACCESSKEY $SAUCECONNECT_JOBIDENTIFIER
curl "http://saucelabs.com/rest/v1/${SAUCECONNECT_USERNAME}/tunnels/${SAUCECONNECT_JOBIDENTIFIER}" -u "${SAUCECONNECT_USERNAME}:${SAUCECONNECT_ACCESSKEY}" -X DELETE
if [ $TEST_EXITCODE -eq 1 ]
then
exit 1
fi

@ -0,0 +1,72 @@
const https = require('https')
var userName = process.argv[2]
var accessKey = process.argv[3]
var tunnelName = process.argv[4]
function removeTunnel () {
const requestPath = `/rest/v1/${userName}/tunnels`
console.log(requestPath)
callSauce(requestPath, 'GET', function (error, result) {
if (error) {
console.log(error)
} else {
var data = JSON.parse(result)
for (var k in data) {
retrieveTunnel(data[k], function (error, result) {
if (error) {
console.log(error)
} else if (result.identtifier === tunnelName) {
deleteTunnel(result.id, function () {
console.log('tunnel deleted ' + data[k] + ' ' + tunnelName)
})
}
})
}
}
})
}
function retrieveTunnel (tunnelid, callback) {
const requestPath = `/rest/v1/${userName}/tunnels/${tunnelid}`
callSauce(requestPath, 'GET', function (error, result) {
if (error) {
callback(error)
} else {
callback(null, {'identtifier': JSON.parse(result).tunnel_identifier, 'id': tunnelid})
}
})
}
function deleteTunnel (tunnelid, callback) {
const requestPath = `/rest/v1/${userName}/tunnels/${tunnelid}`
callSauce(requestPath, 'DELETE', callback)
}
function callSauce (requestPath, type, callback) {
function responseCallback (res) {
res.setEncoding('utf8')
console.log('Response: ', res.statusCode, JSON.stringify(res.headers))
res.on('data', function onData (chunk) {
console.log('BODY: ' + chunk)
callback(null, chunk)
})
res.on('end', function onEnd () {})
}
var req = https.request({
hostname: 'saucelabs.com',
path: requestPath,
method: type,
auth: userName + ':' + accessKey
}, responseCallback)
req.on('error', function onError (e) {
console.log('problem with request: ' + e.message)
callback(e.message)
})
req.write('')
req.end()
}
removeTunnel()

@ -3,9 +3,10 @@ var style = require('./styles/basicStyles')
var yo = require('yo-yo')
var ui = require('./helpers/ui')
function BasicPanel (_name) {
function BasicPanel (_name, _id) {
this.data
this.name = _name
this.id = _id
this.view
}
@ -20,7 +21,7 @@ BasicPanel.prototype.render = function () {
${this.name}
</div>
<div style=${ui.formatCss(style.panel.tableContainer)}>
<pre style=${ui.formatCss(style.panel.table, style.font)} id='basicpanel' >${this.data}</pre>
<pre style=${ui.formatCss(style.panel.table, style.font)} id='${this.id}basicpanel' >${this.data}</pre>
</div>
</div>`
if (!this.view) {

@ -5,7 +5,7 @@ var yo = require('yo-yo')
function CalldataPanel (_parent, _traceManager) {
this.parent = _parent
this.traceManager = _traceManager
this.basicPanel = new BasicPanel('Call Data')
this.basicPanel = new BasicPanel('Call Data', 'calldatapanel')
this.init()
}

@ -5,7 +5,7 @@ var yo = require('yo-yo')
function CallstackPanel (_parent, _traceManager) {
this.parent = _parent
this.traceManager = _traceManager
this.basicPanel = new BasicPanel('Call Stack')
this.basicPanel = new BasicPanel('Call Stack', 'callstackpanel')
this.init()
}

@ -6,7 +6,7 @@ var yo = require('yo-yo')
function MemoryPanel (_parent, _traceManager) {
this.parent = _parent
this.traceManager = _traceManager
this.basicPanel = new BasicPanel('Memory')
this.basicPanel = new BasicPanel('Memory', 'memorypanel')
this.init()
}

@ -6,7 +6,7 @@ var yo = require('yo-yo')
function StackPanel (_parent, _traceManager) {
this.parent = _parent
this.traceManager = _traceManager
this.basicPanel = new BasicPanel('Stack')
this.basicPanel = new BasicPanel('Stack', 'stackpanel')
this.init()
}

@ -5,7 +5,7 @@ var yo = require('yo-yo')
function StoragePanel (_parent, _traceManager) {
this.parent = _parent
this.traceManager = _traceManager
this.basicPanel = new BasicPanel('Storage Changes')
this.basicPanel = new BasicPanel('Storage Changes', 'storagepanel')
this.init()
}

@ -15,7 +15,7 @@ function VmDebugger (_parent, _traceManager, _web3) {
this.storagePanel = new StoragePanel(_parent, _traceManager)
this.memoryPanel = new MemoryPanel(_parent, _traceManager)
this.calldataPanel = new CalldataPanel(_parent, _traceManager)
this.CallstackPanel = new CallstackPanel(_parent, _traceManager)
this.callstackPanel = new CallstackPanel(_parent, _traceManager)
this.view
var self = this
_parent.register('newTraceLoaded', this, function () {
@ -35,25 +35,15 @@ VmDebugger.prototype.render = function () {
<td>
${this.asmCode.render()}
</td>
<td id='stackpanel'>
${this.stackPanel.render()}
</td>
${this.stackPanel.render()}
</tr>
<tr>
<td id='storagepanel'>
${this.storagePanel.render()}
</td>
<td id='memorypanel'>
${this.memoryPanel.render()}
</td>
${this.storagePanel.render()}
${this.memoryPanel.render()}
</tr>
<tr>
<td id='calldatapanel'>
${this.calldataPanel.render()}
</td>
<td id='callstackpanel'>
${this.CallstackPanel.render()}
</td>
${this.calldataPanel.render()}
${this.callstackPanel.render()}
</tr>
</tbody>
</table>

@ -1 +0,0 @@
require('./vmdebugger')

@ -110,17 +110,86 @@ function extendBrowser (browser) {
browser.assertCallStackValue = function (index, value) {
return assertPanelValue('#callstackpanel', browser, index, value)
}
browser.debugerKeyCode = {
'Enter': 13,
'Up': 38,
'Down': 40,
'Right': '39',
'Left': 37,
'Esc': 27,
'SpaceBar': 32,
'Ctrl': 17,
'Alt': 18,
'Shift': 16
}
/* browser.sendKeys is not working for safari */
/* still not working properly
browser.fireEvent = function (el, key, times, callback) {
var data = {
'id': el.substring(1),
'key': key,
'times': times
}
browser.execute(function (data) {
data = JSON.parse(data)
var el = document.getElementById(data.id)
var eventObj
console.log(el)
console.log(data)
var k = 0
if (document.createEventObject) {
eventObj = document.createEventObject()
eventObj.keyCode = data.key
while (k < data.times) {
console.log('firing brfore createEventObject')
el.fireEvent('onkeypress', eventObj)
console.log('firing')
k++
}
} else if (typeof (KeyboardEvent) === 'function') {
eventObj = new KeyboardEvent('keyup')
eventObj.key = data.key
eventObj.which = data.key
while (k < data.times) {
console.log('firing brfore createEvent')
el.dispatchEvent(eventObj)
console.log('firing')
k++
}
}
}, [JSON.stringify(data)], function () {
callback()
})
}
*/
}
function assertPanel (id, browser, value) {
browser.expect.element(id + ' #basicpanel').text.to.equal(value)
browser.expect.element(id + 'basicpanel').text.to.equal(value)
return browser
}
function assertPanelValue (id, browser, index, value, done) {
browser.getText(id + ' #basicpanel', function (result) {
var values = result.value.split('\n')
function assertPanelValue (id, browser, index, value) {
getInnerText(id + 'basicpanel', browser, function (result) {
var values
if (result.value.indexOf('\r\n') !== -1) {
values = result.value.split('\r\n')
} else if (result.value.indexOf('\n') !== -1) {
values = result.value.split('\n')
} else if (result.value.indexOf('\r') !== -1) {
values = result.value.split('\r')
}
browser.assert.equal(values[index], value)
})
return browser
}
function getInnerText (id, browser, callback) {
browser.execute(function (data) {
return document.getElementById(data).innerText
}, [id.substring(1)], function (result) {
callback(result)
})
}

@ -1,7 +1,173 @@
'use strict'
require('./vmdebugger/loadTraceNotFound')
require('./vmdebugger/loadTraceFound')
require('./vmdebugger/stepping')
require('./vmdebugger/slider')
require('./vmdebugger/sticker')
require('./vmdebugger/panels')
var init = require('./init')
var sauce = require('./sauce')
module.exports = {
beforeEach: function (browser, done) {
try {
init(browser, done)
} catch (e) {
var mes = 'error ' + e.message
console.log(mes)
done(mes)
}
},
'vmdebugger': function (browser) {
loadTrace(browser)
browser.click('#unload')
loadTraceNotFound(browser)
browser.click('#unload')
panels(browser)
browser.click('#unload')
slider(browser)
browser.click('#unload')
stepping(browser)
browser.click('#unload')
sticker(browser)
browser.end()
},
tearDown: sauce
}
function loadTrace (browser) {
browser
.clearValue('#txinput')
.setValue('#txinput', '0x20ef65b8b186ca942zcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load')
.assert.containsText('#txhash', '<not found>')
return browser
}
function loadTraceNotFound (browser) {
browser
.clearValue('#txinput')
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load')
.waitForElementVisible('#vmdebugger', 1000)
.expect.element('#txhash').text.to.equal('0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
browser.expect.element('#txfrom').text.to.equal('0x00101c5bfa3fc8bad02c9f5fd65b069306251915')
browser.expect.element('#txto').text.to.equal('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
browser.expect.element('#txto').text.to.equal('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
browser.click('#unload')
.waitForElementNotVisible('#vmdebugger', 1000)
return browser
}
function panels (browser) {
browser
.clearValue('#txinput')
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load')
.waitForElementVisible('#vmdebugger', 1000)
.click('#nextcall')
.assertStack('0x\n0x60\n0x65\n0x38\n0x55\n0x60fe47b1')
.assertStorageChanges('0x00 0x38')
.assertCallData('0x60fe47b10000000000000000000000000000000000000000000000000000000000000038')
.assertCallStack('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
.assertStackValue(1, '0x60')
.assertMemoryValue(6, '0xc0 60 60 60 40 52 60 40 51 60 20 80 60 45 83 39 81 ????R??Q????E?9?')
.assertMemoryValue(7, '0xe0 01 60 40 52 80 80 51 90 60 20 01 90 91 90 50 50 ???R??Q???????PP')
.assertMemoryValue(8, '0x100 5b 80 60 01 01 60 00 60 00 50 81 90 55 50 5b 50 ?????????P??UP?P')
.click('#intoforward') // CREATE
.assertStack('')
.assertStorageChanges('')
.assertMemory('')
.assertCallData('0x0000000000000000000000000000000000000000000000000000000000000000000000000000006060606040526040516020806045833981016040528080519060200190919050505b806001016000600050819055')
.assertCallStack('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5\n(Contract Creation - Step 63)')
return browser
}
function slider (browser) {
browser
.clearValue('#txinput')
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load')
.waitForElementVisible('#vmdebugger', 1000)
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
/*
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.LEFT_ARROW)
*/
.assertCurrentSelectedItem('041 PUSH 60fe47b1')
return browser
}
function stepping (browser) {
browser
.clearValue('#txinput')
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load')
.waitForElementVisible('#vmdebugger', 1000)
.click('#intoforward')
.click('#intoforward')
.assertCurrentSelectedItem('004 MSTORE')
.click('#intoforward')
.click('#intoback')
.click('#intoback')
.assertCurrentSelectedItem('002 PUSH 40')
.click('#nextcall')
.assertCurrentSelectedItem('181 CREATE')
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
.click('#overforward')
.assertCurrentSelectedItem('058 RETURN')
.click('#intoforward')
.click('#overback')
.assertCurrentSelectedItem('181 CREATE')
return browser
}
function sticker (browser) {
browser
.clearValue('#txinput')
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load')
.waitForElementVisible('#vmdebugger', 1000)
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
/*
.fireEvent('#slider', browser.debugerKeyCode.Right, 4, function () {
browser.assertSticker('6', '6', '', '3', '84476', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
.click('#nextcall')
.assertSticker('63', '63', '', '32000', '79283', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
.click('#intoforward')
.click('#overforward')
.assertSticker('108', '44', '', '0', '27145', '(Contract Creation - Step 63)')
.click('#intoforward')
.assertSticker('109', '64', '', '3', '25145', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
.end()
})
*/
.assertSticker('6', '6', '', '3', '84476', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
.click('#nextcall')
.assertSticker('63', '63', '', '32000', '79283', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
.click('#intoforward')
.click('#overforward')
.assertSticker('108', '44', '', '0', '27145', '(Contract Creation - Step 63)')
.click('#intoforward')
.assertSticker('109', '64', '', '3', '25145', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
return browser
}

@ -1,31 +0,0 @@
'use strict'
var init = require('../init')
var sauce = require('../sauce')
module.exports = {
beforeEach: function (browser, done) {
try {
init(browser, done)
} catch (e) {
var mes = 'error ' + e.message
console.log(mes)
done(mes)
}
},
'Load Trace - found': function (browser) {
browser
.clearValue('#txinput')
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load')
.waitForElementVisible('#vmdebugger', 1000)
.expect.element('#txhash').text.to.equal('0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
browser.expect.element('#txfrom').text.to.equal('0x00101c5bfa3fc8bad02c9f5fd65b069306251915')
browser.expect.element('#txto').text.to.equal('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
browser.expect.element('#txto').text.to.equal('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
browser.click('#unload')
.waitForElementNotVisible('#vmdebugger', 1000)
.end()
},
tearDown: sauce
}

@ -1,25 +0,0 @@
'use strict'
var init = require('../init')
var sauce = require('../sauce')
module.exports = {
beforeEach: function (browser, done) {
try {
init(browser, done)
} catch (e) {
var mes = 'error ' + e.message
console.log(mes)
done(mes)
}
},
'Load Trace - not found': function (browser) {
browser
.clearValue('#txinput')
.setValue('#txinput', '0x20ef65b8b186ca942zcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load')
.assert.containsText('#txhash', '<not found>')
.end()
},
tearDown: sauce
}

@ -1,40 +0,0 @@
'use strict'
var init = require('../init')
var sauce = require('../sauce')
module.exports = {
beforeEach: function (browser, done) {
try {
init(browser, done)
} catch (e) {
var mes = 'error ' + e.message
console.log(mes)
done(mes)
}
},
'Panels': function (browser, done) {
browser
.clearValue('#txinput')
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load')
.waitForElementVisible('#vmdebugger', 1000)
.click('#nextcall')
.assertStack('0x\n0x60\n0x65\n0x38\n0x55\n0x60fe47b1')
.assertStackValue(1, '0x60')
.assertStorageChanges('0x00 0x38')
.assertMemoryValue(6, '0xc0 60 60 60 40 52 60 40 51 60 20 80 60 45 83 39 81 ????R??Q????E?9?')
.assertMemoryValue(7, '0xe0 01 60 40 52 80 80 51 90 60 20 01 90 91 90 50 50 ???R??Q???????PP')
.assertMemoryValue(8, '0x100 5b 80 60 01 01 60 00 60 00 50 81 90 55 50 5b 50 ?????????P??UP?P')
.assertCallData('0x60fe47b10000000000000000000000000000000000000000000000000000000000000038')
.assertCallStack('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
.click('#intoforward') // CREATE
.assertStack('')
.assertStorageChanges('')
.assertMemory('')
.assertCallData('0x0000000000000000000000000000000000000000000000000000000000000000000000000000006060606040526040516020806045833981016040528080519060200190919050505b806001016000600050819055')
.assertCallStack('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5\n(Contract Creation - Step 63)')
.end()
},
tearDown: sauce
}

@ -1,37 +0,0 @@
'use strict'
var init = require('../init')
var sauce = require('../sauce')
module.exports = {
beforeEach: function (browser, done) {
try {
init(browser, done)
} catch (e) {
var mes = 'error ' + e.message
console.log(mes)
done(mes)
}
},
'Slider': function (browser) {
browser
.clearValue('#txinput')
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load')
.waitForElementVisible('#vmdebugger', 1000)
.click('#intoforward')
.click('#intoforward')
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.LEFT_ARROW)
.assertCurrentSelectedItem('041 PUSH 60fe47b1')
.end()
},
tearDown: sauce
}

@ -1,43 +0,0 @@
'use strict'
var init = require('../init')
var sauce = require('../sauce')
module.exports = {
beforeEach: function (browser, done) {
try {
init(browser, done)
} catch (e) {
var mes = 'error ' + e.message
console.log(mes)
done(mes)
}
},
'Stepping': function (browser) {
browser
.clearValue('#txinput')
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load')
.waitForElementVisible('#vmdebugger', 1000)
.click('#intoforward')
.click('#intoforward')
.assertCurrentSelectedItem('004 MSTORE')
.click('#intoforward')
.click('#intoback')
.click('#intoback')
.assertCurrentSelectedItem('002 PUSH 40')
.click('#nextcall')
.assertCurrentSelectedItem('181 CREATE')
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
.click('#intoforward')
.click('#overforward')
.assertCurrentSelectedItem('058 RETURN')
.click('#intoforward')
.click('#overback')
.assertCurrentSelectedItem('181 CREATE')
.end()
},
tearDown: sauce
}

@ -1,39 +0,0 @@
'use strict'
var init = require('../init')
var sauce = require('../sauce')
module.exports = {
beforeEach: function (browser, done) {
try {
init(browser, done)
} catch (e) {
var mes = 'error ' + e.message
console.log(mes)
done(mes)
}
},
'Sticker': function (browser) {
browser
.clearValue('#txinput')
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load')
.waitForElementVisible('#vmdebugger', 1000)
.click('#intoforward')
.click('#intoforward')
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.sendKeys('#slider', browser.Keys.RIGHT_ARROW)
.assertSticker('6', '6', '', '3', '84476', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
.click('#nextcall')
.assertSticker('63', '63', '', '32000', '79283', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
.click('#intoforward')
.click('#overforward')
.assertSticker('108', '44', '', '0', '27145', '(Contract Creation - Step 63)')
.click('#intoforward')
.assertSticker('109', '64', '', '3', '25145', '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
.end()
},
tearDown: sauce
}

@ -1,8 +1,6 @@
'use strict'
var tape = require('tape')
var init = require('../src/helpers/init')
var txInvokation = require('./resources/contractInvokationTx')
var contractCode = require('./resources/contractInvokationCode')
var TraceManager = require('../src/trace/traceManager')
var CodeManager = require('../src/code/codeManager')
var web3Test = require('./resources/testWeb3')
@ -14,8 +12,10 @@ tape('CodeManager', function (t) {
initWeb3.overrideWeb3(web3, web3Test)
var traceManager = new TraceManager(web3)
codeManager = new CodeManager(web3, traceManager)
var contractCode = web3.eth.getCode('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
codeManager.codeResolver.cacheExecutingCode('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', contractCode) // so a call to web3 is not necessary
traceManager.resolveTrace(txInvokation, function (error, result) {
var tx = web3.eth.getTransaction('0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
traceManager.resolveTrace(tx, function (error, result) {
if (error) {
t.fail(' - traceManager.resolveTrace - failed ' + result)
} else {
@ -54,8 +54,9 @@ function continueTesting (t, codeManager) {
}
}
})
codeManager.resolveStep(0, txInvokation)
codeManager.resolveStep(70, txInvokation)
var tx = codeManager.web3.eth.getTransaction('0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
codeManager.resolveStep(0, tx)
codeManager.resolveStep(70, tx)
})
t.test('CodeManager.getInstructionIndex', function (st) {

@ -1 +0,0 @@
module.exports = '0x60606040526000357c01000000000000000000000000000000000000000000000000000000009004806360fe47b11460415780636d4ce63c14605757603f565b005b605560048080359060200190919050506089565b005b606260048050506078565b6040518082815260200191505060405180910390f35b600060006000505490506086565b90565b80600060005081905550602d6040516045806100f083390180828152602001915050604051809103906000f0600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff02191690830217905550602281016000600050819055505b505660606040526040516020806045833981016040528080519060200190919050505b806001016000600050819055505b50600a80603b6000396000f360606040526008565b00'

File diff suppressed because one or more lines are too long

@ -1,2 +0,0 @@
module.exports =
{'blockHash':'0xd1d34932f8733e0485b7d9bf8500c4046d650f20ed7792508c304304fa7bbfac','blockNumber':89,'from':'0x00101c5bfa3fc8bad02c9f5fd65b069306251915','gas':105967,'gasPrice':'20000000000','hash':'0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51','input':'0x60fe47b10000000000000000000000000000000000000000000000000000000000000038','nonce':3,'to':'0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5','transactionIndex':0,'value':'0'}

@ -2,7 +2,6 @@
var TraceManager = require('../src/trace/traceManager')
var tape = require('tape')
var init = require('../src/helpers/init')
var txInvokation = require('./resources/contractInvokationTx')
var web3Test = require('./resources/testWeb3')
var initWeb3 = require('./init')
@ -17,7 +16,8 @@ tape('TraceManager', function (t) {
})
t.test('TraceManager.resolveTrace', function (st) {
traceManager.resolveTrace(txInvokation, function (error, result) {
var tx = traceManager.web3.eth.getTransaction('0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
traceManager.resolveTrace(tx, function (error, result) {
if (error) {
st.fail(' - traceManager.resolveTrace - failed ' + result)
} else {
@ -45,7 +45,8 @@ tape('TraceManager', function (t) {
})
t.test('TraceManager.getStorageAt', function (st) {
traceManager.getStorageAt(110, txInvokation, function (error, result) {
var tx = traceManager.web3.eth.getTransaction('0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
traceManager.getStorageAt(110, tx, function (error, result) {
if (error) {
st.fail(error)
} else {

Loading…
Cancel
Save