From 464f170342bd134d19441063305e66cc40bc82c4 Mon Sep 17 00:00:00 2001 From: Raphael Panic Date: Fri, 20 Dec 2024 16:45:34 +0100 Subject: [PATCH] Refactored inline types to also use defined inferring types --- src/lib/proof-system/zkprogram.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/lib/proof-system/zkprogram.ts b/src/lib/proof-system/zkprogram.ts index 18f646594..a93064567 100644 --- a/src/lib/proof-system/zkprogram.ts +++ b/src/lib/proof-system/zkprogram.ts @@ -199,7 +199,7 @@ type InferMethodSignatures = Config['methods']; type InferPrivateInput = { [I in keyof Config['methods']]: Config['methods'][I]['privateInputs']; }; -type InferAuxilaryOutputs = { +type InferAuxiliaryOutputs = { [I in keyof InferMethodSignatures]: Get< InferMethodSignatures[I], 'auxiliaryOutput' @@ -248,7 +248,7 @@ function ZkProgram( publicInputType: ProvableOrUndefined>; publicOutputType: ProvableOrVoid>; privateInputTypes: InferPrivateInput; - auxiliaryOutputTypes: InferAuxilaryOutputs; + auxiliaryOutputTypes: InferAuxiliaryOutputs; rawMethods: { [I in keyof Config['methods']]: InferMethodType[I]['method']; }; @@ -265,7 +265,7 @@ function ZkProgram( InferProvableOrUndefined>, InferProvableOrVoid>, InferPrivateInput[I], - InferProvableOrUndefined[I]> + InferProvableOrUndefined[I]> >; } { type Methods = { @@ -276,13 +276,8 @@ function ZkProgram( >; }; // derived types for convenience - type MethodSignatures = Config['methods']; - type PrivateInputs = { - [I in keyof Config['methods']]: Config['methods'][I]['privateInputs']; - }; - type AuxiliaryOutputs = { - [I in keyof MethodSignatures]: Get; - }; + type PrivateInputs = InferPrivateInput + type AuxiliaryOutputs = InferAuxiliaryOutputs; let doProving = true;