Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit 33b1715

Browse files
committed
fix timing issue
1 parent 501a15b commit 33b1715

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/dataunion/DataUnion.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -648,16 +648,16 @@ export class DataUnion {
648648
const helper = this.getContracts()
649649
const sidechainAmb = await helper.getSidechainAmb()
650650
const mainnetAmb = await helper.getMainnetAmb()
651-
const message = await sidechainAmb.message(messageHash)
652651

652+
log(`Waiting until sidechain AMB has collected required signatures for hash=${messageHash}...`)
653+
await until(async () => helper.requiredSignaturesHaveBeenCollected(messageHash), pollingIntervalMs, retryTimeoutMs)
654+
655+
const message = await sidechainAmb.message(messageHash)
653656
if (message === '0x') {
654657
throw new Error(`Message with hash=${messageHash} not found`)
655658
}
656659
const messageId = '0x' + message.substr(2, 64)
657660

658-
log(`Waiting until sidechain AMB has collected required signatures for hash=${messageHash}...`)
659-
await until(async () => helper.requiredSignaturesHaveBeenCollected(messageHash), pollingIntervalMs, retryTimeoutMs)
660-
661661
log(`Checking mainnet AMB hasn't already processed messageId=${messageId}`)
662662
const alreadySent = await mainnetAmb.messageCallStatus(messageId)
663663
const failAddress = await mainnetAmb.failedMessageSender(messageId)

0 commit comments

Comments
 (0)