Fix BigNumber deserialisation in Dish, and add tests (#2607)
With ideas from: cyphercodes <cyphercodes@users.noreply.github.com> With ideas from: Sivachandran Paramasivam <sivachandran.p@gmail.com>
This commit is contained in:
+1
-5
@@ -292,11 +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();
|
||||
temp.c = this.value.c;
|
||||
temp.e = this.value.e;
|
||||
temp.s = this.value.s;
|
||||
this.value = temp;
|
||||
this.value = new BigNumber({ s: this.value.s, e: this.value.e, c: this.value.c, _isBigNumber: true});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user