Skip to content

Commit 56f8517

Browse files
committed
Run 'npm run format .'
1 parent 2a14cd4 commit 56f8517

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+386
-352
lines changed

src/bindings/crypto/bindings/bindings.unit-test.ts

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,28 @@ function option<T, S>(spec: Spec<T, S>): Spec<MlOption<T>, S | undefined> {
9090
};
9191
}
9292

93-
equivalentRecord(Bigint256Bindings as Omit<typeof Bigint256Bindings, "caml_bigint_256_print" | "caml_bigint_256_to_string">, wasm, {
94-
caml_bigint_256_of_numeral: undefined, // TODO
95-
caml_bigint_256_of_decimal_string: { from: [decimalString], to: bigint256 },
96-
caml_bigint_256_num_limbs: { from: [], to: number },
97-
caml_bigint_256_bytes_per_limb: { from: [], to: number },
98-
caml_bigint_256_div: { from: [bigint256, bigint256], to: bigint256 },
99-
caml_bigint_256_compare: { from: [bigint256, bigint256], to: number },
100-
caml_bigint_256_test_bit: {
101-
from: [bigint256, numberLessThan(256)],
102-
to: boolean,
103-
},
104-
caml_bigint_256_to_bytes: { from: [bigint256], to: bytes },
105-
caml_bigint_256_of_bytes: { from: [bytes], to: bigint256 },
106-
caml_bigint_256_deep_copy: { from: [bigint256], to: bigint256 },
107-
});
108-
109-
110-
93+
equivalentRecord(
94+
Bigint256Bindings as Omit<
95+
typeof Bigint256Bindings,
96+
'caml_bigint_256_print' | 'caml_bigint_256_to_string'
97+
>,
98+
wasm,
99+
{
100+
caml_bigint_256_of_numeral: undefined, // TODO
101+
caml_bigint_256_of_decimal_string: { from: [decimalString], to: bigint256 },
102+
caml_bigint_256_num_limbs: { from: [], to: number },
103+
caml_bigint_256_bytes_per_limb: { from: [], to: number },
104+
caml_bigint_256_div: { from: [bigint256, bigint256], to: bigint256 },
105+
caml_bigint_256_compare: { from: [bigint256, bigint256], to: number },
106+
caml_bigint_256_test_bit: {
107+
from: [bigint256, numberLessThan(256)],
108+
to: boolean,
109+
},
110+
caml_bigint_256_to_bytes: { from: [bigint256], to: bytes },
111+
caml_bigint_256_of_bytes: { from: [bytes], to: bigint256 },
112+
caml_bigint_256_deep_copy: { from: [bigint256], to: bigint256 },
113+
}
114+
);
111115

112116
// elliptic curve
113117

src/bindings/crypto/bindings/conversion-proof.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const pointEvalsOptionFromRust = mapPointEvalsOption(fieldFromRust);
5353
type WasmProofEvaluations = [
5454
0,
5555
MlOption<PointEvaluations<Uint8Array>>,
56-
...RemoveLeadingZero<ProofEvaluations<Uint8Array>>
56+
...RemoveLeadingZero<ProofEvaluations<Uint8Array>>,
5757
];
5858

5959
type wasm = typeof wasmNamespace;

src/bindings/crypto/bindings/kimchi-types.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type Gate = [
4444
_: 0,
4545
typ: GateType,
4646
wires: [0, Wire, Wire, Wire, Wire, Wire, Wire, Wire],
47-
coeffs: MlArray<Field>
47+
coeffs: MlArray<Field>,
4848
];
4949

5050
type PolyComm = [_: 0, elems: MlArray<OrInfinity>];
@@ -68,7 +68,7 @@ type VerificationEvals = [
6868
range_check1_comm: MlOption<PolyComm>,
6969
foreign_field_add_comm: MlOption<PolyComm>,
7070
foreign_field_mul_comm: MlOption<PolyComm>,
71-
rot_comm: MlOption<PolyComm>
71+
rot_comm: MlOption<PolyComm>,
7272
];
7373

7474
type VerifierIndex = [
@@ -81,7 +81,7 @@ type VerifierIndex = [
8181
evals: VerificationEvals,
8282
shifts: MlArray<Field>,
8383
lookup_index: MlOption<Lookup<PolyComm>>,
84-
zkRows: number
84+
zkRows: number,
8585
];
8686

8787
// oracles
@@ -99,14 +99,14 @@ type RandomOracles = [
9999
u: Field,
100100
zeta_chal: ScalarChallenge,
101101
v_chal: ScalarChallenge,
102-
u_chal: ScalarChallenge
102+
u_chal: ScalarChallenge,
103103
];
104104
type Oracles = [
105105
_: 0,
106106
o: RandomOracles,
107107
p_eval: [0, Field, Field],
108108
opening_prechallenges: MlArray<Field>,
109-
digest_before_evaluations: Field
109+
digest_before_evaluations: Field,
110110
];
111111

112112
// proof
@@ -115,22 +115,22 @@ type LookupCommitments = [
115115
_: 0,
116116
sorted: MlArray<PolyComm>,
117117
aggreg: PolyComm,
118-
runtime: MlOption<PolyComm>
118+
runtime: MlOption<PolyComm>,
119119
];
120120
type ProverCommitments = [
121121
_: 0,
122122
w_comm: MlTuple<PolyComm, 15>,
123123
z_comm: PolyComm,
124124
t_comm: PolyComm,
125-
lookup: MlOption<LookupCommitments>
125+
lookup: MlOption<LookupCommitments>,
126126
];
127127
type OpeningProof = [
128128
_: 0,
129129
lr: MlArray<[0, OrInfinity, OrInfinity]>,
130130
delta: OrInfinity,
131131
z1: Field,
132132
z2: Field,
133-
sg: OrInfinity
133+
sg: OrInfinity,
134134
];
135135
type PointEvaluations<Field> = [_: 0, zeta: MlArray<Field>, zeta_omega: MlArray<Field>];
136136

@@ -163,7 +163,7 @@ type ProofEvaluations<Field> = [
163163
xor_lookup_selector: MlOption<PointEvaluations<Field>>,
164164
lookup_gate_lookup_selector: MlOption<PointEvaluations<Field>>,
165165
range_check_lookup_selector: MlOption<PointEvaluations<Field>>,
166-
foreign_field_mul_lookup_selector: MlOption<PointEvaluations<Field>>
166+
foreign_field_mul_lookup_selector: MlOption<PointEvaluations<Field>>,
167167
];
168168

169169
type RecursionChallenge = [_: 0, chals: MlArray<Field>, comm: PolyComm];
@@ -175,7 +175,7 @@ type ProverProof = [
175175
evals: ProofEvaluations<Field>,
176176
ft_eval1: Field,
177177
public_: MlArray<Field>,
178-
prev_challenges: MlArray<RecursionChallenge>
178+
prev_challenges: MlArray<RecursionChallenge>,
179179
];
180180

181181
type ProofWithPublic = [_: 0, public_evals: MlOption<PointEvaluations<Field>>, proof: ProverProof];

src/bindings/crypto/bindings/lookup.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ type LookupPatterns = [
77
xor: MlBool,
88
lookup: MlBool,
99
range_check: MlBool,
10-
foreign_field_mul: MlBool
10+
foreign_field_mul: MlBool,
1111
];
1212
type LookupFeatures = [
1313
_: 0,
1414
patterns: LookupPatterns,
1515
joint_lookup_used: MlBool,
16-
uses_runtime_tables: MlBool
16+
uses_runtime_tables: MlBool,
1717
];
1818
type LookupInfo = [_: 0, max_per_row: number, max_joint_size: number, features: LookupFeatures];
1919
type LookupSelectors<PolyComm> = [
2020
_: 0,
2121
lookup: MlOption<PolyComm>,
2222
xor: MlOption<PolyComm>,
2323
range_check: MlOption<PolyComm>,
24-
ffmul: MlOption<PolyComm>
24+
ffmul: MlOption<PolyComm>,
2525
];
2626
type Lookup<PolyComm> = [
2727
_: 0,
@@ -30,5 +30,5 @@ type Lookup<PolyComm> = [
3030
selectors: LookupSelectors<PolyComm>,
3131
table_ids: MlOption<PolyComm>,
3232
lookup_info: LookupInfo,
33-
runtime_tables_selector: MlOption<PolyComm>
33+
runtime_tables_selector: MlOption<PolyComm>,
3434
];

src/bindings/crypto/bindings/test-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function equivalentRecord<
99
S extends Record<keyof T, AnyFunction>,
1010
Specs extends {
1111
[k in keyof T]: SpecFromFunctions<T[k], S[k]> | undefined;
12-
}
12+
},
1313
>(t: T, s: S, specs: Specs) {
1414
for (let key in specs) {
1515
let spec = specs[key];

src/bindings/crypto/finite-field.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ function fastInverse(x: bigint, p: bigint, n: number, kmax: bigint, twoToMinusKm
137137
u = unew >> wn;
138138
v = vnew >> wn;
139139

140-
if (u < 0) (u = -u), (f0n = -f0n), (g0n = -g0n);
141-
if (v < 0) (v = -v), (f1n = -f1n), (g1n = -g1n);
140+
if (u < 0) ((u = -u), (f0n = -f0n), (g0n = -g0n));
141+
if (v < 0) ((v = -v), (f1n = -f1n), (g1n = -g1n));
142142

143143
let rnew = r * f0n + s * g0n;
144144
let snew = s * g1n + r * f1n;

src/bindings/crypto/non-negative.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ function assertPositiveInteger(n: number, message: string) {
4646
type Integer<T extends number> = number extends T
4747
? never
4848
: `${T}` extends `${string}.${string}` | `${string}e-${string}`
49-
? never
50-
: T;
49+
? never
50+
: T;
5151
type NonNegativeInteger<T extends number> = number extends T
5252
? never
5353
: `${T}` extends `-${string}` | `${string}.${string}` | `${string}e-${string}`
54-
? never
55-
: T;
54+
? never
55+
: T;
5656
type PositiveInteger<T extends number> = number extends T
5757
? never
5858
: `${T}` extends `-${string}` | `${string}.${string}` | `${string}e-${string}` | `0`
59-
? never
60-
: T;
59+
? never
60+
: T;

src/bindings/lib/from-layout.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type GenericTypeMap<
1616
BalanceChange,
1717
PublicKey,
1818
AuthRequired,
19-
TokenId
19+
TokenId,
2020
> = {
2121
Field: Field;
2222
Bool: Bool;
@@ -37,7 +37,7 @@ type TypeMapValues<TypeMap extends AnyTypeMap, JsonMap extends AnyTypeMap, BaseT
3737
type TypeMapProvable<
3838
TypeMap extends AnyTypeMap,
3939
ValueMap extends AnyTypeMap,
40-
JsonMap extends AnyTypeMap
40+
JsonMap extends AnyTypeMap,
4141
> = {
4242
[K in keyof TypeMap & keyof JsonMap]: K extends keyof ValueMap
4343
? GenericProvableExtended<TypeMap[K], ValueMap[K], JsonMap[K], TypeMap['Field']>
@@ -270,7 +270,7 @@ function SignableFromLayout<TypeMap extends AnyTypeMap, JsonMap extends AnyTypeM
270270
function ProvableFromLayout<
271271
TypeMap extends AnyTypeMap,
272272
ValueMap extends AnyTypeMap,
273-
JsonMap extends AnyTypeMap
273+
JsonMap extends AnyTypeMap,
274274
>(
275275
TypeMap: TypeMapProvable<TypeMap, ValueMap, JsonMap>,
276276
customTypes: Record<string, GenericProvableExtended<any, any, any, TypeMap['Field']>>
@@ -509,7 +509,7 @@ function genericLayoutFold<
509509
T = any,
510510
R = any,
511511
TypeMap extends AnyTypeMap = AnyTypeMap,
512-
JsonMap extends AnyTypeMap = AnyTypeMap
512+
JsonMap extends AnyTypeMap = AnyTypeMap,
513513
>(
514514
TypeMap: TypeMapValues<TypeMap, JsonMap, BaseType>,
515515
customTypes: Record<string, BaseType>,
@@ -575,7 +575,7 @@ function genericLayoutMap<
575575
T = any,
576576
R = any,
577577
TypeMap extends AnyTypeMap = AnyTypeMap,
578-
JsonMap extends AnyTypeMap = AnyTypeMap
578+
JsonMap extends AnyTypeMap = AnyTypeMap,
579579
>(
580580
TypeMap: TypeMapValues<TypeMap, JsonMap, BaseType>,
581581
customTypes: Record<string, BaseType>,

0 commit comments

Comments
 (0)