diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-02 19:07:26 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-02 19:07:26 +0800 |
commit | 0972bdeda238cfb64de7e639ebf9849bc81bb2bb (patch) | |
tree | cbc3a04f2385fc74b819f44f12d51a72b12d8771 /cmd/mist | |
parent | 1cc86c07a00a2ad7b13c56f4eeb62fbb3e7c5f6d (diff) | |
download | dexon-0972bdeda238cfb64de7e639ebf9849bc81bb2bb.tar dexon-0972bdeda238cfb64de7e639ebf9849bc81bb2bb.tar.gz dexon-0972bdeda238cfb64de7e639ebf9849bc81bb2bb.tar.bz2 dexon-0972bdeda238cfb64de7e639ebf9849bc81bb2bb.tar.lz dexon-0972bdeda238cfb64de7e639ebf9849bc81bb2bb.tar.xz dexon-0972bdeda238cfb64de7e639ebf9849bc81bb2bb.tar.zst dexon-0972bdeda238cfb64de7e639ebf9849bc81bb2bb.zip |
Fixed using new trie iterator API
Diffstat (limited to 'cmd/mist')
-rw-r--r-- | cmd/mist/debugger.go | 8 | ||||
-rw-r--r-- | cmd/mist/gui.go | 36 |
2 files changed, 22 insertions, 22 deletions
diff --git a/cmd/mist/debugger.go b/cmd/mist/debugger.go index a7a286e23..0e97a6652 100644 --- a/cmd/mist/debugger.go +++ b/cmd/mist/debugger.go @@ -309,9 +309,11 @@ func (d *Debugger) halting(pc int, op vm.OpCode, mem *vm.Memory, stack *vm.Stack d.win.Root().Call("setStack", val.String()) } - stateObject.EachStorage(func(key string, node *ethutil.Value) { - d.win.Root().Call("setStorage", storeVal{fmt.Sprintf("% x", key), fmt.Sprintf("% x", node.Str())}) - }) + it := stateObject.Trie().Iterator() + for it.Next() { + d.win.Root().Call("setStorage", storeVal{fmt.Sprintf("% x", it.Key), fmt.Sprintf("% x", it.Value)}) + + } stackFrameAt := new(big.Int).SetBytes(mem.Get(0, 32)) psize := mem.Len() - int(new(big.Int).SetBytes(mem.Get(0, 32)).Uint64()) diff --git a/cmd/mist/gui.go b/cmd/mist/gui.go index e5e18bbaa..98ca70b16 100644 --- a/cmd/mist/gui.go +++ b/cmd/mist/gui.go @@ -231,35 +231,33 @@ func (gui *Gui) loadAddressBook() { view := gui.getObjectByName("infoView") nameReg := gui.pipe.World().Config().Get("NameReg") if nameReg != nil { - nameReg.EachStorage(func(name string, value *ethutil.Value) { - if name[0] != 0 { - value.Decode() - - view.Call("addAddress", struct{ Name, Address string }{name, ethutil.Bytes2Hex(value.Bytes())}) + it := nameReg.Trie().Iterator() + for it.Next() { + if it.Key[0] != 0 { + view.Call("addAddress", struct{ Name, Address string }{string(it.Key), ethutil.Bytes2Hex(it.Value)}) } - }) + + } } } func (self *Gui) loadMergedMiningOptions() { view := self.getObjectByName("mergedMiningModel") - nameReg := self.pipe.World().Config().Get("MergeMining") - if nameReg != nil { + mergeMining := self.pipe.World().Config().Get("MergeMining") + if mergeMining != nil { i := 0 - nameReg.EachStorage(func(name string, value *ethutil.Value) { - if name[0] != 0 { - value.Decode() + it := mergeMining.Trie().Iterator() + for it.Next() { + view.Call("addMergedMiningOption", struct { + Checked bool + Name, Address string + Id, ItemId int + }{false, string(it.Key), ethutil.Bytes2Hex(it.Value), 0, i}) - view.Call("addMergedMiningOption", struct { - Checked bool - Name, Address string - Id, ItemId int - }{false, name, ethutil.Bytes2Hex(value.Bytes()), 0, i}) + i++ - i++ - } - }) + } } } |