pull/7/head
yann300 9 years ago
parent cf76ba2743
commit 41ed3e48d1
  1. 20
      npm-debug.log.2094563598
  2. 2
      src/VmDebugger.js
  3. 1
      src/trace/traceAnalyser.js
  4. 5
      src/trace/traceManager.js
  5. 23
      test/traceManager.js

@ -0,0 +1,20 @@
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'config', 'get', 'prefix' ]
2 info using npm@3.8.6
3 info using node@v5.12.0
4 verbose exit [ 0, true ]
5 verbose stack Error: write EPIPE
5 verbose stack at exports._errnoException (util.js:893:11)
5 verbose stack at WriteWrap.afterWrite (net.js:783:14)
6 verbose cwd /home/yann/Ethereum/remix/fea1/remix
7 error Linux 3.16.0-30-generic
8 error argv "/usr/bin/nodejs" "/usr/bin/npm" "config" "get" "prefix"
9 error node v5.12.0
10 error npm v3.8.6
11 error code EPIPE
12 error errno EPIPE
13 error syscall write
14 error write EPIPE
15 error If you need help, you may report this error at:
15 error <https://github.com/npm/npm/issues>
16 verbose exit [ 1, true ]

@ -88,7 +88,7 @@ VmDebugger.prototype.render = function () {
<td>
${this.callstackPanel.render()}
</td>
</tr>
</tr>
</tbody>
</table>
</div>

@ -40,6 +40,7 @@ TraceAnalyser.prototype.buildReturnValues = function (index, step) {
var offset = 2 * parseInt(step.stack[step.stack.length - 1], 16)
var size = 2 * parseInt(step.stack[step.stack.length - 2], 16)
var memory = this.trace[this.traceCache.memoryChanges[this.traceCache.memoryChanges.length - 1]].memory
console.log('push returnValue ' + index)
this.traceCache.pushReturnValue(index, '0x' + memory.join('').substr(offset, size))
}
}

@ -109,8 +109,9 @@ TraceManager.prototype.getStorageAt = function (stepIndex, tx, callback, address
TraceManager.prototype.getAddresses = function (callback) {
var addresses = [ this.tx.to ]
for (var k in this.traceCache.calls) {
if (this.traceCache.calls[k].address) {
addresses.push(this.traceCache.calls[k].address)
var address = this.traceCache.calls[k].address
if (address && addresses.join('').indexOf(address) === -1) {
addresses.push(address)
}
}
callback(null, addresses)

@ -297,4 +297,27 @@ tape('TraceManager', function (t) {
st.ok(result === 63)
st.end()
})
t.test('TraceManager.getAddresses', function (st) {
traceManager.getAddresses(function (error, result) {
if (error) {
st.fail(error)
} else {
st.ok(result[0] === '0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5')
st.ok(result[1] === '(Contract Creation - Step 63)')
st.end()
}
})
})
t.test('TraceManager.getReturnValue', function (st) {
traceManager.getReturnValue(108, function (error, result) {
if (error) {
st.fail(error)
} else {
st.ok(result === '0x60606040526008565b00')
st.end()
}
})
})
})

Loading…
Cancel
Save