Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jewei1997 committed Dec 30, 2024
1 parent 7405576 commit 6a39936
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion evmrpc/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ func (i *InfoAPI) GasPrice(ctx context.Context) (result *hexutil.Big, returnErr
if err != nil {
return nil, err
}
medianRewardPrevBlock := feeHist.Reward[0][0].ToInt()
var medianRewardPrevBlock *big.Int
if len(feeHist.Reward) == 0 || len(feeHist.Reward[0]) == 0 {
medianRewardPrevBlock = big.NewInt(defaultPriorityFeePerGas)
} else {
medianRewardPrevBlock = feeHist.Reward[0][0].ToInt()

Check warning on line 92 in evmrpc/info.go

View check run for this annotation

Codecov / codecov/patch

evmrpc/info.go#L92

Added line #L92 was not covered by tests
}
return i.GasPriceHelper(ctx, baseFee, totalGasUsed, medianRewardPrevBlock)
}

Expand Down

0 comments on commit 6a39936

Please sign in to comment.