Commit 8fc125a0 authored by yann300's avatar yann300

change storagedump implementation to fit storageRangeAt

parent f303e7f7
......@@ -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)
......
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