Skip to content

Commit

Permalink
Bump dependencies on POD and GPC
Browse files Browse the repository at this point in the history
  • Loading branch information
robknight committed Oct 31, 2024
1 parent f6aa12d commit e791dce
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 93 deletions.
8 changes: 4 additions & 4 deletions apps/client-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"@parcnet-js/client-helpers": "workspace:*",
"@parcnet-js/client-rpc": "workspace:*",
"@parcnet-js/podspec": "workspace:*",
"@pcd/gpc": "^0.3.0",
"@pcd/pod": "^0.4.0",
"@pcd/proto-pod-gpc-artifacts": "^0.9.0",
"@pcd/gpc": "^0.4.0",
"@pcd/pod": "^0.5.0",
"@pcd/proto-pod-gpc-artifacts": "^0.13.0",
"@radix-ui/react-dialog": "^1.1.1",
"@semaphore-protocol/core": "^4.4.1",
"@semaphore-protocol/core": "^4.5.0",
"@semaphore-protocol/identity": "3.15.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
Expand Down
20 changes: 10 additions & 10 deletions apps/client-web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { listen } from "@parcnet-js/client-helpers/connection/iframe";
import type { Zapp } from "@parcnet-js/client-rpc";
import type { EntriesSchema, ProofConfigPODSchema } from "@parcnet-js/podspec";
import { proofRequest } from "@parcnet-js/podspec";
import { gpcProve } from "@pcd/gpc";
import { type GPCProofInputs, gpcProve } from "@pcd/gpc";
import type { POD } from "@pcd/pod";
import { POD_INT_MAX, POD_INT_MIN } from "@pcd/pod";
import type { Dispatch, ReactNode } from "react";
Expand Down Expand Up @@ -130,9 +130,10 @@ function ProvePODInfo({
})
.filter(
([_, entry]) =>
!!entry.isMemberOf ||
!!entry.isNotMemberOf ||
!!(entry.type === "int" && entry.inRange)
entry.type !== "null" &&
(!!entry.isMemberOf ||
!!entry.isNotMemberOf ||
!!(entry.type === "int" && entry.inRange))
);

return (
Expand All @@ -155,7 +156,7 @@ function ProvePODInfo({
{schema.pod.meta?.labelEntry
? pod.content
.asEntries()
[schema.pod.meta.labelEntry].value.toString()
[schema.pod.meta.labelEntry].value?.toString()
: pod.signature.substring(0, 16)}
</option>
);
Expand All @@ -171,7 +172,7 @@ function ProvePODInfo({
<Fragment key={`${name}-${entryName}`}>
<div>{entryName}</div>
<div>
{selectedPODEntries?.[entryName].value.toString() ?? "-"}
{selectedPODEntries?.[entryName].value?.toString() ?? "-"}
</div>
</Fragment>
);
Expand All @@ -183,7 +184,7 @@ function ProvePODInfo({
{entriesWithConstraints.map(([entryName, entry]) => {
return (
<div key={`${name}-${entryName}-constraints`} className="my-1">
{entry.isMemberOf && (
{entry.type !== "null" && entry.isMemberOf && (
<div>
<span className="font-semibold">{entryName}</span> is member
of list:{" "}
Expand All @@ -196,7 +197,7 @@ function ProvePODInfo({
</Reveal>
</div>
)}
{entry.isNotMemberOf && (
{entry.type !== "null" && entry.isNotMemberOf && (
<div>
<span className="font-semibold">{entryName}</span> is not
member of list:{" "}
Expand Down Expand Up @@ -294,7 +295,7 @@ export function Prove({
const prs = proofRequest(
proveOperation.proofRequest
).getProofRequest();
const inputs = {
const inputs: GPCProofInputs = {
pods: proveOperation.selectedPods as Record<string, POD>,
membershipLists: prs.membershipLists,
watermark: prs.watermark,
Expand All @@ -303,7 +304,6 @@ export function Prove({
externalNullifier: prs.externalNullifier
}
};
console.log(inputs);
gpcProve(
{
...prs.proofConfig,
Expand Down
4 changes: 2 additions & 2 deletions packages/app-connector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"dependencies": {
"@parcnet-js/client-rpc": "workspace:*",
"@parcnet-js/podspec": "workspace:*",
"@pcd/gpc": "^0.3.0",
"@pcd/pod": "^0.4.0",
"@pcd/gpc": "^0.4.0",
"@pcd/pod": "^0.5.0",
"nanoevents": "^9.0.0",
"valibot": "^0.42.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/client-rpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"files": ["dist", "LICENSE"],
"dependencies": {
"@parcnet-js/podspec": "workspace:*",
"@pcd/gpc": "^0.3.0",
"@pcd/pod": "^0.4.0",
"@pcd/gpc": "^0.4.0",
"@pcd/pod": "^0.5.0",
"valibot": "^0.42.0"
},
"devDependencies": {
Expand Down
24 changes: 24 additions & 0 deletions packages/client-rpc/src/schema_elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,30 @@ export const DefinedEntrySchema = v.variant("type", [
isNotMemberOf: v.optional(v.array(PODValueSchema)),
isRevealed: v.optional(v.boolean()),
equalsEntry: v.optional(v.string())
}),
v.object({
type: v.literal("null")
}),
v.object({
type: v.literal("bytes"),
isMemberOf: v.optional(v.array(PODValueSchema)),
isNotMemberOf: v.optional(v.array(PODValueSchema))
}),
v.object({
type: v.literal("date"),
isMemberOf: v.optional(v.array(PODValueSchema)),
isNotMemberOf: v.optional(v.array(PODValueSchema)),
inRange: v.optional(
v.object({
min: v.bigint(),
max: v.bigint()
})
)
}),
v.object({
type: v.literal("boolean"),
isMemberOf: v.optional(v.array(PODValueSchema)),
isNotMemberOf: v.optional(v.array(PODValueSchema))
})
]);

Expand Down
4 changes: 2 additions & 2 deletions packages/podspec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
},
"files": ["dist", "./README.md", "./LICENSE"],
"dependencies": {
"@pcd/gpc": "^0.3.0",
"@pcd/pod": "^0.4.0"
"@pcd/gpc": "^0.4.0",
"@pcd/pod": "^0.5.0"
},
"devDependencies": {
"@parcnet-js/eslint-config": "workspace:*",
Expand Down
6 changes: 3 additions & 3 deletions packages/ticket-spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"devDependencies": {
"@parcnet-js/eslint-config": "workspace:*",
"@parcnet-js/typescript-config": "workspace:*",
"@pcd/gpc": "^0.3.0",
"@pcd/pod": "^0.4.0",
"@pcd/proto-pod-gpc-artifacts": "^0.9.0",
"@pcd/gpc": "^0.4.0",
"@pcd/pod": "^0.5.0",
"@pcd/proto-pod-gpc-artifacts": "^0.13.0",
"@semaphore-protocol/core": "^4.0.3",
"@semaphore-protocol/identity": "^3.15.2",
"@types/uuid": "^9.0.0",
Expand Down
Loading

0 comments on commit e791dce

Please sign in to comment.