From 4edc99fe5dfb6bb466c71fa5c755f6dbc8a4abca Mon Sep 17 00:00:00 2001 From: jsvisa Date: Tue, 31 Oct 2023 19:28:44 +0800 Subject: [PATCH] eth,internal: no need to check zero root Signed-off-by: jsvisa --- eth/api_debug.go | 2 +- internal/ethapi/api.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/api_debug.go b/eth/api_debug.go index dc9f568146..ef47cac833 100644 --- a/eth/api_debug.go +++ b/eth/api_debug.go @@ -231,7 +231,7 @@ func (api *DebugAPI) StorageRangeAt(ctx context.Context, blockNrOrHash rpc.Block func storageRangeAt(statedb *state.StateDB, root common.Hash, address common.Address, start []byte, maxResult int) (StorageRangeResult, error) { storageRoot := statedb.GetStorageRoot(address) - if storageRoot == types.EmptyRootHash || storageRoot == (common.Hash{}) { + if storageRoot == types.EmptyRootHash { return StorageRangeResult{}, nil // empty storage } id := trie.StorageTrieID(root, crypto.Keccak256Hash(address.Bytes()), storageRoot) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 38a7924124..896c71642d 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -693,7 +693,7 @@ func (s *BlockChainAPI) GetProof(ctx context.Context, address common.Address, st if len(keys) > 0 { var storageTrie state.Trie - if storageRoot != types.EmptyRootHash && storageRoot != (common.Hash{}) { + if storageRoot != types.EmptyRootHash { id := trie.StorageTrieID(header.Root, crypto.Keccak256Hash(address.Bytes()), storageRoot) st, err := trie.NewStateTrie(id, statedb.Database().TrieDB()) if err != nil {