Commit ce169246 authored by yann300's avatar yann300

use helper

parent 3ff34f1f
...@@ -19,8 +19,8 @@ class Mapping extends RefType { ...@@ -19,8 +19,8 @@ class Mapping extends RefType {
type: this.type type: this.type
} }
} }
var mapSlot = util.toBN(location.slot).toString(16) var mapSlot = util.normalizeHex(ethutil.bufferToHex(location.slot))
mapSlot = ethutil.setLengthLeft('0x' + mapSlot, 32).toString('hex') console.log(mapSlot, mappingsPreimages)
var mappingPreimages = mappingsPreimages[mapSlot] var mappingPreimages = mappingsPreimages[mapSlot]
var ret = {} var ret = {}
for (var i in mappingPreimages) { for (var i in mappingPreimages) {
......
...@@ -10,7 +10,8 @@ module.exports = { ...@@ -10,7 +10,8 @@ module.exports = {
toBN: toBN, toBN: toBN,
add: add, add: add,
extractLocation: extractLocation, extractLocation: extractLocation,
removeLocation: removeLocation removeLocation: removeLocation,
normalizeHex: normalizeHex
} }
function decodeIntFromHex (value, byteLength, signed) { function decodeIntFromHex (value, byteLength, signed) {
......
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