aboutsummaryrefslogtreecommitdiffstats
path: root/xeth
diff options
context:
space:
mode:
Diffstat (limited to 'xeth')
-rw-r--r--xeth/types.go19
-rw-r--r--xeth/world.go2
2 files changed, 16 insertions, 5 deletions
diff --git a/xeth/types.go b/xeth/types.go
index 4d8543eb1..bee730ba1 100644
--- a/xeth/types.go
+++ b/xeth/types.go
@@ -35,20 +35,31 @@ func NewObject(state *state.StateObject) *Object {
func (self *Object) StorageString(str string) *ethutil.Value {
if ethutil.IsHex(str) {
- return self.Storage(ethutil.Hex2Bytes(str[2:]))
+ return self.storage(ethutil.Hex2Bytes(str[2:]))
} else {
- return self.Storage(ethutil.RightPadBytes([]byte(str), 32))
+ return self.storage(ethutil.RightPadBytes([]byte(str), 32))
}
}
func (self *Object) StorageValue(addr *ethutil.Value) *ethutil.Value {
- return self.Storage(addr.Bytes())
+ return self.storage(addr.Bytes())
}
-func (self *Object) Storage(addr []byte) *ethutil.Value {
+func (self *Object) storage(addr []byte) *ethutil.Value {
return self.StateObject.GetStorage(ethutil.BigD(addr))
}
+func (self *Object) Storage() (storage map[string]string) {
+ storage = make(map[string]string)
+
+ it := self.StateObject.Trie().Iterator()
+ for it.Next() {
+ storage[toHex(it.Key)] = toHex(it.Value)
+ }
+
+ return
+}
+
// Block interface exposed to QML
type Block struct {
//Transactions string `json:"transactions"`
diff --git a/xeth/world.go b/xeth/world.go
index cdceec50d..9cbdd9461 100644
--- a/xeth/world.go
+++ b/xeth/world.go
@@ -11,7 +11,7 @@ func NewState(xeth *XEth) *State {
}
func (self *State) State() *state.StateDB {
- return self.xeth.chainManager.State()
+ return self.xeth.chainManager.TransState()
}
func (self *State) Get(addr string) *Object {