From 7e4c48871782901e292957a17c9da9fa1b789054 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 26 Mar 2015 00:42:35 +0100 Subject: Fixed storage. Closes #516 --- xeth/types.go | 4 ++-- xeth/xeth.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xeth/types.go b/xeth/types.go index 09d0dc714..3f96f8f8b 100644 --- a/xeth/types.go +++ b/xeth/types.go @@ -7,11 +7,11 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/core/state" ) type Object struct { @@ -45,7 +45,7 @@ func (self *Object) Storage() (storage map[string]string) { for it.Next() { var data []byte rlp.Decode(bytes.NewReader(it.Value), &data) - storage[common.ToHex(it.Key)] = common.ToHex(data) + storage[common.ToHex(self.Trie().GetKey(it.Key))] = common.ToHex(data) } return diff --git a/xeth/xeth.go b/xeth/xeth.go index 36c9979f4..25fdb8c89 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -456,7 +456,7 @@ func (self *XEth) EachStorage(addr string) string { object := self.State().SafeGet(addr) it := object.Trie().Iterator() for it.Next() { - values = append(values, KeyVal{common.ToHex(it.Key), common.ToHex(it.Value)}) + values = append(values, KeyVal{common.ToHex(object.Trie().GetKey(it.Key)), common.ToHex(it.Value)}) } valuesJson, err := json.Marshal(values) -- cgit