From 74071ecdf9589945112e1a8639ecbf6968ff7675 Mon Sep 17 00:00:00 2001 From: i-norden Date: Wed, 4 Jan 2023 16:02:25 -0600 Subject: [PATCH] eth_gasPrice fall-through --- pkg/eth/api.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/eth/api.go b/pkg/eth/api.go index 991936fd..65a4413a 100644 --- a/pkg/eth/api.go +++ b/pkg/eth/api.go @@ -535,6 +535,18 @@ func (pea *PublicEthAPI) EstimateGas(ctx context.Context, args TransactionArgs, return hexutil.Uint64(0), RequiresProxyError{method: "eth_estimateGas"} } +// GasPrice returns a suggestion for a gas price for legacy transactions. +func (pea *PublicEthAPI) GasPrice(ctx context.Context) (*hexutil.Big, error) { + if pea.proxyOnError { + var res *hexutil.Big + if err := pea.rpc.CallContext(ctx, &res, "eth_gasPrice"); err != nil { + return nil, err + } + return res, nil + } + return nil, RequiresProxyError{method: "eth_gasPrice"} +} + /* Receipts and Logs