ethereum, ethclient: add FeeHistory support (#25403)

Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
lightclient
2022-07-29 18:22:04 +02:00
committed by GitHub
co-authored by Felix Lange
parent 377c7d799f
commit 9ad508018e
4 changed files with 65 additions and 0 deletions
+1
View File
@@ -86,6 +86,7 @@ type feeHistoryResult struct {
GasUsedRatio []float64 `json:"gasUsedRatio"`
}
// FeeHistory returns the fee market history.
func (s *EthereumAPI) FeeHistory(ctx context.Context, blockCount rpc.DecimalOrHex, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (*feeHistoryResult, error) {
oldest, reward, baseFee, gasUsed, err := s.b.FeeHistory(ctx, int(blockCount), lastBlock, rewardPercentiles)
if err != nil {