Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ const admin = await semaphoreEthers.getGroupAdmin("42")
const members = await semaphoreEthers.getGroupMembers("42")
```

**Fetch Verified Proofs**
**Fetch Validated Proofs**

```typescript
const verifiedProofs = await semaphoreEthers.getGroupVerifiedProofs("42")
const verifiedProofs = await semaphoreEthers.getGroupValidatedProofs("42")
```

**Check Group Membership**
Expand Down
16 changes: 7 additions & 9 deletions packages/data/src/viem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default class SemaphoreViem {
const { address, startBlock } = getDeployedContract(networkOrEthereumURL as SupportedNetwork)

options.address ??= address
options.startBlock ??= BigInt(startBlock || 0)
options.startBlock ??= BigInt(startBlock)
} else {
options.startBlock ??= 0n
}
Expand Down Expand Up @@ -244,7 +244,7 @@ export default class SemaphoreViem {
abi: SemaphoreABI,
eventName: "MemberRemoved",
args: {
groupId
groupId: BigInt(groupId)
},
fromBlock: BigInt(this._options.startBlock || 0)
})) as MemberRemovedLog[]
Expand All @@ -255,7 +255,7 @@ export default class SemaphoreViem {
abi: SemaphoreABI,
eventName: "MemberUpdated",
args: {
groupId
groupId: BigInt(groupId)
},
fromBlock: BigInt(this._options.startBlock || 0)
})) as MemberUpdatedLog[]
Expand Down Expand Up @@ -287,7 +287,7 @@ export default class SemaphoreViem {
abi: SemaphoreABI,
eventName: "MembersAdded",
args: {
groupId
groupId: BigInt(groupId)
},
fromBlock: BigInt(this._options.startBlock || 0)
})) as MembersAddedLog[]
Expand All @@ -309,7 +309,7 @@ export default class SemaphoreViem {
abi: SemaphoreABI,
eventName: "MemberAdded",
args: {
groupId
groupId: BigInt(groupId)
},
fromBlock: BigInt(this._options.startBlock || 0)
})) as MemberAddedLog[]
Expand All @@ -328,12 +328,10 @@ export default class SemaphoreViem {
index += identityCommitments.length
} else {
const currentIndex = index // Create a closure to capture the current index value
const event = memberAddedEvents.find((e) => e.args.index && Number(e.args.index) === currentIndex)
const event = memberAddedEvents.find((e) => Number(e.args.index) === currentIndex)

if (event && event.args.identityCommitment) {
members.push(event.args.identityCommitment.toString())
} else {
members.push("0") // Placeholder for missing member
}

index += 1
Expand Down Expand Up @@ -372,7 +370,7 @@ export default class SemaphoreViem {
abi: SemaphoreABI,
eventName: "ProofValidated",
args: {
groupId
groupId: BigInt(groupId)
},
fromBlock: BigInt(this._options.startBlock || 0)
})) as ProofValidatedLog[]
Expand Down
Loading