fix(tests): add sleep in high precision test to prevent duplicate tx
Add sleep(200) between refreshSegment calls in loops and sleep(500) between commitToResult calls Co-authored-by: Alex Ant <dacom-dark-sun@users.noreply.github.com>
This commit is contained in:
@@ -2275,6 +2275,7 @@ describe('тест контракта CAPITAL', () => {
|
||||
// })
|
||||
|
||||
it('тест ВЫСОКОЙ ТОЧНОСТИ: 1 млрд инвестиций и 10к часов', async () => {
|
||||
await sleep(1000)
|
||||
console.log('\n🚀 СТАРТ ТЕСТА ВЫСОКОЙ ТОЧНОСТИ (50M RUB) 🚀\n')
|
||||
const auditHistory: any[] = []
|
||||
const this_investor = investor3
|
||||
@@ -2433,6 +2434,7 @@ describe('тест контракта CAPITAL', () => {
|
||||
|
||||
for (const p of participants) {
|
||||
await refreshSegment(blockchain, 'voskhod', highPrecisionHash, p)
|
||||
await sleep(200)
|
||||
}
|
||||
|
||||
await auditParticipants('1. ИНВЕСТИЦИЯ', highPrecisionHash)
|
||||
@@ -2440,11 +2442,13 @@ describe('тест контракта CAPITAL', () => {
|
||||
// 7. Два взноса по 5000 часов
|
||||
console.log('--- Взнос результата: 5000 часов от tester1 ---')
|
||||
await commitToResult(blockchain, 'voskhod', highPrecisionHash, tester1, 5000)
|
||||
await sleep(500)
|
||||
console.log('--- Взнос результата: 5000 часов от tester2 ---')
|
||||
await commitToResult(blockchain, 'voskhod', highPrecisionHash, tester2, 5000)
|
||||
|
||||
for (const p of participants) {
|
||||
await refreshSegment(blockchain, 'voskhod', highPrecisionHash, p)
|
||||
await sleep(200)
|
||||
}
|
||||
|
||||
await auditParticipants('2. ВЗНОСЫ ВРЕМЕНЕМ', highPrecisionHash)
|
||||
@@ -2473,6 +2477,7 @@ describe('тест контракта CAPITAL', () => {
|
||||
await processCalculateVotes(blockchain, { coopname: 'voskhod', username: p, project_hash: highPrecisionHash })
|
||||
}
|
||||
await refreshSegment(blockchain, 'voskhod', highPrecisionHash, p)
|
||||
await sleep(200)
|
||||
}
|
||||
|
||||
await auditParticipants('4. ФИНАЛ (ОБНОВЛ. СЕГМЕНТЫ)', highPrecisionHash)
|
||||
|
||||
Reference in New Issue
Block a user