diff --git a/jsonrpc/eth.go b/jsonrpc/eth.go index 82afde3d..f3096064 100644 --- a/jsonrpc/eth.go +++ b/jsonrpc/eth.go @@ -266,9 +266,9 @@ func (f *FeeHistory) UnmarshalJSON(data []byte) error { } // FeeHistory returns base fee per gas and transaction effective priority fee -func (e *Eth) FeeHistory(from, to ethgo.BlockNumber) (*FeeHistory, error) { +func (e *Eth) FeeHistory(blockCount uint64, newestBlock ethgo.BlockNumber, rewardPercentiles []float64) (*FeeHistory, error) { var out *FeeHistory - if err := e.c.Call("eth_feeHistory", &out, from.String(), to.String(), nil); err != nil { + if err := e.c.Call("eth_feeHistory", &out, blockCount, newestBlock.String(), rewardPercentiles); err != nil { return nil, err } return out, nil diff --git a/jsonrpc/eth_test.go b/jsonrpc/eth_test.go index 4dfee806..916b633c 100644 --- a/jsonrpc/eth_test.go +++ b/jsonrpc/eth_test.go @@ -394,10 +394,7 @@ func TestEthFeeHistory(t *testing.T) { lastBlock, err := c.Eth().BlockNumber() assert.NoError(t, err) - from := ethgo.BlockNumber(lastBlock - 2) - to := ethgo.BlockNumber(lastBlock) - - fee, err := c.Eth().FeeHistory(from, to) + fee, err := c.Eth().FeeHistory(1, ethgo.BlockNumber(lastBlock), []float64{25, 75}) assert.NoError(t, err) assert.NotNil(t, fee) } @@ -424,7 +421,7 @@ func TestEthMaxPriorityFeePerGas(t *testing.T) { latestBlock, err := c.Eth().BlockNumber() require.NoError(t, err) - feeHistory, err := c.Eth().FeeHistory(ethgo.BlockNumber(latestBlock-1), ethgo.BlockNumber(latestBlock)) + feeHistory, err := c.Eth().FeeHistory(1, ethgo.BlockNumber(latestBlock), nil) require.NoError(t, err) latestBaseFee := feeHistory.BaseFee[len(feeHistory.BaseFee)-1]