Skip to content

Commit c8dbe17

Browse files
committed
remove all the other field strings from messages
1 parent ae2e43e commit c8dbe17

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lib/provable/dynamic-array.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class DynamicArrayBase<ProvableValue = any, Value = any> {
171171
* @param message - optional error message to use in case the assertion fails
172172
*/
173173
assertIndexInRange(i: Field, message?: string): void {
174-
let errorMessage = message ?? `assertIndexInRange(): index ${i} must be in range [0, length]`;
174+
let errorMessage = message ?? `assertIndexInRange(): index must be in range [0, length]`;
175175
if (!this.#indicesInRange.has(i)) {
176176
if (i.isConstant() && this.length.isConstant()) {
177177
assert(i.toBigInt() < this.length.toBigInt(), errorMessage);
@@ -238,7 +238,7 @@ class DynamicArrayBase<ProvableValue = any, Value = any> {
238238
* Sets a value at index i and proves that the index is in the array.
239239
*/
240240
set(i: Field, value: ProvableValue, message?: string): void {
241-
let errorMessage = message ?? `set(): index ${i} must be in range [0, length]`;
241+
let errorMessage = message ?? `set(): index must be in range [0, length]`;
242242
this.assertIndexInRange(i, errorMessage);
243243
this.setOrDoNothing(i, value);
244244
}
@@ -370,7 +370,7 @@ class DynamicArrayBase<ProvableValue = any, Value = any> {
370370
setLengthTo(n: Field, message?: string): void {
371371
let errorMessage =
372372
message ??
373-
`setLengthTo: cannot set length to ${n} because it exceeds capacity ${this.capacity}`;
373+
`setLengthTo: cannot set length to n because it exceeds capacity ${this.capacity}`;
374374
n.assertLessThanOrEqual(new Field(this.capacity), errorMessage);
375375
this.length = n;
376376
}
@@ -410,7 +410,7 @@ class DynamicArrayBase<ProvableValue = any, Value = any> {
410410
pop(n?: Field, message?: string): void {
411411
let errorMessage =
412412
message ??
413-
`pop(): cannot pop ${n} elements because the length is smaller`;
413+
`pop(): cannot pop n elements because the length is smaller`;
414414

415415
let dec = n !== undefined ? n : new Field(1);
416416
this.decreaseLengthBy(dec, errorMessage);
@@ -564,7 +564,7 @@ class DynamicArrayBase<ProvableValue = any, Value = any> {
564564
insert(index: Field, value: ProvableValue, message?: string): void {
565565
let errorMessage =
566566
message ??
567-
`insert(): cannot insert value at index ${index} because it would exceed capacity ${this.capacity}.`;
567+
`insert(): cannot insert value at index because it would exceed capacity ${this.capacity}.`;
568568
const right = this.slice(index, this.length);
569569
this.increaseLengthBy(new Field(1), errorMessage);
570570
this.set(index, value);

0 commit comments

Comments
 (0)