Skip to content

Commit

Permalink
Revert "eth: make debug_StorageRangeAt take a block hash or number (e…
Browse files Browse the repository at this point in the history
…thereum#27328)"

This reverts commit 52775d5.
  • Loading branch information
devopsbo3 committed Nov 10, 2023
1 parent 92b2c56 commit 352d68e
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions eth/api_debug.go
Expand Up @@ -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 {
Expand Down

0 comments on commit 352d68e

Please sign in to comment.