diff --git a/packages/podspec/src/gpc/proof_request.ts b/packages/podspec/src/gpc/proof_request.ts index 4dd6e1c..3334bcf 100644 --- a/packages/podspec/src/gpc/proof_request.ts +++ b/packages/podspec/src/gpc/proof_request.ts @@ -161,12 +161,12 @@ function makeProofRequest
( const entryConfig: GPCProofEntryConfig = { isRevealed, - isMemberOf: isMemberOf - ? `allowlist_${podName}_${entryName}` - : undefined, - isNotMemberOf: isNotMemberOf - ? `blocklist_${podName}_${entryName}` - : undefined, + ...(isMemberOf + ? { isMemberOf: `allowlist_${podName}_${entryName}` } + : {}), + ...(isNotMemberOf + ? { isNotMemberOf: `blocklist_${podName}_${entryName}` } + : {}), ...(inRange ? { inRange: entrySchema.inRange } : {}), ...(isOwnerID ? { isOwnerID: owner.protocol } : {}) }; diff --git a/packages/ticket-spec/test/ticket-utils.spec.ts b/packages/ticket-spec/test/ticket-utils.spec.ts index 919d179..648a4af 100644 --- a/packages/ticket-spec/test/ticket-utils.spec.ts +++ b/packages/ticket-spec/test/ticket-utils.spec.ts @@ -60,5 +60,25 @@ describe("ticket-utils", () => { externalNullifier: { type: "string", value: "1" }, watermark: { type: "string", value: "1" } }); + + const proofRequest = request.getProofRequest(); + expect(proofRequest.externalNullifier).toEqual({ + type: "string", + value: "1" + }); + expect(proofRequest.watermark).toEqual({ + type: "string", + value: "1" + }); + expect(Object.keys(proofRequest.membershipLists)).toHaveLength(0); + expect(proofRequest.proofConfig.pods.ticket).toBeDefined(); + // The owner entry is present because we specified an external nullifier + expect( + Object.keys(proofRequest.proofConfig.pods.ticket?.entries ?? {}) + ).toHaveLength(1); + expect(proofRequest.proofConfig.pods.ticket?.entries?.owner).toEqual({ + isOwnerID: "SemaphoreV4", + isRevealed: false + }); }); });