Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jwasinger committed May 26, 2023
1 parent 23070e9 commit 0c367b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions eth/api.go
Expand Up @@ -411,12 +411,10 @@ 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
if number, ok := blockNrOrHash.Number(); ok {
block = api.eth.blockchain.GetBlockByNumber(uint64(number))
} else if hash, ok := blockNrOrHash.Hash(); ok {
block = api.eth.blockchain.GetBlockByHash(hash)
} else {
return StorageRangeResult{}, errors.New("either block number or block hash must be specified")

block, err := api.eth.APIBackend.BlockByNumberOrHash(ctx, blockNrOrHash)
if err != nil {
return StorageRangeResult{}, err
}

if block == nil {
Expand Down
2 changes: 1 addition & 1 deletion eth/backend.go
Expand Up @@ -323,7 +323,7 @@ func (s *Ethereum) Etherbase() (eb common.Address, err error) {
if etherbase != (common.Address{}) {
return etherbase, nil
}
return common.Address{}, fmt.Errorf("etherbase must be explicitly specified")
return common.Address{}, errors.New("etherbase must be explicitly specified")
}

// isLocalBlock checks whether the specified block is mined
Expand Down

0 comments on commit 0c367b5

Please sign in to comment.