better info in runtime constraint assertion
This commit is contained in:
parent
d2ccc9dce5
commit
2fa9503ad6
@ -226,6 +226,11 @@ if (typeof(BigInt) != "undefined") {
|
||||
return this != b;
|
||||
};
|
||||
|
||||
wBigInt.prototype.toJSNumber = function() {
|
||||
return Number(this);
|
||||
};
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
var oldProto = bigInt.prototype;
|
||||
|
@ -223,11 +223,11 @@ class RTCtx {
|
||||
return this.witness[sId];
|
||||
}
|
||||
|
||||
assert(a,b) {
|
||||
assert(a,b,errStr) {
|
||||
const ba = bigInt(a);
|
||||
const bb = bigInt(b);
|
||||
if (!ba.equals(bb)) {
|
||||
throw new Error("Constraint doesn't match: " + ba.toString() + " != " + bb.toString());
|
||||
throw new Error("Constraint doesn't match "+ this.currentComponent+": "+ errStr + " -> "+ ba.toString() + " != " + bb.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user