diff --git a/pkg/mev/bundle_sender_test.go b/pkg/mev/bundle_sender_test.go index f30938c..b63ff26 100644 --- a/pkg/mev/bundle_sender_test.go +++ b/pkg/mev/bundle_sender_test.go @@ -68,7 +68,7 @@ func TestSendBundle(t *testing.T) { uuid := uuid.NewString() ethClient, err = ethclient.Dial(endpoint) require.NoError(t, err) - gasBundleEstimator := mev.NewGasBundleEstimator(ethClient) + gasBundleEstimator := mev.NewGasBundleEstimator(ethClient.Client()) sender, err := mev.NewClient(client, endpoint, privateKey, false, mev.BundleSenderTypeFlashbot, gasBundleEstimator) require.NoError(t, err) @@ -101,7 +101,7 @@ func TestCancelBeaver(t *testing.T) { ethClient, err := ethclient.Dial(endpoint) require.NoError(t, err) - gasBundleEstimator := mev.NewGasBundleEstimator(ethClient) + gasBundleEstimator := mev.NewGasBundleEstimator(ethClient.Client()) sender, err := mev.NewClient(client, endpoint, nil, true, mev.BundleSenderTypeBeaver, gasBundleEstimator) require.NoError(t, err) @@ -141,7 +141,7 @@ func Test_SimulateBundle(t *testing.T) { simulationEndpoint := "http://localhost:8545" ethClient, err := ethclient.Dial(simulationEndpoint) require.NoError(t, err) - gasBundleEstimator := mev.NewGasBundleEstimator(ethClient) + gasBundleEstimator := mev.NewGasBundleEstimator(ethClient.Client()) client, err := mev.NewClient(http.DefaultClient, simulationEndpoint, nil, false, diff --git a/pkg/mev/gas_bundle_estimator.go b/pkg/mev/gas_bundle_estimator.go index e415b31..0784399 100644 --- a/pkg/mev/gas_bundle_estimator.go +++ b/pkg/mev/gas_bundle_estimator.go @@ -6,17 +6,17 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient/gethclient" + "github.com/ethereum/go-ethereum/rpc" ) type GasBundleEstimator struct { - ethClient *ethclient.Client + client *rpc.Client } -func NewGasBundleEstimator(ethClient *ethclient.Client) GasBundleEstimator { +func NewGasBundleEstimator(client *rpc.Client) GasBundleEstimator { return GasBundleEstimator{ - ethClient: ethClient, + client: client, } } @@ -32,7 +32,7 @@ func (g GasBundleEstimator) EstimateBundleGas( var gasEstimateCost []hexutil.Uint64 - err := g.ethClient.Client().Call( + err := g.client.Call( &gasEstimateCost, ETHEstimateGasBundleMethod, map[string]interface{}{ "transactions": bundles,