Fixed storage. Closes #516

This commit is contained in:
obscuren 2015-03-26 00:42:35 +01:00
parent 505f1fbcbb
commit 7e4c488717
2 changed files with 3 additions and 3 deletions

View File

@ -7,11 +7,11 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core" "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/core/types"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/core/state"
) )
type Object struct { type Object struct {
@ -45,7 +45,7 @@ func (self *Object) Storage() (storage map[string]string) {
for it.Next() { for it.Next() {
var data []byte var data []byte
rlp.Decode(bytes.NewReader(it.Value), &data) 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 return

View File

@ -456,7 +456,7 @@ func (self *XEth) EachStorage(addr string) string {
object := self.State().SafeGet(addr) object := self.State().SafeGet(addr)
it := object.Trie().Iterator() it := object.Trie().Iterator()
for it.Next() { 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) valuesJson, err := json.Marshal(values)