Skip to content

Commit

Permalink
reduce tx size in test
Browse files Browse the repository at this point in the history
  • Loading branch information
sontrinh16 committed Aug 8, 2024
1 parent cb0486a commit 7faddfe
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions x/auth/ante/unorderedtx/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ func TestUnorderedTxManager_Flow(t *testing.T) {
currentTime := time.Now()

// Seed the manager with a txs, some of which should eventually be purged and
// the others will remain. First 50 Txs should be purged.
for i := 1; i <= 100; i++ {
// the others will remain. First 25 Txs should be purged.
for i := 1; i <= 50; i++ {
txHash := [32]byte{byte(i)}

if i <= 50 {
txm.Add(txHash, currentTime.Add(time.Hour))
} else {
if i <= 25 {
txm.Add(txHash, currentTime.Add(time.Millisecond*500*time.Duration(i)))
} else {
txm.Add(txHash, currentTime.Add(time.Hour))
}
}

Expand All @@ -123,7 +123,7 @@ func TestUnorderedTxManager_Flow(t *testing.T) {
for t := range ticker.C {
txm.OnNewBlock(t)

if t.After(currentTime.Add(time.Millisecond * 500 * time.Duration(50))) {
if t.After(currentTime.Add(time.Millisecond * 500 * time.Duration(25))) {
doneBlockCh <- true
return
}
Expand All @@ -135,7 +135,7 @@ func TestUnorderedTxManager_Flow(t *testing.T) {
require.Eventually(
t,
func() bool {
return txm.Size() == 50
return txm.Size() == 25
},
2*time.Minute,
5*time.Second,
Expand Down

0 comments on commit 7faddfe

Please sign in to comment.