Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
spalladino committed Nov 8, 2024
1 parent e5d7bea commit f8d2189
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion yarn-project/aztec/src/cli/cmds/start_prover_agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function startProverAgent(
const proverConfig = extractRelevantOptions<ProverClientConfig>(options, proverClientConfigMappings, 'prover');
const proverJobSourceUrl = proverConfig.proverJobSourceUrl ?? proverConfig.nodeUrl;
if (!proverJobSourceUrl) {
throw new Error('Starting prover without PROVER_JOB_PROVIDER_URL is not supported');
throw new Error('Starting prover without PROVER_JOB_SOURCE_URL is not supported');
}

logger(`Connecting to prover at ${proverJobSourceUrl}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ZodError } from 'zod';
import { type DebugLogger, createDebugLogger } from '../../log/index.js';
import { promiseWithResolvers } from '../../promise/utils.js';
import { type ApiSchema, type ApiSchemaFor, parseWithOptionals, schemaHasMethod } from '../../schemas/index.js';
import { jsonStringify, tryJsonStringify } from '../convert.js';
import { jsonStringify } from '../convert.js';
import { assert } from '../js_utils.js';

export class SafeJsonRpcServer {
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/foundation/src/schemas/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export function parse<T extends [] | [z.ZodTypeAny, ...z.ZodTypeAny[]]>(args: IA
export function parseWithOptionals<T extends z.AnyZodTuple>(args: any[], schema: T): T['_output'] {
const missingCount = schema.items.length - args.length;
const optionalCount = schema.items.filter(isOptional).length;
const toParse = missingCount <= optionalCount ? args.concat(times(missingCount, () => undefined)) : args;
const toParse =
missingCount > 0 && missingCount <= optionalCount ? args.concat(times(missingCount, () => undefined)) : args;
return schema.parse(toParse);
}

Expand Down

0 comments on commit f8d2189

Please sign in to comment.