Commit ce169246 authored by yann300's avatar yann300

use helper

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