From 3c68f943f6c1f28c24d466b8d5e58f8f5c4d2e8a Mon Sep 17 00:00:00 2001 From: MarcoMandar Date: Thu, 26 Sep 2024 09:15:47 +0100 Subject: [PATCH 1/3] update error for locking tokens Signed-off-by: MarcoMandar --- composables/registrator/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composables/registrator/index.ts b/composables/registrator/index.ts index d0229a1..a31d1ba 100755 --- a/composables/registrator/index.ts +++ b/composables/registrator/index.ts @@ -260,7 +260,7 @@ export class Registrator { icon: 'i-heroicons-x-circle', color: 'amber', title: 'Error', - description: `Error redeem rewards: ${msg}`, + description: `Error locking rewards ${formatEther(registratorStore.currentLockSize || '0')} $ANYONE: ${msg}`, }); } else { toast.add({ From 000bb44e2acc133bc120922618d878d1c22c9368 Mon Sep 17 00:00:00 2001 From: MarcoMandar Date: Thu, 26 Sep 2024 09:40:45 +0100 Subject: [PATCH 2/3] add a retry for the claim result wait Signed-off-by: MarcoMandar --- composables/facilitator/index.ts | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/composables/facilitator/index.ts b/composables/facilitator/index.ts index d5fdc82..9f2de3b 100755 --- a/composables/facilitator/index.ts +++ b/composables/facilitator/index.ts @@ -407,7 +407,28 @@ export class Facilitator { const to = await this.contract.getAddress(); const result = await this.signer.sendTransaction({ to, value }); - await result.wait(); + + const maxRetries = 3; + const delay = (ms: number) => + new Promise((resolve) => setTimeout(resolve, ms)); + + for (let attempt = 1; attempt <= maxRetries; attempt++) { + try { + await result.wait(); + break; + } catch (error) { + if (attempt < maxRetries) { + this.logger.warn( + `Attempt ${attempt} failed, retrying in 2 seconds...` + ); + await delay(2000); + } else { + throw new Error( + `Transaction confirmation failed after ${maxRetries} attempts` + ); + } + } + } const block = await result.getBlock(); const timestamp = block?.timestamp || Math.floor(Date.now() / 1000); useFacilitatorStore().addPendingClaim(result.hash, timestamp); From 6d85690559e52de436b28fa990dbe87af0091fae Mon Sep 17 00:00:00 2001 From: MarcoMandar Date: Thu, 26 Sep 2024 09:47:14 +0100 Subject: [PATCH 3/3] version Signed-off-by: MarcoMandar --- nuxt.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index 0aadbcb..3ff1887 100755 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -72,7 +72,7 @@ export default defineNuxtConfig({ supportWalletPublicKeyBase64: 'K3jnSGVyHj4kSzgce3+k8gJsfHvUoQeJMNPO8CcsO2s=', commitHash: process.env.NUXT_PUBLIC_COMMIT_HASH || 'dev', - version: '1.2.3', + version: '1.2.4', }, }, plugins: [{ src: '~/plugins/vue-query.client.ts', mode: 'client' }],