diff --git a/go/host/rpc/clientapi/client_api_eth.go b/go/host/rpc/clientapi/client_api_eth.go index ded05e75e7..0435302ea5 100644 --- a/go/host/rpc/clientapi/client_api_eth.go +++ b/go/host/rpc/clientapi/client_api_eth.go @@ -187,6 +187,18 @@ func (api *EthereumAPI) GetStorageAt(ctx context.Context, encryptedParams common return *enclaveResponse, nil } +func (api *EthereumAPI) MaxPriorityFeePerGas(_ context.Context) (*hexutil.Big, error) { + // todo - implement with the gas mechanics + header, err := api.host.Storage().FetchHeadBatchHeader() + if err != nil { + api.logger.Error("Unable to retrieve header for fee history.", log.ErrKey, err) + return nil, fmt.Errorf("unable to retrieve MaxPriorityFeePerGas") + } + + // just return the base fee? + return (*hexutil.Big)(header.BaseFee), err +} + // FeeHistory is a placeholder for an RPC method required by MetaMask/Remix. // rpc.DecimalOrHex -> []byte func (api *EthereumAPI) FeeHistory(context.Context, string, rpc.BlockNumber, []float64) (*FeeHistoryResult, error) { diff --git a/integration/obscurogateway/tengateway_test.go b/integration/obscurogateway/tengateway_test.go index d2b6deecc6..43778e5d35 100644 --- a/integration/obscurogateway/tengateway_test.go +++ b/integration/obscurogateway/tengateway_test.go @@ -509,6 +509,7 @@ func testErrorHandling(t *testing.T, httpURL, wsURL string, w wallet.Wallet) { `{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xA58C60cc047592DE97BF1E8d2f225Fc5D959De77", "latest"],"id":1,"extra":"extra_field"}`, `{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[["0xA58C60cc047592DE97BF1E8d2f225Fc5D959De77", "0x1234"]],"id":1}`, `{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x0000000000000000000000000000000000000000000000000000000000000000"],"id":1}`, + `{"jsonrpc":"2.0","method":"eth_maxPriorityFeePerGas","params":[],"id":1}`, } { // ensure the geth request is issued correctly (should return 200 ok with jsonRPCError) _, response, err := httputil.PostDataJSON(ogClient.HTTP(), []byte(req))