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

core/txpool/legacypool: fix TestTransactionPendingReannouce #2886

Merged
Merged
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
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