We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7b4a616 + 0523ec8 commit 95aa2a7Copy full SHA for 95aa2a7
yarn-project/foundation/src/fields/fields.ts
@@ -60,6 +60,8 @@ abstract class BaseField {
60
this.asBigInt = BigInt(value);
61
if (this.asBigInt >= this.modulus()) {
62
throw new Error(`Value 0x${this.asBigInt.toString(16)} is greater or equal to field modulus.`);
63
+ } else if (this.asBigInt < 0n) {
64
+ throw new Error(`Value 0x${this.asBigInt.toString(16)} is negative.`);
65
}
66
} else if (value instanceof BaseField) {
67
this.asBuffer = value.asBuffer;
0 commit comments