Merge pull request #3024 from nspcc-dev/add-mp-test

mempool: add test for concurrent conflicting tx addition
This commit is contained in:
Roman Khimov 2023-05-26 22:52:29 +03:00 committed by GitHub
commit 871ee18981
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {