Skip to content

Commit dd4cd39

Browse files
committed
fix DynamicArray fromFields causing non-static circuit
1 parent 4775d65 commit dd4cd39

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@auxo-dev/auxo-libs",
3-
"version": "0.2.9",
3+
"version": "0.2.10",
44
"description": "",
55
"author": "",
66
"license": "Apache-2.0",

src/DynamicArray.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,7 @@ export function DynamicArray<T>(type: ProvablePure<T>, maxLength: number) {
5454
}
5555

5656
static fromFields(fields: Field[]): _DynamicArray {
57-
let length = fields[0];
58-
let sizeInFields = type.sizeInFields();
59-
let values: T[] = [];
60-
Provable.asProver(() => {
61-
for (let i = 0; i < Number(length); i++) {
62-
values.push(
63-
type.fromFields(
64-
fields.slice(1 + sizeInFields * i, 1 + sizeInFields * (i + 1))
65-
)
66-
);
67-
}
68-
});
69-
return new _DynamicArray(values);
57+
return super.fromFields(fields) as _DynamicArray;
7058
}
7159

7260
static empty(length?: Field): _DynamicArray {

0 commit comments

Comments
 (0)