o1js-pack 0.5.4 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,14 +1,14 @@
1
1
  import { Field, Character } from 'o1js';
2
2
  export declare function PackedStringFactory(l?: number): {
3
- new (packed: import("o1js/dist/node/lib/field.js").Field): {
3
+ new (packed: Field): {
4
4
  toString(): string;
5
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
5
+ toFields(): Array<Field>;
6
6
  assertEquals(other: {
7
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
7
+ toFields(): Array<Field>;
8
8
  assertEquals(other: any): void;
9
- packed: import("o1js/dist/node/lib/field.js").Field;
9
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
10
10
  }): void;
11
- packed: import("o1js/dist/node/lib/field.js").Field;
11
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
12
12
  };
13
13
  extractField(input: Character): Field;
14
14
  sizeInBits(): bigint;
@@ -25,13 +25,13 @@ export declare function PackedStringFactory(l?: number): {
25
25
  */
26
26
  fromCharacters(input: Array<Character>): {
27
27
  toString(): string;
28
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
28
+ toFields(): Array<Field>;
29
29
  assertEquals(other: {
30
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
30
+ toFields(): Array<Field>;
31
31
  assertEquals(other: any): void;
32
- packed: import("o1js/dist/node/lib/field.js").Field;
32
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
33
33
  }): void;
34
- packed: import("o1js/dist/node/lib/field.js").Field;
34
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
35
35
  };
36
36
  /**
37
37
  *
@@ -40,60 +40,74 @@ export declare function PackedStringFactory(l?: number): {
40
40
  */
41
41
  fromString(str: string): {
42
42
  toString(): string;
43
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
43
+ toFields(): Array<Field>;
44
44
  assertEquals(other: {
45
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
45
+ toFields(): Array<Field>;
46
46
  assertEquals(other: any): void;
47
- packed: import("o1js/dist/node/lib/field.js").Field;
47
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
48
48
  }): void;
49
- packed: import("o1js/dist/node/lib/field.js").Field;
49
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
50
50
  };
51
51
  type: import("o1js/dist/node/bindings/lib/generic.js").GenericProvableExtendedPure<{
52
- packed: import("o1js/dist/node/lib/field.js").Field;
52
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
53
+ }, {
54
+ packed: bigint;
53
55
  }, {
54
56
  packed: string;
55
- }, import("o1js/dist/node/lib/field.js").Field>;
57
+ }, import("o1js/dist/node/lib/provable/field.js").Field>;
56
58
  l: number;
57
59
  bitSize: bigint;
58
60
  checkPack(unpacked: Character[]): void;
59
- pack(unpacked: Character[]): import("o1js/dist/node/lib/field.js").Field;
60
- unpackToBigints(f: import("o1js/dist/node/lib/field.js").Field): bigint[]; /**
61
- *
62
- * @param fields Array of Fields, containing packed Characters
63
- * @returns Array of Character
64
- */
61
+ pack(unpacked: Character[]): Field;
62
+ unpackToBigints(f: Field): Array<bigint>;
65
63
  _isStruct: true;
66
64
  toFields: (value: {
67
- packed: import("o1js/dist/node/lib/field.js").Field;
68
- }) => import("o1js/dist/node/lib/field.js").Field[];
65
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
66
+ }) => import("o1js/dist/node/lib/provable/field.js").Field[];
69
67
  toAuxiliary: (value?: {
70
- packed: import("o1js/dist/node/lib/field.js").Field;
68
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
71
69
  } | undefined) => any[];
72
- fromFields: (fields: import("o1js/dist/node/lib/field.js").Field[]) => {
73
- packed: import("o1js/dist/node/lib/field.js").Field;
74
- };
75
- sizeInFields(): number;
70
+ sizeInFields: () => number;
76
71
  check: (value: {
77
- packed: import("o1js/dist/node/lib/field.js").Field;
72
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
78
73
  }) => void;
74
+ toValue: (x: {
75
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
76
+ }) => {
77
+ packed: bigint;
78
+ };
79
+ fromValue: ((x: {
80
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
81
+ } | {
82
+ packed: bigint;
83
+ }) => {
84
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
85
+ }) & ((value: {
86
+ packed: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
87
+ }) => {
88
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
89
+ });
90
+ fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
91
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
92
+ };
79
93
  toInput: (x: {
80
- packed: import("o1js/dist/node/lib/field.js").Field;
94
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
81
95
  }) => {
82
- fields?: import("o1js/dist/node/lib/field.js").Field[] | undefined;
83
- packed?: [import("o1js/dist/node/lib/field.js").Field, number][] | undefined;
96
+ fields?: Field[] | undefined;
97
+ packed?: [Field, number][] | undefined;
84
98
  };
85
99
  toJSON: (x: {
86
- packed: import("o1js/dist/node/lib/field.js").Field;
100
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
87
101
  }) => {
88
102
  packed: string;
89
103
  };
90
104
  fromJSON: (x: {
91
105
  packed: string;
92
106
  }) => {
93
- packed: import("o1js/dist/node/lib/field.js").Field;
107
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
94
108
  };
95
109
  empty: () => {
96
- packed: import("o1js/dist/node/lib/field.js").Field;
110
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
97
111
  };
98
112
  };
99
113
  /**
@@ -102,15 +116,15 @@ export declare function PackedStringFactory(l?: number): {
102
116
  * @returns MultiPackedString_ class with length of n * CHARS_PER_FIELD
103
117
  */
104
118
  export declare function MultiPackedStringFactory(n?: number): {
105
- new (packed: import("o1js/dist/node/lib/field.js").Field[]): {
119
+ new (packed: Array<Field>): {
106
120
  toString(): string;
107
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
121
+ toFields(): Array<Field>;
108
122
  assertEquals(other: {
109
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
123
+ toFields(): Array<Field>;
110
124
  assertEquals(other: any): void;
111
- packed: import("o1js/dist/node/lib/field.js").Field[];
125
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
112
126
  }): void;
113
- packed: import("o1js/dist/node/lib/field.js").Field[];
127
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
114
128
  };
115
129
  extractField(input: Character): Field;
116
130
  sizeInBits(): bigint;
@@ -128,13 +142,13 @@ export declare function MultiPackedStringFactory(n?: number): {
128
142
  */
129
143
  fromCharacters(input: Array<Character>): {
130
144
  toString(): string;
131
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
145
+ toFields(): Array<Field>;
132
146
  assertEquals(other: {
133
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
147
+ toFields(): Array<Field>;
134
148
  assertEquals(other: any): void;
135
- packed: import("o1js/dist/node/lib/field.js").Field[];
149
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
136
150
  }): void;
137
- packed: import("o1js/dist/node/lib/field.js").Field[];
151
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
138
152
  };
139
153
  /**
140
154
  *
@@ -143,56 +157,74 @@ export declare function MultiPackedStringFactory(n?: number): {
143
157
  */
144
158
  fromString(str: string): {
145
159
  toString(): string;
146
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
160
+ toFields(): Array<Field>;
147
161
  assertEquals(other: {
148
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
162
+ toFields(): Array<Field>;
149
163
  assertEquals(other: any): void;
150
- packed: import("o1js/dist/node/lib/field.js").Field[];
164
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
151
165
  }): void;
152
- packed: import("o1js/dist/node/lib/field.js").Field[];
166
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
153
167
  };
154
168
  type: import("o1js/dist/node/bindings/lib/generic.js").GenericProvableExtendedPure<{
155
- packed: import("o1js/dist/node/lib/field.js").Field[];
169
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
170
+ }, {
171
+ packed: bigint[];
156
172
  }, {
157
173
  packed: string[];
158
- }, import("o1js/dist/node/lib/field.js").Field>;
174
+ }, import("o1js/dist/node/lib/provable/field.js").Field>;
159
175
  l: number;
160
176
  n: number;
161
177
  bitSize: bigint;
162
178
  checkPack(unpacked: Character[]): void;
163
- pack(unpacked: Character[]): import("o1js/dist/node/lib/field.js").Field[];
164
- unpackToBigints(fields: import("o1js/dist/node/lib/field.js").Field[]): bigint[];
179
+ pack(unpacked: Character[]): Array<Field>;
180
+ unpackToBigints(fields: Array<Field>): Array<bigint>;
165
181
  _isStruct: true;
166
182
  toFields: (value: {
167
- packed: import("o1js/dist/node/lib/field.js").Field[];
168
- }) => import("o1js/dist/node/lib/field.js").Field[];
183
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
184
+ }) => import("o1js/dist/node/lib/provable/field.js").Field[];
169
185
  toAuxiliary: (value?: {
170
- packed: import("o1js/dist/node/lib/field.js").Field[];
186
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
171
187
  } | undefined) => any[];
172
- fromFields: (fields: import("o1js/dist/node/lib/field.js").Field[]) => {
173
- packed: import("o1js/dist/node/lib/field.js").Field[];
174
- };
175
- sizeInFields(): number;
188
+ sizeInFields: () => number;
176
189
  check: (value: {
177
- packed: import("o1js/dist/node/lib/field.js").Field[];
190
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
178
191
  }) => void;
192
+ toValue: (x: {
193
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
194
+ }) => {
195
+ packed: bigint[];
196
+ };
197
+ fromValue: ((x: {
198
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
199
+ } | {
200
+ packed: bigint[];
201
+ }) => {
202
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
203
+ }) & ((value: {
204
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[] | bigint[];
205
+ }) => {
206
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
207
+ });
208
+ fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
209
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
210
+ };
179
211
  toInput: (x: {
180
- packed: import("o1js/dist/node/lib/field.js").Field[];
212
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
181
213
  }) => {
182
- fields?: import("o1js/dist/node/lib/field.js").Field[] | undefined;
183
- packed?: [import("o1js/dist/node/lib/field.js").Field, number][] | undefined;
214
+ fields?: Field[] | undefined;
215
+ packed?: [Field, number][] | undefined;
184
216
  };
185
217
  toJSON: (x: {
186
- packed: import("o1js/dist/node/lib/field.js").Field[];
218
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
187
219
  }) => {
188
220
  packed: string[];
189
221
  };
190
222
  fromJSON: (x: {
191
223
  packed: string[];
192
224
  }) => {
193
- packed: import("o1js/dist/node/lib/field.js").Field[];
225
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
194
226
  };
195
227
  empty: () => {
196
- packed: import("o1js/dist/node/lib/field.js").Field[];
228
+ packed: import("o1js/dist/node/lib/provable/field.js").Field[];
197
229
  };
198
230
  };
@@ -1 +1 @@
1
- {"version":3,"file":"PackedString.js","sourceRoot":"","sources":["../../../../src/lib/packed-types/PackedString.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAErE,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,2CAA2C;AACzD,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,MAAM,UAAU,mBAAmB,CAAC,IAAY,CAAC;IAC/C,MAAM,aAAc,SAA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AC,UAAU,CAAC,GAAW;YAC3B,IAAI,UAAU,GAAqB,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACrD,UAAU,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;YACpD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACpC,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/C,CAAC;YACD,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACzC,CAAC;QAED,QAAQ;YACN,MAAM,QAAQ,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YACxC,OAAO,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;iBAC1C,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,QAAQ,CAAC;iBACxC,IAAI,CAAC,EAAE,CAAC,CAAC;QACd,CAAC;KACF;IACD,OAAO,kBAAkB,CAAC;AAC5B,CAAC"}
@@ -106,14 +106,18 @@ describe('PackedString', () => {
106
106
  myEthAddress.assertEquals(outsideEthAddress);
107
107
  });
108
108
  }).not.toThrow();
109
- expect(() => {
110
- Provable.runAndCheck(() => {
111
- const fakePacked = [...outsideEthAddress.packed];
112
- fakePacked[0] = fakePacked[0].add(1);
113
- const myEthAddress = new EthAddressString(fakePacked);
114
- myEthAddress.assertEquals(outsideEthAddress);
115
- });
116
- }).toThrow();
109
+ // TODO: This test should not be in the "provable" block since it's not in the runAndCheck
110
+ // It seems like failures in the runAndCheck can't be tested for with #toThrow
111
+ try {
112
+ const fakePacked = [...outsideEthAddress.packed];
113
+ fakePacked[0] = fakePacked[0].add(1);
114
+ const myEthAddress = new EthAddressString(fakePacked);
115
+ myEthAddress.assertEquals(outsideEthAddress);
116
+ fail('Expected to throw Field.assertEquals error');
117
+ }
118
+ catch (e) {
119
+ expect(e.message).toContain('Field.assertEquals');
120
+ }
117
121
  });
118
122
  });
119
123
  });
@@ -1 +1 @@
1
- {"version":3,"file":"PackedString.test.js","sourceRoot":"","sources":["../../../../src/lib/packed-types/PackedString.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE/E,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,MAAM,eAAe,GAAG,4CAA4C,CAAC;QACrE,MAAM,gBAAiB,SAAQ,wBAAwB,CAAC,CAAC,CAAC;SAAG;QAC7D,IAAI,UAAU,GAAqB,EAAE,CAAC;QAEtC,UAAU,CAAC,GAAG,EAAE;YACd,UAAU,GAAG,EAAE,CAAC;YAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC/C,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAC3D;QACH,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;YACrB,MAAM,YAAY,GAAG,gBAAgB,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;YAClE,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;YACzB,MAAM,YAAY,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,CAAC;YACL,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;YACvB,MAAM,CAAC,GAAG,EAAE;gBACV,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE;oBACxB,MAAM,YAAY,GAAG,IAAI,gBAAgB,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;oBAEpE,YAAY,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;gBAC/C,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YAEjB,0FAA0F;YAC1F,oFAAoF;YACpF,IAAI,CAAC;gBACH,MAAM,UAAU,GAAG,CAAC,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;gBACjD,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACrC,MAAM,YAAY,GAAG,IAAI,gBAAgB,CAAC,UAAU,CAAC,CAAC;gBACtD,YAAY,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;gBAC7C,IAAI,CAAC,4CAA4C,CAAC,CAAC;YACrD,CAAC;YAAC,OAAO,CAAM,EAAE,CAAC;gBAChB,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;YACpD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,14 +1,14 @@
1
1
  import { Field, UInt32 } from 'o1js';
2
2
  export declare function PackedUInt32Factory(l?: number): {
3
- new (packed: import("o1js/dist/node/lib/field.js").Field): {
3
+ new (packed: Field): {
4
4
  toBigInts(): Array<bigint>;
5
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
5
+ toFields(): Array<Field>;
6
6
  assertEquals(other: {
7
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
7
+ toFields(): Array<Field>;
8
8
  assertEquals(other: any): void;
9
- packed: import("o1js/dist/node/lib/field.js").Field;
9
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
10
10
  }): void;
11
- packed: import("o1js/dist/node/lib/field.js").Field;
11
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
12
12
  };
13
13
  extractField(input: UInt32): Field;
14
14
  sizeInBits(): bigint;
@@ -25,13 +25,13 @@ export declare function PackedUInt32Factory(l?: number): {
25
25
  */
26
26
  fromUInt32s(uint32s: Array<UInt32>): {
27
27
  toBigInts(): Array<bigint>;
28
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
28
+ toFields(): Array<Field>;
29
29
  assertEquals(other: {
30
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
30
+ toFields(): Array<Field>;
31
31
  assertEquals(other: any): void;
32
- packed: import("o1js/dist/node/lib/field.js").Field;
32
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
33
33
  }): void;
34
- packed: import("o1js/dist/node/lib/field.js").Field;
34
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
35
35
  };
36
36
  /**
37
37
  *
@@ -40,55 +40,73 @@ export declare function PackedUInt32Factory(l?: number): {
40
40
  */
41
41
  fromBigInts(bigints: Array<bigint>): {
42
42
  toBigInts(): Array<bigint>;
43
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
43
+ toFields(): Array<Field>;
44
44
  assertEquals(other: {
45
- toFields(): import("o1js/dist/node/lib/field.js").Field[];
45
+ toFields(): Array<Field>;
46
46
  assertEquals(other: any): void;
47
- packed: import("o1js/dist/node/lib/field.js").Field;
47
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
48
48
  }): void;
49
- packed: import("o1js/dist/node/lib/field.js").Field;
49
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
50
50
  };
51
51
  type: import("o1js/dist/node/bindings/lib/generic.js").GenericProvableExtendedPure<{
52
- packed: import("o1js/dist/node/lib/field.js").Field;
52
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
53
+ }, {
54
+ packed: bigint;
53
55
  }, {
54
56
  packed: string;
55
- }, import("o1js/dist/node/lib/field.js").Field>;
57
+ }, import("o1js/dist/node/lib/provable/field.js").Field>;
56
58
  l: number;
57
59
  bitSize: bigint;
58
60
  checkPack(unpacked: UInt32[]): void;
59
- pack(unpacked: UInt32[]): import("o1js/dist/node/lib/field.js").Field;
60
- unpackToBigints(f: import("o1js/dist/node/lib/field.js").Field): bigint[];
61
+ pack(unpacked: UInt32[]): Field;
62
+ unpackToBigints(f: Field): Array<bigint>;
61
63
  _isStruct: true;
62
64
  toFields: (value: {
63
- packed: import("o1js/dist/node/lib/field.js").Field;
64
- }) => import("o1js/dist/node/lib/field.js").Field[];
65
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
66
+ }) => import("o1js/dist/node/lib/provable/field.js").Field[];
65
67
  toAuxiliary: (value?: {
66
- packed: import("o1js/dist/node/lib/field.js").Field;
68
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
67
69
  } | undefined) => any[];
68
- fromFields: (fields: import("o1js/dist/node/lib/field.js").Field[]) => {
69
- packed: import("o1js/dist/node/lib/field.js").Field;
70
- };
71
- sizeInFields(): number;
70
+ sizeInFields: () => number;
72
71
  check: (value: {
73
- packed: import("o1js/dist/node/lib/field.js").Field;
72
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
74
73
  }) => void;
74
+ toValue: (x: {
75
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
76
+ }) => {
77
+ packed: bigint;
78
+ };
79
+ fromValue: ((x: {
80
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
81
+ } | {
82
+ packed: bigint;
83
+ }) => {
84
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
85
+ }) & ((value: {
86
+ packed: string | number | bigint | import("o1js/dist/node/lib/provable/field.js").Field;
87
+ }) => {
88
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
89
+ });
90
+ fromFields: (fields: import("o1js/dist/node/lib/provable/field.js").Field[]) => {
91
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
92
+ };
75
93
  toInput: (x: {
76
- packed: import("o1js/dist/node/lib/field.js").Field;
94
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
77
95
  }) => {
78
- fields?: import("o1js/dist/node/lib/field.js").Field[] | undefined;
79
- packed?: [import("o1js/dist/node/lib/field.js").Field, number][] | undefined;
96
+ fields?: Field[] | undefined;
97
+ packed?: [Field, number][] | undefined;
80
98
  };
81
99
  toJSON: (x: {
82
- packed: import("o1js/dist/node/lib/field.js").Field;
100
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
83
101
  }) => {
84
102
  packed: string;
85
103
  };
86
104
  fromJSON: (x: {
87
105
  packed: string;
88
106
  }) => {
89
- packed: import("o1js/dist/node/lib/field.js").Field;
107
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
90
108
  };
91
109
  empty: () => {
92
- packed: import("o1js/dist/node/lib/field.js").Field;
110
+ packed: import("o1js/dist/node/lib/provable/field.js").Field;
93
111
  };
94
112
  };
@@ -64,20 +64,24 @@ describe('PackedUInt32', () => {
64
64
  });
65
65
  }).not.toThrow();
66
66
  });
67
- it('#assertEquals', () => {
67
+ it('#assertEquals', async () => {
68
68
  expect(() => {
69
69
  Provable.runAndCheck(() => {
70
70
  const packedUInt32 = new PackedUInt32(outsidePackedUInt.packed);
71
71
  packedUInt32.assertEquals(outsidePackedUInt);
72
72
  });
73
73
  }).not.toThrow();
74
- expect(() => {
75
- Provable.runAndCheck(() => {
76
- const fakePacked = outsidePackedUInt.packed.add(32);
77
- const packedUInt32 = new PackedUInt32(fakePacked);
78
- packedUInt32.assertEquals(outsidePackedUInt);
79
- });
80
- }).toThrow();
74
+ // TODO: This test should not be in the "provable" block since it's not in the runAndCheck
75
+ // It seems like failures in the runAndCheck can't be tested for with #toThrow
76
+ try {
77
+ const fakePacked = outsidePackedUInt.packed.add(32);
78
+ const packedUInt32 = new PackedUInt32(fakePacked);
79
+ packedUInt32.assertEquals(outsidePackedUInt);
80
+ fail('Expected to throw Field.assertEquals error');
81
+ }
82
+ catch (e) {
83
+ expect(e.message).toContain('Field.assertEquals');
84
+ }
81
85
  });
82
86
  });
83
87
  });
@@ -1 +1 @@
1
- {"version":3,"file":"PackedUInt32.test.js","sourceRoot":"","sources":["../../../../src/lib/packed-types/PackedUInt32.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,MAAM,YAAa,SAAQ,mBAAmB,EAAE;KAAG;IACnD,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,EAAE,IAAI,GAAG,GAAG,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,GAAG,GAAG,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAC1E,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAEjD,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;YACtB,MAAM,cAAc,GAAG,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YACzD,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;YAC3B,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACxC,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,C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Ballot>();
11
11
 
12
- init() {
12
+ async init() {
13
13
  super.init();
14
14
  this.ballot1.set(Ballot.fromBigInts([0n, 0n, 0n, 0n, 0n, 0n, 0n]));
15
15
  this.ballot2.set(Ballot.fromBigInts([0n, 0n, 0n, 0n, 0n, 0n, 0n]));
@@ -18,9 +18,9 @@ export class Election extends SmartContract {
18
18
  }
19
19
 
20
20
  @method
21
- castBallot1(vote: Ballot) {
21
+ async castBallot1(vote: Ballot) {
22
22
  const unpackedVote = Ballot.unpack(vote.packed);
23
- const ballot1 = this.ballot1.getAndAssertEquals();
23
+ const ballot1 = this.ballot1.getAndRequireEquals();
24
24
  const unpackedBallot1 = Ballot.unpack(ballot1.packed);
25
25
 
26
26
  let voteSum = UInt32.from(0);
@@ -33,9 +33,9 @@ export class Election extends SmartContract {
33
33
  }
34
34
 
35
35
  @method
36
- castBallot2(vote: Ballot) {
36
+ async castBallot2(vote: Ballot) {
37
37
  const unpackedVote = Ballot.unpack(vote.packed);
38
- const ballot2 = this.ballot2.getAndAssertEquals();
38
+ const ballot2 = this.ballot2.getAndRequireEquals();
39
39
  const unpackedBallot2 = Ballot.unpack(ballot2.packed);
40
40
 
41
41
  let voteSum = UInt32.from(0);
@@ -50,7 +50,7 @@ export class Election extends SmartContract {
50
50
  @method
51
51
  castBallot3(vote: Ballot) {
52
52
  const unpackedVote = Ballot.unpack(vote.packed);
53
- const ballot3 = this.ballot3.getAndAssertEquals();
53
+ const ballot3 = this.ballot3.getAndRequireEquals();
54
54
  const unpackedBallot3 = Ballot.unpack(ballot3.packed);
55
55
 
56
56
  let voteSum = UInt32.from(0);
@@ -63,9 +63,9 @@ export class Election extends SmartContract {
63
63
  }
64
64
 
65
65
  @method
66
- castBallot4(vote: Ballot) {
66
+ async castBallot4(vote: Ballot) {
67
67
  const unpackedVote = Ballot.unpack(vote.packed);
68
- const ballot4 = this.ballot4.getAndAssertEquals();
68
+ const ballot4 = this.ballot4.getAndRequireEquals();
69
69
  const unpackedBallot4 = Ballot.unpack(ballot4.packed);
70
70
 
71
71
  let voteSum = UInt32.from(0);
@@ -1,11 +1,9 @@
1
1
  import {
2
2
  Field,
3
- Experimental,
3
+ ZkProgram,
4
4
  UInt32,
5
5
  Provable,
6
- Poseidon,
7
6
  SelfProof,
8
- Character,
9
7
  Bool,
10
8
  Empty,
11
9
  } from 'o1js';
@@ -34,19 +32,20 @@ const isOlderThan = (reference: PackedString, toVerify: PackedString): Bool => {
34
32
  return ver.greaterThan(ref);
35
33
  };
36
34
 
37
- export const AgeGateCircuit = Experimental.ZkProgram({
35
+ export const AgeGateCircuit = ZkProgram({
36
+ name: 'AgeGateCircuit',
38
37
  publicOutput: PackedCounters,
39
38
 
40
39
  methods: {
41
40
  init: {
42
41
  privateInputs: [],
43
- method() {
42
+ async method() {
44
43
  return PackedCounters.fromBigInts([0n, 0n]);
45
44
  },
46
45
  },
47
46
  verifyAge: {
48
47
  privateInputs: [SelfProof, PackedString],
49
- method(
48
+ async method(
50
49
  oldProof: SelfProof<Empty, PackedCounters>,
51
50
  dateToVerify: PackedString
52
51
  ) {
@@ -72,4 +71,4 @@ export const AgeGateCircuit = Experimental.ZkProgram({
72
71
  },
73
72
  });
74
73
 
75
- export const AgeGateCircuitProof = Experimental.ZkProgram.Proof(AgeGateCircuit);
74
+ export const AgeGateCircuitProof = ZkProgram.Proof(AgeGateCircuit);