diff --git a/pkg/core/mempool/mem_pool_test.go b/pkg/core/mempool/mem_pool_test.go index 694ce8960..a7e73839e 100644 --- a/pkg/core/mempool/mem_pool_test.go +++ b/pkg/core/mempool/mem_pool_test.go @@ -298,10 +298,7 @@ func TestMemPoolFees(t *testing.T) { // check whether sender's fee updates correctly mp.RemoveStale(func(t *transaction.Transaction) bool { - if t == tx2 { - return true - } - return false + return t == tx2 }, fs) require.Equal(t, 1, len(mp.fees)) require.Equal(t, utilityBalanceAndFees{ @@ -311,10 +308,7 @@ func TestMemPoolFees(t *testing.T) { // there should be nothing left mp.RemoveStale(func(t *transaction.Transaction) bool { - if t == tx3 { - return true - } - return false + return t == tx3 }, fs) require.Equal(t, 0, len(mp.fees)) } diff --git a/pkg/core/mempool/subscriptions_test.go b/pkg/core/mempool/subscriptions_test.go index 67557455f..a2fb3a91f 100644 --- a/pkg/core/mempool/subscriptions_test.go +++ b/pkg/core/mempool/subscriptions_test.go @@ -75,10 +75,7 @@ func TestSubscriptions(t *testing.T) { // remove stale mp.RemoveStale(func(tx *transaction.Transaction) bool { - if tx.Hash().Equals(txs[2].Hash()) { - return false - } - return true + return !tx.Hash().Equals(txs[2].Hash()) }, fs) require.Eventually(t, func() bool { return len(subChan1) == 1 && len(subChan2) == 1 }, time.Second, time.Millisecond*100) event1 = <-subChan1