Skip to content

Commit

Permalink
fix CI lint and race errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli committed Dec 26, 2024
1 parent 63ba4d4 commit 1f73102
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
9 changes: 5 additions & 4 deletions execution/gethexec/express_lane_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func makeStubPublisher(els *expressLaneService) *stubPublisher {
}

func (s *stubPublisher) PublishTimeboostedTransaction(parentCtx context.Context, tx *types.Transaction, options *arbitrum_types.ConditionalOptions) error {
if tx == nil {
if tx.CalldataUnits != 0 {
return errors.New("oops, bad tx")
}
control, _ := s.els.roundControl.Get(0)
Expand Down Expand Up @@ -394,7 +394,7 @@ func Test_expressLaneService_sequenceExpressLaneSubmission_outOfOrder(t *testing
}
// We should have only published 2, as we are missing sequence number 3.
require.Equal(t, 2, len(stubPublisher.publishedTxOrder))
require.Equal(t, len(messages), len(els.messagesBySequenceNumber))
require.Equal(t, 3, len(els.messagesBySequenceNumber)) // Processed txs are deleted

err := els.sequenceExpressLaneSubmission(ctx, &timeboost.ExpressLaneSubmission{SequenceNumber: 3, Transaction: &types.Transaction{}})
require.NoError(t, err)
Expand Down Expand Up @@ -425,15 +425,16 @@ func Test_expressLaneService_sequenceExpressLaneSubmission_erroredTx(t *testing.
},
{
SequenceNumber: 2,
Transaction: nil,
Transaction: types.NewTx(&types.DynamicFeeTx{}),
},
{
SequenceNumber: 2,
Transaction: &types.Transaction{},
},
}
messages[2].Transaction.CalldataUnits = 1
for _, msg := range messages {
if msg.Transaction == nil {
if msg.Transaction.CalldataUnits != 0 {
err := els.sequenceExpressLaneSubmission(ctx, msg)
require.ErrorContains(t, err, "oops, bad tx")
} else {
Expand Down
6 changes: 5 additions & 1 deletion system_tests/timeboost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -836,5 +836,9 @@ func getRandomPort(t testing.TB) int {
listener, err := net.Listen("tcp", "localhost:0")
require.NoError(t, err)
defer listener.Close()
return listener.Addr().(*net.TCPAddr).Port
tcpAddr, ok := listener.Addr().(*net.TCPAddr)
if !ok {
t.Fatalf("failed to cast listener address to *net.TCPAddr")
}
return tcpAddr.Port
}
2 changes: 2 additions & 0 deletions timeboost/auctioneer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ func TestBidValidatorAuctioneerRedisStream(t *testing.T) {

// We verify that the auctioneer has consumed all validated bids from the single Redis stream.
// We also verify the top two bids are those we expect.
am.bidCache.Lock()
require.Equal(t, 3, len(am.bidCache.bidsByExpressLaneControllerAddr))
am.bidCache.Unlock()
result := am.bidCache.topTwoBids()
require.Equal(t, big.NewInt(7), result.firstPlace.Amount) // Best bid should be Charlie's last bid 7
require.Equal(t, charlieAddr, result.firstPlace.Bidder)
Expand Down
6 changes: 5 additions & 1 deletion timeboost/bid_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,5 +210,9 @@ func getRandomPort(t testing.TB) int {
listener, err := net.Listen("tcp", "localhost:0")
require.NoError(t, err)
defer listener.Close()
return listener.Addr().(*net.TCPAddr).Port
tcpAddr, ok := listener.Addr().(*net.TCPAddr)
if !ok {
t.Fatalf("failed to cast listener address to *net.TCPAddr")
}
return tcpAddr.Port
}

0 comments on commit 1f73102

Please sign in to comment.