Skip to content

Commit

Permalink
fix(utils): PresentationRequestSchema claims
Browse files Browse the repository at this point in the history
  • Loading branch information
martonmoro committed Nov 29, 2024
1 parent 26787c1 commit da43053
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/docs/src/components/test-zkapp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { clsx } from "clsx";
import { useState, useSyncExternalStore } from "react";
import {
sampleCredentialSimple,
samplePresentationRequestHttpsRecrusiveNoContext,
samplePresentationRequestHttpsFromExample,
} from "./sample-data";

const store = createStore();
Expand All @@ -27,7 +27,7 @@ export const TestZkApp = () => {
JSON.stringify(sampleCredentialSimple, null, 2),
);
const [presentationRequest, setPresentationRequest] = useState(
JSON.stringify(samplePresentationRequestHttpsRecrusiveNoContext, null, 2),
JSON.stringify(samplePresentationRequestHttpsFromExample, null, 2),
);
const [transactionBody, setTransactionBody] = useObjectState({
to: "B62qnVUL6A53E4ZaGd3qbTr6RCtEZYTu3kTijVrrquNpPo4d3MuJ3nb",
Expand Down
10 changes: 9 additions & 1 deletion packages/utils/src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,15 @@ export const PresentationRequestSchema = z
.strict(),
})
.strict(),
claims: z.record(SerializedValueSchema),
claims: z.record(
z.union([
SerializedValueSchema,
DynamicStringSchema,
DynamicArraySchema,
DynamicRecordSchema,
DynamicBytesSchema,
]),
),
inputContext: z.union([ContextSchema, z.null()]),
})
.strict();
Expand Down

0 comments on commit da43053

Please sign in to comment.