Skip to content

Commit

Permalink
fix: 🚨 mev: revive
Browse files Browse the repository at this point in the history
Signed-off-by: thanhpp <[email protected]>
  • Loading branch information
thanhpp committed Jan 4, 2024
1 parent 0c70f51 commit bc61d90
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/mev/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type IBundleSender interface {
}

var (
_ IBundleSender = &MEVClient{}
_ IBundleSender = &Client{}
_ IBundleSender = &BloxrouteClient{}
)

Expand Down
12 changes: 6 additions & 6 deletions pkg/mev/send_bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ import (
"github.com/ethereum/go-ethereum/crypto"
)

// MEVClient https://beaverbuild.org/docs.html; https://rsync-builder.xyz/docs;
// Client https://beaverbuild.org/docs.html; https://rsync-builder.xyz/docs;
// https://docs.flashbots.net/flashbots-auction/advanced/rpc-endpoint#eth_sendbundle
type MEVClient struct {
type Client struct {
c *http.Client
endpoint string
flashbotKey *ecdsa.PrivateKey
}

// NewMEVClient set the flashbotKey to nil will skip adding the signature header.
func NewMEVClient(c *http.Client, endpoint string, flashbotKey *ecdsa.PrivateKey) *MEVClient {
return &MEVClient{
// NewClient set the flashbotKey to nil will skip adding the signature header.
func NewClient(c *http.Client, endpoint string, flashbotKey *ecdsa.PrivateKey) *Client {
return &Client{
c: c,
endpoint: endpoint,
flashbotKey: flashbotKey,
}
}

func (s *MEVClient) SendBundle(
func (s *Client) SendBundle(
ctx context.Context, blockNumber uint64, txs ...*types.Transaction,
) (SendBundleResponse, error) {
req := SendBundleRequest{
Expand Down
2 changes: 1 addition & 1 deletion pkg/mev/send_bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestSendBundle(t *testing.T) {

t.Log("new tx", signedTx.Hash().String())

sender := mev.NewMEVClient(client, endpoint, privateKey)
sender := mev.NewClient(client, endpoint, privateKey)
resp, err := sender.SendBundle(ctx, blockNumber+12, signedTx)
require.NoError(t, err) // sepolia: code: [-32000], message: [internal server error]

Expand Down

0 comments on commit bc61d90

Please sign in to comment.