diff --git a/src/core/Dish.mjs b/src/core/Dish.mjs index 11b1ff9f..acdf02d9 100755 --- a/src/core/Dish.mjs +++ b/src/core/Dish.mjs @@ -292,7 +292,7 @@ class Dish { and reinitialise it as a BigNumber object. */ if (Object.keys(this.value).sort().equals(["c", "e", "s"])) { - const temp = new BigNumber(); + const temp = new BigNumber(NaN); temp.c = this.value.c; temp.e = this.value.e; temp.s = this.value.s; diff --git a/tests/node/tests/Dish.mjs b/tests/node/tests/Dish.mjs index 58da00bf..f648ab66 100644 --- a/tests/node/tests/Dish.mjs +++ b/tests/node/tests/Dish.mjs @@ -8,5 +8,8 @@ TestRegister.addApiTests([ const dish = new Dish(); assert(dish.presentAs); }), - + it("Disk - valid: should not err on serialized big_number", () => { + const dish = new Dish({ c: 0, e: 0, s: 0 }, Dish.BIG_NUMBER); + assert(dish.valid()); + }) ]);