Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: ♻️ mev: update interface #97

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading