From 888313ac1a9ef81d6fa408e7ee7a3d7b358a7e62 Mon Sep 17 00:00:00 2001 From: Vitor Date: Thu, 13 Jun 2024 09:02:05 -0300 Subject: [PATCH] fix: deployment block input --- config/schema.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/schema.ts b/config/schema.ts index ba9e4ea2..1aa37595 100644 --- a/config/schema.ts +++ b/config/schema.ts @@ -6,7 +6,11 @@ const ethAddressRegex = /^0x[a-fA-F0-9]{40}$/; export const formSchema = z.object({ address: z.string().regex(ethAddressRegex, "Invalid Ethereum address"), networkId: z.string(), - deploymentBlock: z.number().optional(), + deploymentBlock: z.coerce + .number({ + invalid_type_error: "Invalid deployment block", + }) + .optional(), }); export const voteSchema = z.object({