mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/geth: improve format
This commit is contained in:
parent
6ba1dc1391
commit
2adc128924
1 changed files with 6 additions and 6 deletions
|
|
@ -800,7 +800,7 @@ func inspectAccount(db *triedb.Database, start uint64, end uint64, address commo
|
||||||
content = "<empty>"
|
content = "<empty>"
|
||||||
} else {
|
} else {
|
||||||
if !raw {
|
if !raw {
|
||||||
content = fmt.Sprintf("%x", stats.Origins[i])
|
content = fmt.Sprintf("%#x", stats.Origins[i])
|
||||||
} else {
|
} else {
|
||||||
account := new(types.SlimAccount)
|
account := new(types.SlimAccount)
|
||||||
if err := rlp.DecodeBytes(stats.Origins[i], account); err != nil {
|
if err := rlp.DecodeBytes(stats.Origins[i], account); err != nil {
|
||||||
|
|
@ -808,13 +808,13 @@ func inspectAccount(db *triedb.Database, start uint64, end uint64, address commo
|
||||||
}
|
}
|
||||||
code := "<nil>"
|
code := "<nil>"
|
||||||
if len(account.CodeHash) > 0 {
|
if len(account.CodeHash) > 0 {
|
||||||
code = fmt.Sprintf("%x", account.CodeHash)
|
code = fmt.Sprintf("%#x", account.CodeHash)
|
||||||
}
|
}
|
||||||
root := "<nil>"
|
root := "<nil>"
|
||||||
if len(account.Root) > 0 {
|
if len(account.Root) > 0 {
|
||||||
root = fmt.Sprintf("%x", account.Root)
|
root = fmt.Sprintf("%#x", account.Root)
|
||||||
}
|
}
|
||||||
content = fmt.Sprintf("nonce: %d, balance: %d, code: %s, root: %s", account.Nonce, account.Balance, code, root)
|
content = fmt.Sprintf("nonce: %d, balance: %d, codeHash: %s, root: %s", account.Nonce, account.Balance, code, root)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Printf("#%d - #%d: %s\n", from, stats.Blocks[i], content)
|
fmt.Printf("#%d - #%d: %s\n", from, stats.Blocks[i], content)
|
||||||
|
|
@ -840,14 +840,14 @@ func inspectStorage(db *triedb.Database, start uint64, end uint64, address commo
|
||||||
content = "<empty>"
|
content = "<empty>"
|
||||||
} else {
|
} else {
|
||||||
if !raw {
|
if !raw {
|
||||||
content = fmt.Sprintf("%x", stats.Origins[i])
|
content = fmt.Sprintf("%#x", stats.Origins[i])
|
||||||
} else {
|
} else {
|
||||||
_, data, _, err := rlp.Split(stats.Origins[i])
|
_, data, _, err := rlp.Split(stats.Origins[i])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Failed to decode storage slot, %v", err)
|
fmt.Printf("Failed to decode storage slot, %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
content = fmt.Sprintf("%x", data)
|
content = fmt.Sprintf("%#x", data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Printf("#%d - #%d: %s\n", from, stats.Blocks[i], content)
|
fmt.Printf("#%d - #%d: %s\n", from, stats.Blocks[i], content)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue