internal/ethapi: use empty{Code,Root}Hash instead of zero

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2023-10-31 18:48:49 +08:00
parent 233db64cc1
commit 7dd0b4e58f

View file

@ -689,7 +689,13 @@ func (s *BlockChainAPI) GetProof(ctx context.Context, address common.Address, st
return nil, err return nil, err
} }
codeHash := statedb.GetCodeHash(address) codeHash := statedb.GetCodeHash(address)
if codeHash == (common.Hash{}) {
codeHash = types.EmptyCodeHash
}
storageRoot := statedb.GetStorageRoot(address) storageRoot := statedb.GetStorageRoot(address)
if storageRoot == (common.Hash{}) {
storageRoot = types.EmptyRootHash
}
if len(keys) > 0 { if len(keys) > 0 {
var storageTrie state.Trie var storageTrie state.Trie