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:
GCHQDeveloper581
2026-06-26 12:07:33 +00:00
committed by GitHub
parent 2329a0a0e5
commit 275b594f7c
4 changed files with 55 additions and 7 deletions
+1 -5
View File
@@ -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;