@@ -3,7 +3,6 @@ package cat
3
3
import (
4
4
"encoding/hex"
5
5
"os"
6
- "sync"
7
6
"testing"
8
7
"time"
9
8
@@ -29,11 +28,6 @@ import (
29
28
"github.com/cometbft/cometbft/types"
30
29
)
31
30
32
- const (
33
- numTxs = 10
34
- timeout = 120 * time .Second // ridiculously high because CircleCI is slow
35
- )
36
-
37
31
type peerState struct {
38
32
height int64
39
33
}
@@ -373,45 +367,6 @@ func newMempoolWithAppAndConfig(cc proxy.ClientCreator, conf *cfg.Config) (*TxPo
373
367
return mp , func () { os .RemoveAll (conf .RootDir ) }
374
368
}
375
369
376
- func waitForTxsOnReactors (t * testing.T , txs types.Txs , reactors []* Reactor ) {
377
- // wait for the txs in all mempools
378
- wg := new (sync.WaitGroup )
379
- for i , reactor := range reactors {
380
- wg .Add (1 )
381
- go func (r * Reactor , reactorIndex int ) {
382
- defer wg .Done ()
383
- waitForTxsOnReactor (t , txs , r , reactorIndex )
384
- }(reactor , i )
385
- }
386
-
387
- done := make (chan struct {})
388
- go func () {
389
- wg .Wait ()
390
- close (done )
391
- }()
392
-
393
- timer := time .After (timeout )
394
- select {
395
- case <- timer :
396
- t .Fatal ("Timed out waiting for txs" )
397
- case <- done :
398
- }
399
- }
400
-
401
- func waitForTxsOnReactor (t * testing.T , txs types.Txs , reactor * Reactor , reactorIndex int ) {
402
- mempool := reactor .mempool
403
- for mempool .Size () < len (txs ) {
404
- time .Sleep (time .Millisecond * 100 )
405
- }
406
-
407
- reapedTxs := mempool .ReapMaxTxs (len (txs ))
408
- for i , tx := range txs {
409
- require .Contains (t , types .CachedTxToSliceOfBytes (reapedTxs ), tx )
410
- require .Equal (t , tx , reapedTxs [i ].Tx ,
411
- "txs at index %d on reactor %d don't match: %x vs %x" , i , reactorIndex , tx , reapedTxs [i ])
412
- }
413
- }
414
-
415
370
func genPeers (n int ) []* mocks.Peer {
416
371
peers := make ([]* mocks.Peer , n )
417
372
for i := 0 ; i < n ; i ++ {
0 commit comments