fix address

pull/7/head
yann300 8 years ago
parent 5dd015a7ad
commit 25b7f8e867
  1. 3
      src/solidity/types/Address.js
  2. 2
      test/solidity/storageDecoder.js

@ -1,6 +1,5 @@
'use strict'
var util = require('./util')
var utileth = require('ethereumjs-util')
function Address () {
this.storageSlots = 1
@ -10,7 +9,7 @@ function Address () {
Address.prototype.decodeFromStorage = function (location, storageContent) {
var value = util.extractHexByte(location, storageContent, this.storageBytes)
return '0x' + utileth.unpad(value).toUpperCase()
return '0x' + value.toUpperCase()
}
module.exports = Address

@ -100,7 +100,7 @@ function testByteStorage (st) {
decoded = stateDecoder.solidityState({}, output.sources, 'byteStorage')
st.equal(decoded['b1'], false)
st.equal(decoded['a1'], '0x')
st.equal(decoded['a1'], '0x0000000000000000000000000000000000000000')
st.equal(decoded['b2'], false)
st.equal(decoded['dynb1'], '0x')
st.equal(decoded['stab'], '0x')

Loading…
Cancel
Save