Skip to content

Commit 464f170

Browse files
committed
Refactored inline types to also use defined inferring types
1 parent 4de57a7 commit 464f170

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/lib/proof-system/zkprogram.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ type InferMethodSignatures<Config extends ConfigBaseType> = Config['methods'];
199199
type InferPrivateInput<Config extends ConfigBaseType> = {
200200
[I in keyof Config['methods']]: Config['methods'][I]['privateInputs'];
201201
};
202-
type InferAuxilaryOutputs<Config extends ConfigBaseType> = {
202+
type InferAuxiliaryOutputs<Config extends ConfigBaseType> = {
203203
[I in keyof InferMethodSignatures<Config>]: Get<
204204
InferMethodSignatures<Config>[I],
205205
'auxiliaryOutput'
@@ -248,7 +248,7 @@ function ZkProgram<Config extends ConfigBaseType>(
248248
publicInputType: ProvableOrUndefined<Get<Config, 'publicInput'>>;
249249
publicOutputType: ProvableOrVoid<Get<Config, 'publicOutput'>>;
250250
privateInputTypes: InferPrivateInput<Config>;
251-
auxiliaryOutputTypes: InferAuxilaryOutputs<Config>;
251+
auxiliaryOutputTypes: InferAuxiliaryOutputs<Config>;
252252
rawMethods: {
253253
[I in keyof Config['methods']]: InferMethodType<Config>[I]['method'];
254254
};
@@ -265,7 +265,7 @@ function ZkProgram<Config extends ConfigBaseType>(
265265
InferProvableOrUndefined<Get<Config, 'publicInput'>>,
266266
InferProvableOrVoid<Get<Config, 'publicOutput'>>,
267267
InferPrivateInput<Config>[I],
268-
InferProvableOrUndefined<InferAuxilaryOutputs<Config>[I]>
268+
InferProvableOrUndefined<InferAuxiliaryOutputs<Config>[I]>
269269
>;
270270
} {
271271
type Methods = {
@@ -276,13 +276,8 @@ function ZkProgram<Config extends ConfigBaseType>(
276276
>;
277277
};
278278
// derived types for convenience
279-
type MethodSignatures = Config['methods'];
280-
type PrivateInputs = {
281-
[I in keyof Config['methods']]: Config['methods'][I]['privateInputs'];
282-
};
283-
type AuxiliaryOutputs = {
284-
[I in keyof MethodSignatures]: Get<MethodSignatures[I], 'auxiliaryOutput'>;
285-
};
279+
type PrivateInputs = InferPrivateInput<Config>
280+
type AuxiliaryOutputs = InferAuxiliaryOutputs<Config>;
286281

287282
let doProving = true;
288283

0 commit comments

Comments
 (0)