From 06faf7d7fc9edbbb01d970826d09d135667c42b3 Mon Sep 17 00:00:00 2001 From: yuetloo Date: Thu, 8 Feb 2024 18:05:53 -0500 Subject: [PATCH] use simple recipient registry for localhost testing --- README.md | 4 ++-- vue-app/.env.example | 2 +- vue-app/src/api/recipient-registry-optimistic.ts | 16 ++++++++++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f2a3cb231..33b291a72 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,8 @@ In a future version, we plan to address this by routing ETH and token contributi ### Install Node v18 with nvm ```sh -nvm install 18 -nvm use 18 +nvm install 20 +nvm use 20 ``` ### Install the dependencies and build diff --git a/vue-app/.env.example b/vue-app/.env.example index 7686aea11..b7a9357e4 100644 --- a/vue-app/.env.example +++ b/vue-app/.env.example @@ -51,7 +51,7 @@ VITE_BRIGHTID_CONTEXT=clrfund-goerli VITE_MATCHING_POOL_ADDRESS= # Supported values: simple, optimistic, kleros -VITE_RECIPIENT_REGISTRY_TYPE=optimistic +VITE_RECIPIENT_REGISTRY_TYPE=simple VITE_RECIPIENT_REGISTRY_POLICY=QmeygKjvrpidJeFHv6ywjUrj718nwtFQgCCPPR4r5nL87R diff --git a/vue-app/src/api/recipient-registry-optimistic.ts b/vue-app/src/api/recipient-registry-optimistic.ts index be78894c1..1baf6610f 100644 --- a/vue-app/src/api/recipient-registry-optimistic.ts +++ b/vue-app/src/api/recipient-registry-optimistic.ts @@ -14,8 +14,20 @@ import { formToRecipientData } from './recipient' async function getRegistryInfo(registryAddress: string): Promise { const registry = new Contract(registryAddress, OptimisticRecipientRegistry, provider) - const deposit = await registry.baseDeposit() - const challengePeriodDuration = await registry.challengePeriodDuration() + let deposit = BigInt(0) + try { + deposit = await registry.baseDeposit() + } catch (err) { + console.error('Failed to get base deposit from', registryAddress, err) + } + + let challengePeriodDuration = BigInt(0) + try { + challengePeriodDuration = await registry.challengePeriodDuration() + } catch (err) { + console.error('Failed to get challenge period from', registryAddress, err) + } + let recipientCount try { recipientCount = await registry.getRecipientCount()