|
|
@ -13,7 +13,7 @@ module.exports = { |
|
|
|
* @param {Function} callback - calback |
|
|
|
* @param {Function} callback - calback |
|
|
|
* @return {Map} - solidity mapping location (e.g { "<mapping_slot>" : { "<mapping-key1>": preimageOf1 }, { "<mapping-key2>": preimageOf2 }, ... }) |
|
|
|
* @return {Map} - solidity mapping location (e.g { "<mapping_slot>" : { "<mapping-key1>": preimageOf1 }, { "<mapping-key2>": preimageOf2 }, ... }) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
async function decodeMappingsKeys (web3, storage, corrections, callback) { |
|
|
|
async function decodeMappingsKeys (web3, storage, corrections) { |
|
|
|
const ret = {} |
|
|
|
const ret = {} |
|
|
|
if (!corrections.length) corrections.push({offset: 0, slot: 0}) |
|
|
|
if (!corrections.length) corrections.push({offset: 0, slot: 0}) |
|
|
|
for (let hashedLoc in storage) { |
|
|
|
for (let hashedLoc in storage) { |
|
|
@ -38,7 +38,7 @@ async function decodeMappingsKeys (web3, storage, corrections, callback) { |
|
|
|
ret[mappingSlot][mappingKey] = preimage |
|
|
|
ret[mappingSlot][mappingKey] = preimage |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
callback(null, ret) |
|
|
|
return ret |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|