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 authored Nov 10, 2023
1 parent 6bc2353 commit c0fe114
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions eth/api_debug.go
Original file line number Diff line number Diff line change
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 c0fe114

Please sign in to comment.