Commit 7a64989b authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #464 from ethereum/newStorageScheme

Change storagedump implementation to fit storageRangeAt
parents f303e7f7 2be6c5ef
{
"plugins": ["fast-async",
"check-es2015-constants",
"transform-es2015-arrow-functions",
"transform-es2015-block-scoped-functions",
"transform-es2015-block-scoping",
"transform-es2015-classes",
"transform-es2015-computed-properties",
"transform-es2015-destructuring",
"transform-es2015-duplicate-keys",
"transform-es2015-for-of",
"transform-es2015-function-name",
"transform-es2015-literals",
"transform-es2015-object-super",
"transform-es2015-parameters",
"transform-es2015-shorthand-properties",
"transform-es2015-spread",
"transform-es2015-sticky-regex",
"transform-es2015-unicode-regex",
"transform-object-assign",
]
}
\ No newline at end of file
...@@ -28,7 +28,7 @@ class StateManagerCommonStorageDump extends StateManager { ...@@ -28,7 +28,7 @@ class StateManagerCommonStorageDump extends StateManager {
} }
putContractStorage (address, key, value, cb) { 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) super.putContractStorage(address, key, value, cb)
} }
...@@ -41,7 +41,11 @@ class StateManagerCommonStorageDump extends StateManager { ...@@ -41,7 +41,11 @@ class StateManagerCommonStorageDump extends StateManager {
var storage = {} var storage = {}
var stream = trie.createReadStream() var stream = trie.createReadStream()
stream.on('data', function (val) { 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 () { stream.on('end', function () {
cb(storage) 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