mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +00:00
add code_hash to trace
This commit is contained in:
parent
8ccc10541d
commit
360115e61f
3 changed files with 24 additions and 19 deletions
|
|
@ -1350,6 +1350,7 @@ func (bc *BlockChain) writeBlockResult(state *state.StateDB, block *types.Block,
|
|||
Address: block.Coinbase(),
|
||||
Nonce: state.GetNonce(block.Coinbase()),
|
||||
Balance: state.GetBalance(block.Coinbase()),
|
||||
CodeHash: state.GetCodeHash(block.Coinbase()),
|
||||
}
|
||||
// Get coinbase address's account proof.
|
||||
proof, err := state.GetProof(block.Coinbase())
|
||||
|
|
@ -1372,6 +1373,7 @@ func (bc *BlockChain) writeBlockResult(state *state.StateDB, block *types.Block,
|
|||
Address: from,
|
||||
Nonce: state.GetNonce(from),
|
||||
Balance: state.GetBalance(from),
|
||||
CodeHash: state.GetCodeHash(from),
|
||||
}
|
||||
// Get sender's account proof.
|
||||
proof, err := state.GetProof(from)
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ type AccountProofWrapper struct {
|
|||
Address common.Address `json:"address,omitempty"`
|
||||
Nonce uint64 `json:"nonce,omitempty"`
|
||||
Balance *big.Int `json:"balance,omitempty"`
|
||||
CodeHash common.Hash `json:"code_hash,omitempty"`
|
||||
Proof []string `json:"proof,omitempty"`
|
||||
Storage *StorageProofWrapper `json:"storage,omitempty"` // StorageProofWrapper can be empty if irrelated to storage operation
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ func getWrappedProofForAddr(l *StructLogger, address common.Address) (*types.Acc
|
|||
Address: address,
|
||||
Nonce: l.env.StateDB.GetNonce(address),
|
||||
Balance: l.env.StateDB.GetBalance(address),
|
||||
CodeHash: l.env.StateDB.GetCodeHash(address),
|
||||
Proof: encodeProof(proof),
|
||||
}, nil
|
||||
}
|
||||
|
|
@ -150,6 +151,7 @@ func getWrappedProofForStorage(l *StructLogger, address common.Address, key comm
|
|||
Address: address,
|
||||
Nonce: l.env.StateDB.GetNonce(address),
|
||||
Balance: l.env.StateDB.GetBalance(address),
|
||||
CodeHash: l.env.StateDB.GetCodeHash(address),
|
||||
Proof: encodeProof(proof),
|
||||
Storage: &types.StorageProofWrapper{
|
||||
Key: key.String(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue