Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

Commit

Permalink
use helper
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed May 22, 2017
1 parent 3ff34f1 commit ce16924
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/solidity/types/Mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion src/solidity/types/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module.exports = {
toBN: toBN,
add: add,
extractLocation: extractLocation,
removeLocation: removeLocation
removeLocation: removeLocation,
normalizeHex: normalizeHex
}

function decodeIntFromHex (value, byteLength, signed) {
Expand Down

0 comments on commit ce16924

Please sign in to comment.