Fix: Create BigNumber with NaN value in Dish.valid
The constructor expects the default value but we are not passing it. So it was throwing undefined error. Now passing NaN as default value.
This commit is contained in:
parent
65f47c0343
commit
8feb412901
@ -292,7 +292,7 @@ class Dish {
|
|||||||
and reinitialise it as a BigNumber object.
|
and reinitialise it as a BigNumber object.
|
||||||
*/
|
*/
|
||||||
if (Object.keys(this.value).sort().equals(["c", "e", "s"])) {
|
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.c = this.value.c;
|
||||||
temp.e = this.value.e;
|
temp.e = this.value.e;
|
||||||
temp.s = this.value.s;
|
temp.s = this.value.s;
|
||||||
|
|||||||
@ -8,5 +8,8 @@ TestRegister.addApiTests([
|
|||||||
const dish = new Dish();
|
const dish = new Dish();
|
||||||
assert(dish.presentAs);
|
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());
|
||||||
|
})
|
||||||
]);
|
]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user