From adb647993ca0330e8b4f2b528860e98bb6f72eb0 Mon Sep 17 00:00:00 2001 From: Tudor Malene Date: Thu, 14 Mar 2024 10:32:05 +0000 Subject: [PATCH] fixes --- go/host/rpc/clientapi/client_api_eth.go | 2 +- integration/obscurogateway/tengateway_test.go | 2 +- tools/walletextension/rpcapi/ethereum_api.go | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go/host/rpc/clientapi/client_api_eth.go b/go/host/rpc/clientapi/client_api_eth.go index 85bc103af0..f4305c8932 100644 --- a/go/host/rpc/clientapi/client_api_eth.go +++ b/go/host/rpc/clientapi/client_api_eth.go @@ -67,7 +67,7 @@ func (api *EthereumAPI) GetBlockByHash(_ context.Context, hash gethcommon.Hash, } // GasPrice is a placeholder for an RPC method required by MetaMask/Remix. -func (api *EthereumAPI) GasPrice(context.Context) (*hexutil.Big, error) { +func (api *EthereumAPI) GasPrice() (*hexutil.Big, error) { header, err := api.host.DB().GetHeadBatchHeader() if err != nil { return nil, err diff --git a/integration/obscurogateway/tengateway_test.go b/integration/obscurogateway/tengateway_test.go index e40761a566..806f5111a1 100644 --- a/integration/obscurogateway/tengateway_test.go +++ b/integration/obscurogateway/tengateway_test.go @@ -393,8 +393,8 @@ func testErrorHandling(t *testing.T, httpURL, wsURL string, w wallet.Wallet) { require.NoError(t, err) // make requests to geth for comparison - for _, req := range []string{ + `{"jsonrpc":"2.0","method":"eth_gasPrice","params": [],"id":1}`, `{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params": ["latest", false],"id":1}`, `{"jsonrpc":"2.0","method":"eth_feeHistory","params":[1, "latest", [50]],"id":1}`, `{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xA58C60cc047592DE97BF1E8d2f225Fc5D959De77", "latest"],"id":1}`, diff --git a/tools/walletextension/rpcapi/ethereum_api.go b/tools/walletextension/rpcapi/ethereum_api.go index b3e9f3cce0..724c7a6354 100644 --- a/tools/walletextension/rpcapi/ethereum_api.go +++ b/tools/walletextension/rpcapi/ethereum_api.go @@ -2,6 +2,7 @@ package rpcapi import ( "context" + "math/big" "time" "github.com/ethereum/go-ethereum/common/hexutil" @@ -19,7 +20,8 @@ func NewEthereumAPI(we *Services, } func (api *EthereumAPI) GasPrice(ctx context.Context) (*hexutil.Big, error) { - return UnauthenticatedTenRPCCall[hexutil.Big](ctx, api.we, &CacheCfg{TTL: shortCacheTTL}, "eth_gasPrice") + return (*hexutil.Big)(big.NewInt(int64(0x3b9aca00))), nil + // return UnauthenticatedTenRPCCall[hexutil.Big](ctx, api.we, &CacheCfg{TTL: shortCacheTTL}, "eth_gasPrice") } func (api *EthereumAPI) MaxPriorityFeePerGas(ctx context.Context) (*hexutil.Big, error) {