aboutsummaryrefslogtreecommitdiffstats
path: root/xeth
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-06-18 20:29:53 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-06-18 20:29:53 +0800
commit2cea41065609dbebdd3856a00e9333566945ebee (patch)
treedb3dc8b4fe4b07b9f24493e70def40812dad1686 /xeth
parent53a6145a2bd6f733799375700d117c9674e8207b (diff)
parent430bcdb21959e018fbc93bac0ccd8bbfa2fd5afb (diff)
downloadgo-tangerine-2cea41065609dbebdd3856a00e9333566945ebee.tar
go-tangerine-2cea41065609dbebdd3856a00e9333566945ebee.tar.gz
go-tangerine-2cea41065609dbebdd3856a00e9333566945ebee.tar.bz2
go-tangerine-2cea41065609dbebdd3856a00e9333566945ebee.tar.lz
go-tangerine-2cea41065609dbebdd3856a00e9333566945ebee.tar.xz
go-tangerine-2cea41065609dbebdd3856a00e9333566945ebee.tar.zst
go-tangerine-2cea41065609dbebdd3856a00e9333566945ebee.zip
Merge pull request #1282 from obscuren/state-cleanup
core/state: cleanup & optimisations
Diffstat (limited to 'xeth')
-rw-r--r--xeth/types.go8
-rw-r--r--xeth/xeth.go2
2 files changed, 5 insertions, 5 deletions
diff --git a/xeth/types.go b/xeth/types.go
index 3bb1447ca..ed64dc45e 100644
--- a/xeth/types.go
+++ b/xeth/types.go
@@ -22,7 +22,7 @@ func NewObject(state *state.StateObject) *Object {
return &Object{state}
}
-func (self *Object) StorageString(str string) *common.Value {
+func (self *Object) StorageString(str string) []byte {
if common.IsHex(str) {
return self.storage(common.Hex2Bytes(str[2:]))
} else {
@@ -30,12 +30,12 @@ func (self *Object) StorageString(str string) *common.Value {
}
}
-func (self *Object) StorageValue(addr *common.Value) *common.Value {
+func (self *Object) StorageValue(addr *common.Value) []byte {
return self.storage(addr.Bytes())
}
-func (self *Object) storage(addr []byte) *common.Value {
- return self.StateObject.GetStorage(common.BigD(addr))
+func (self *Object) storage(addr []byte) []byte {
+ return self.StateObject.GetState(common.BytesToHash(addr)).Bytes()
}
func (self *Object) Storage() (storage map[string]string) {
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 71753d6bd..d68f48d50 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -488,7 +488,7 @@ func (self *XEth) NumberToHuman(balance string) string {
}
func (self *XEth) StorageAt(addr, storageAddr string) string {
- return common.ToHex(self.State().state.GetState(common.HexToAddress(addr), common.HexToHash(storageAddr)))
+ return self.State().state.GetState(common.HexToAddress(addr), common.HexToHash(storageAddr)).Hex()
}
func (self *XEth) BalanceAt(addr string) string {