Skip to content

Commit

Permalink
feat: wrap retry to waitSeqno
Browse files Browse the repository at this point in the history
  • Loading branch information
meomeocoj committed Aug 14, 2024
1 parent 1d65ba6 commit 83be86a
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions packages/cw-to-ton/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,17 @@ export const createTonWorker = (
3,
5000
);
await waitSeqno(walletContract, await walletContract.getSeqno(), 15);
retry(
async () => {
await waitSeqno(
walletContract,
await walletContract.getSeqno(),
15
);
},
3,
1000
);
await sleep(30000); // TODO: Alter by tracing transaction to get the result
} catch (error) {
throw new Error(`[TON-WORKER] Update light client failed: ${error}`);
Expand All @@ -92,7 +102,13 @@ export const createTonWorker = (
5000
);
console.log("[TON-WORKER] Relay packet successfully");
await waitSeqno(walletContract, await walletContract.getSeqno(), 15);
retry(
async () => {
await waitSeqno(walletContract, await walletContract.getSeqno(), 15);
},
3,
1000
);
},
{
connection,
Expand Down

0 comments on commit 83be86a

Please sign in to comment.