change storagedump implementation to fit storageRangeAt

pull/1/head
yann300 8 years ago
parent f303e7f7de
commit 8fc125a07a
  1. 8
      src/app/execution-context.js

@ -28,7 +28,7 @@ class StateManagerCommonStorageDump extends StateManager {
}
putContractStorage (address, key, value, cb) {
this.keyHashes[ethUtil.sha3(key)] = ethUtil.bufferToHex(key)
this.keyHashes[ethUtil.sha3(key).toString('hex')] = ethUtil.bufferToHex(key)
super.putContractStorage(address, key, value, cb)
}
@ -41,7 +41,11 @@ class StateManagerCommonStorageDump extends StateManager {
var storage = {}
var stream = trie.createReadStream()
stream.on('data', function (val) {
storage[self.keyHashes[val.key]] = val.value.toString('hex')
storage['0x' + val.key.toString('hex')] = {
hashedKey: '0x' + val.key.toString('hex'),
key: self.keyHashes[val.key.toString('hex')],
value: '0x' + val.value.toString('hex')
}
})
stream.on('end', function () {
cb(storage)

Loading…
Cancel
Save