Skip to content

Commit

Permalink
core/txpool/legacypool: fix TestTransactionPendingReannouce
Browse files Browse the repository at this point in the history
  • Loading branch information
Buddho authored and Buddho committed Feb 11, 2025
1 parent 5f7ce67 commit 8d4f9dc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions core/txpool/legacypool/legacypool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2222,10 +2222,8 @@ func TestSlotCount(t *testing.T) {
}
}

// TODO(Nathan): the concepts of `locals` has been removed, so no chance to reannounce now
// Tests the local pending transaction announced again correctly.
// nolint:unused
func testTransactionPendingReannouce(t *testing.T) {
func TestTransactionPendingReannouce(t *testing.T) {
t.Parallel()

// Create the pool to test the limit enforcement with
Expand All @@ -2251,6 +2249,13 @@ func testTransactionPendingReannouce(t *testing.T) {
sub := pool.reannoTxFeed.Subscribe(events)
defer sub.Unsubscribe()

// Generate a batch of transactions and add to tx_pool locally.
txs := make([]*types.Transaction, 0, testTxPoolConfig.AccountQueue)
for i := uint64(0); i < testTxPoolConfig.AccountQueue; i++ {
txs = append(txs, transaction(i, 100000, key))
}
pool.Add(txs, true)

select {
case ev := <-events:
t.Logf("received reannouce event, txs length: %d", len(ev.Txs))
Expand Down

0 comments on commit 8d4f9dc

Please sign in to comment.