Commit da4cba07 authored by yann300's avatar yann300

renaming extractHexByte -> extractHexValue

parent bdf77eb7
......@@ -8,7 +8,7 @@ function Address () {
}
Address.prototype.decodeFromStorage = function (location, storageContent) {
var value = util.extractHexByte(location, storageContent, this.storageBytes)
var value = util.extractHexValue(location, storageContent, this.storageBytes)
return '0x' + value.toUpperCase()
}
......
......@@ -8,7 +8,7 @@ function Bool () {
}
Bool.prototype.decodeFromStorage = function (location, storageContent) {
var value = util.extractHexByte(location, storageContent, this.storageBytes)
var value = util.extractHexValue(location, storageContent, this.storageBytes)
return value !== '00'
}
......
......@@ -9,7 +9,7 @@ function DynamicByteArray () {
}
DynamicByteArray.prototype.decodeFromStorage = function (location, storageContent) {
var value = util.extractHexByte(location, storageContent, this.storageBytes)
var value = util.extractHexValue(location, storageContent, this.storageBytes)
var bn = new BN(value, 16)
if (bn.testn(0)) {
var length = bn.div(new BN(2))
......
......@@ -14,7 +14,7 @@ function Enum (enumDef) {
}
Enum.prototype.decodeFromStorage = function (location, storageContent) {
var value = util.extractHexByte(location, storageContent, this.storageBytes)
var value = util.extractHexValue(location, storageContent, this.storageBytes)
value = parseInt(value, 16)
if (this.enumDef.children.length > value) {
return this.enumDef.children[value].attributes.name
......
......@@ -8,7 +8,7 @@ function FixedByteArray (storageBytes) {
}
FixedByteArray.prototype.decodeFromStorage = function (location, storageContent) {
var value = util.extractHexByte(location, storageContent, this.storageBytes)
var value = util.extractHexValue(location, storageContent, this.storageBytes)
return '0x' + value.toUpperCase()
}
......
......@@ -5,7 +5,7 @@ var BN = require('ethereumjs-util').BN
module.exports = {
readFromStorage: readFromStorage,
decodeInt: decodeInt,
extractHexByte: extractHexByte,
extractHexValue: extractHexValue,
sha3: sha3
}
......@@ -29,7 +29,7 @@ function readFromStorage (slot, storageContent) {
if (storageContent[hexSlot] !== undefined) {
ret = storageContent[hexSlot].replace(/^0x/, '')
} else {
ret = '0000000000000000000000000000000000000000000000000000000000000000'
ret = '000000000000000000000000000000000000000000000000000000000000000'
}
}
if (ret.length < 64) {
......@@ -57,7 +57,7 @@ function extractHexByteSlice (slotValue, byteLength, offsetFromLSB) {
* @param {Object} storageContent - full storage mapping.
* @param {Int} byteLength - Length of the byte slice to extract
*/
function extractHexByte (location, storageContent, byteLength) {
function extractHexValue (location, storageContent, byteLength) {
var slotvalue = readFromStorage(location.slot, storageContent)
return extractHexByteSlice(slotvalue, byteLength, location.offset)
}
......
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