Skip to content

Commit

Permalink
use simple recipient registry for localhost testing
Browse files Browse the repository at this point in the history
  • Loading branch information
yuetloo committed Feb 8, 2024
1 parent 892c3f5 commit 06faf7d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion vue-app/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 14 additions & 2 deletions vue-app/src/api/recipient-registry-optimistic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,20 @@ import { formToRecipientData } from './recipient'

async function getRegistryInfo(registryAddress: string): Promise<RegistryInfo> {
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()
Expand Down

0 comments on commit 06faf7d

Please sign in to comment.