aboutsummaryrefslogtreecommitdiffstats
path: root/state
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-02 21:06:08 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-02 21:06:08 +0800
commit4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8 (patch)
tree1cc4369855586a5b59406d09299e89f8e3f9142d /state
parentcfe037028081ebb84ee35caa5b16fed5d125b58a (diff)
parent65cad14f9b27db396d036f47814d4843d947ac43 (diff)
downloaddexon-4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8.tar
dexon-4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8.tar.gz
dexon-4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8.tar.bz2
dexon-4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8.tar.lz
dexon-4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8.tar.xz
dexon-4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8.tar.zst
dexon-4cb0bfe9395f3a45fcea00bc753cbd2c20ca78e8.zip
Merge branch 'develop' of github.com:ethereum/go-ethereum into removews
Conflicts: cmd/ethereum/flags.go cmd/mist/flags.go
Diffstat (limited to 'state')
-rw-r--r--state/dump.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/state/dump.go b/state/dump.go
index 073f89414..2c611d76b 100644
--- a/state/dump.go
+++ b/state/dump.go
@@ -20,7 +20,7 @@ type World struct {
Accounts map[string]Account `json:"accounts"`
}
-func (self *StateDB) Dump() []byte {
+func (self *StateDB) RawDump() World {
world := World{
Root: ethutil.Bytes2Hex(self.trie.Root()),
Accounts: make(map[string]Account),
@@ -39,8 +39,11 @@ func (self *StateDB) Dump() []byte {
}
world.Accounts[ethutil.Bytes2Hex(it.Key)] = account
}
+ return world
+}
- json, err := json.MarshalIndent(world, "", " ")
+func (self *StateDB) Dump() []byte {
+ json, err := json.MarshalIndent(self.RawDump(), "", " ")
if err != nil {
fmt.Println("dump err", err)
}