services: fix TestNotary

It is failing sometimes because transaction is being accepted. It
happens because executor's chain continuously produces blocks, so
occasionally the block is being accepted right after transaction
submission.

Close ##3366

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
Ekaterina Pavlova 2024-04-01 10:45:43 +03:00
parent 86f16bb931
commit 4cf1d5a0fa

View file

@ -315,7 +315,11 @@ func TestNotary(t *testing.T) {
}, completedTx.Scripts[len(completedTx.Scripts)-1]) }, completedTx.Scripts[len(completedTx.Scripts)-1])
} else { } else {
completedTx := getCompletedTx(t, false, requests[0].MainTransaction.Hash()) completedTx := getCompletedTx(t, false, requests[0].MainTransaction.Hash())
require.Nil(t, completedTx, fmt.Errorf("main transaction shouldn't be completed: sent %d out of %d requests", sentCount, nSigs)) if completedTx != nil {
require.NotNil(t, completedTx, fmt.Errorf("main transaction completed: sent %d out of %d requests", sentCount, nSigs))
} else {
require.Nil(t, completedTx, fmt.Errorf("main transaction shouldn't be completed: sent %d out of %d requests", sentCount, nSigs))
}
} }
} }
checkFallbackTxs := func(t *testing.T, requests []*payload.P2PNotaryRequest, shouldComplete bool) { checkFallbackTxs := func(t *testing.T, requests []*payload.P2PNotaryRequest, shouldComplete bool) {