aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-06-17 17:44:40 +0800
committerobscuren <geffobscura@gmail.com>2015-06-17 17:44:40 +0800
commita977f3c0dc050463e2b3c8622d289a23f0d1ce02 (patch)
treec7dbd7c84519ab510ea7e8778ac611176473f169
parent30b27336ea73f7d65c62363047fa37fdd0a54de1 (diff)
downloadgo-tangerine-a977f3c0dc050463e2b3c8622d289a23f0d1ce02.tar.gz
go-tangerine-a977f3c0dc050463e2b3c8622d289a23f0d1ce02.tar.zst
go-tangerine-a977f3c0dc050463e2b3c8622d289a23f0d1ce02.zip
xeth, tests: fixed api
-rw-r--r--tests/block_test_util.go2
-rw-r--r--xeth/types.go8
-rw-r--r--xeth/xeth.go2
3 files changed, 6 insertions, 6 deletions
diff --git a/tests/block_test_util.go b/tests/block_test_util.go
index ae2ae4033..200fcbd59 100644
--- a/tests/block_test_util.go
+++ b/tests/block_test_util.go
@@ -124,7 +124,7 @@ func (t *BlockTest) InsertPreState(ethereum *eth.Ethereum) (*state.StateDB, erro
obj.SetBalance(balance)
obj.SetNonce(nonce)
for k, v := range acct.Storage {
- statedb.SetState(common.HexToAddress(addrString), common.HexToHash(k), common.FromHex(v))
+ statedb.SetState(common.HexToAddress(addrString), common.HexToHash(k), common.HexToHash(v))
}
}
// sync objects to trie
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 {