aboutsummaryrefslogtreecommitdiff
path: root/core/state/dump.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/state/dump.go')
-rw-r--r--core/state/dump.go43
1 files changed, 23 insertions, 20 deletions
diff --git a/core/state/dump.go b/core/state/dump.go
index 9bb946d..6f09398 100644
--- a/core/state/dump.go
+++ b/core/state/dump.go
@@ -37,14 +37,15 @@ type DumpCollector interface {
// DumpAccount represents an account in the state.
type DumpAccount struct {
- Balance string `json:"balance"`
- Nonce uint64 `json:"nonce"`
- Root string `json:"root"`
- CodeHash string `json:"codeHash"`
- Code string `json:"code,omitempty"`
- Storage map[common.Hash]string `json:"storage,omitempty"`
- Address *common.Address `json:"address,omitempty"` // Address only present in iterative (line-by-line) mode
- SecureKey hexutil.Bytes `json:"key,omitempty"` // If we don't have address, we can output the key
+ Balance string `json:"balance"`
+ Nonce uint64 `json:"nonce"`
+ Root string `json:"root"`
+ CodeHash string `json:"codeHash"`
+ IsMultiCoin bool `json:"isMultiCoin"`
+ Code string `json:"code,omitempty"`
+ Storage map[common.Hash]string `json:"storage,omitempty"`
+ Address *common.Address `json:"address,omitempty"` // Address only present in iterative (line-by-line) mode
+ SecureKey hexutil.Bytes `json:"key,omitempty"` // If we don't have address, we can output the key
}
@@ -89,14 +90,15 @@ type iterativeDump struct {
// OnAccount implements DumpCollector interface
func (d iterativeDump) OnAccount(addr common.Address, account DumpAccount) {
dumpAccount := &DumpAccount{
- Balance: account.Balance,
- Nonce: account.Nonce,
- Root: account.Root,
- CodeHash: account.CodeHash,
- Code: account.Code,
- Storage: account.Storage,
- SecureKey: account.SecureKey,
- Address: nil,
+ Balance: account.Balance,
+ Nonce: account.Nonce,
+ Root: account.Root,
+ CodeHash: account.CodeHash,
+ IsMultiCoin: account.IsMultiCoin,
+ Code: account.Code,
+ Storage: account.Storage,
+ SecureKey: account.SecureKey,
+ Address: nil,
}
if addr != (common.Address{}) {
dumpAccount.Address = &addr
@@ -123,10 +125,11 @@ func (s *StateDB) DumpToCollector(c DumpCollector, excludeCode, excludeStorage,
panic(err)
}
account := DumpAccount{
- Balance: data.Balance.String(),
- Nonce: data.Nonce,
- Root: common.Bytes2Hex(data.Root[:]),
- CodeHash: common.Bytes2Hex(data.CodeHash),
+ Balance: data.Balance.String(),
+ Nonce: data.Nonce,
+ Root: common.Bytes2Hex(data.Root[:]),
+ CodeHash: common.Bytes2Hex(data.CodeHash),
+ IsMultiCoin: data.IsMultiCoin,
}
addrBytes := s.trie.GetKey(it.Key)
if addrBytes == nil {