Skip to content

Commit

Permalink
refactor: ♻️ mev: update interface (#97)
Browse files Browse the repository at this point in the history
Signed-off-by: thanhpp <[email protected]>
  • Loading branch information
thanhpp authored Nov 26, 2024
1 parent a4f5a8b commit 5f3cf28
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 7 additions & 0 deletions pkg/mev/blxr_bundle_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions pkg/mev/bundle_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions pkg/mev/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 5f3cf28

Please sign in to comment.