Skip to content

Commit

Permalink
Merge pull request #3024 from nspcc-dev/add-mp-test
Browse files Browse the repository at this point in the history
mempool: add test for concurrent conflicting tx addition
  • Loading branch information
roman-khimov committed May 26, 2023
2 parents aca12b5 + db812f7 commit 871ee18
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/core/mempool/mem_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,13 @@ func TestMempoolAddRemoveConflicts(t *testing.T) {
_, ok := mp.TryGetValue(tx13.Hash())
require.Equal(t, false, ok)
require.ErrorIs(t, mp.Add(tx13, fs), ErrConflictsAttribute)

tx14 := getConflictsTx(smallNetFee)
tx15 := getConflictsTx(smallNetFee, tx14.Hash())
require.NoError(t, mp.Add(tx15, fs))
require.NoError(t, mp.Add(tx14, fs))
err := mp.Add(tx15, fs)
require.ErrorIs(t, err, ErrConflictsAttribute)
}

func TestMempoolAddWithDataGetData(t *testing.T) {
Expand Down

0 comments on commit 871ee18

Please sign in to comment.