From d5fc9088a0ee2d5c2a7123ce00e77074e602b4c4 Mon Sep 17 00:00:00 2001 From: thanhpp Date: Tue, 26 Nov 2024 10:03:30 +0700 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20mev:=20update?= =?UTF-8?q?=20interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: thanhpp --- pkg/mev/blxr_bundle_sender.go | 7 +++++++ pkg/mev/bundle_sender.go | 8 ++++---- pkg/mev/pkg.go | 4 ++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/pkg/mev/blxr_bundle_sender.go b/pkg/mev/blxr_bundle_sender.go index ff6a8ff..0909615 100644 --- a/pkg/mev/blxr_bundle_sender.go +++ b/pkg/mev/blxr_bundle_sender.go @@ -123,6 +123,13 @@ func (s *BloxrouteClient) SendBundle( return SendBundleResponse(resp), nil } +func (s *BloxrouteClient) SendPrivateRawTransaction( + ctx context.Context, + tx *types.Transaction, +) (SendPrivateRawTransactionResponse, error) { + return SendPrivateRawTransactionResponse{}, nil +} + func (s *BloxrouteClient) CancelBundle( ctx context.Context, bundleUUID string, ) error { diff --git a/pkg/mev/bundle_sender.go b/pkg/mev/bundle_sender.go index 667a289..06b8da7 100644 --- a/pkg/mev/bundle_sender.go +++ b/pkg/mev/bundle_sender.go @@ -190,10 +190,6 @@ func (s *Client) sendBundle( blockNumber uint64, txs ...*types.Transaction, ) (SendBundleResponse, error) { - if !s.enableSendPrivateRaw { - return SendBundleResponse{}, nil - } - req := SendRequest{ ID: SendBundleID, JSONRPC: JSONRPC2, @@ -244,6 +240,10 @@ func (s *Client) SendPrivateRawTransaction( ctx context.Context, tx *types.Transaction, ) (SendPrivateRawTransactionResponse, error) { + if !s.enableSendPrivateRaw { + return SendPrivateRawTransactionResponse{}, nil + } + req := SendRequest{ ID: SendBundleID, JSONRPC: JSONRPC2, diff --git a/pkg/mev/pkg.go b/pkg/mev/pkg.go index f6cb718..b97ee31 100644 --- a/pkg/mev/pkg.go +++ b/pkg/mev/pkg.go @@ -82,6 +82,10 @@ type IBundleSender interface { CancelBundle( ctx context.Context, bundleUUID string, ) error + SendPrivateRawTransaction( + ctx context.Context, + tx *types.Transaction, + ) (SendPrivateRawTransactionResponse, error) SimulateBundle(ctx context.Context, blockNumber uint64, txs ...*types.Transaction) (SendBundleResponse, error) GetSenderType() BundleSenderType GetBundleStats(