From c0fe114963a75da454ac541ea43154c60ba44508 Mon Sep 17 00:00:00 2001 From: devopsbo3 <69951731+devopsbo3@users.noreply.github.com> Date: Fri, 10 Nov 2023 12:31:54 -0600 Subject: [PATCH] Revert "eth: make debug_StorageRangeAt take a block hash or number (#27328)" This reverts commit 52775d5cd3e1ea0f9164604ba96c858e0a3350fa. --- eth/api_debug.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/eth/api_debug.go b/eth/api_debug.go index 929e0460f7c51..fbc48e349651e 100644 --- a/eth/api_debug.go +++ b/eth/api_debug.go @@ -204,16 +204,11 @@ type storageEntry struct { } // StorageRangeAt returns the storage at the given block height and transaction index. -func (api *DebugAPI) StorageRangeAt(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, txIndex int, contractAddress common.Address, keyStart hexutil.Bytes, maxResult int) (StorageRangeResult, error) { - var block *types.Block - - block, err := api.eth.APIBackend.BlockByNumberOrHash(ctx, blockNrOrHash) - if err != nil { - return StorageRangeResult{}, err - } - +func (api *DebugAPI) StorageRangeAt(ctx context.Context, blockHash common.Hash, txIndex int, contractAddress common.Address, keyStart hexutil.Bytes, maxResult int) (StorageRangeResult, error) { + // Retrieve the block + block := api.eth.blockchain.GetBlockByHash(blockHash) if block == nil { - return StorageRangeResult{}, fmt.Errorf("block %v not found", blockNrOrHash) + return StorageRangeResult{}, fmt.Errorf("block %#x not found", blockHash) } _, _, statedb, release, err := api.eth.stateAtTransaction(ctx, block, txIndex, 0) if err != nil {