diff --git a/src/bigint.js b/src/bigint.js index b2c594c..54bfac8 100644 --- a/src/bigint.js +++ b/src/bigint.js @@ -226,6 +226,11 @@ if (typeof(BigInt) != "undefined") { return this != b; }; + wBigInt.prototype.toJSNumber = function() { + return Number(this); + }; + + } else { var oldProto = bigInt.prototype; diff --git a/src/calculateWitness.js b/src/calculateWitness.js index 0b33615..25044d0 100644 --- a/src/calculateWitness.js +++ b/src/calculateWitness.js @@ -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()); } } }