Commit 88b92d5c authored by yann300's avatar yann300

do not crash if no storage

parent 6a02df53
...@@ -27,7 +27,13 @@ TraceRetriever.prototype.getStorage = function (tx, address, callback) { ...@@ -27,7 +27,13 @@ TraceRetriever.prototype.getStorage = function (tx, address, callback) {
// The VM gives only a tx hash // The VM gives only a tx hash
// TODO: get rid of that and use the range parameters // TODO: get rid of that and use the range parameters
util.web3.debug.storageRangeAt(tx.blockHash, tx.transactionIndex === undefined ? tx.hash : tx.transactionIndex, address, '0x0', '0x' + end, maxSize, function (error, result) { util.web3.debug.storageRangeAt(tx.blockHash, tx.transactionIndex === undefined ? tx.hash : tx.transactionIndex, address, '0x0', '0x' + end, maxSize, function (error, result) {
callback(error, result.storage) if (error) {
callback(error)
} else if (result.storage) {
callback(null, result.storage)
} else {
callback('storage has not been provided')
}
}) })
} else { } else {
callback('no storageRangeAt endpoint found') callback('no storageRangeAt endpoint found')
......
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