Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Commit

Permalink
addreserves and removereserves listener updated with BigInt
Browse files Browse the repository at this point in the history
  • Loading branch information
Hammad-Mubeen committed Feb 11, 2022
1 parent 3e7cbd2 commit 1bc206c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions routes/listenerroutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,12 @@ router.route("/geteventsdata").post(async function (req, res, next) {
});
await pairagainstuser.create(newData);
} else {
pairagainstuserresult.reserve0 =
pairagainstuserresult.reserve0 + reserve0;
pairagainstuserresult.reserve1 =
pairagainstuserresult.reserve1 + reserve1;
pairagainstuserresult.reserve0 = (
BigInt(pairagainstuserresult.reserve0) + BigInt(reserve0)
).toString();
pairagainstuserresult.reserve1 = (
BigInt(pairagainstuserresult.reserve1) + BigInt(reserve1)
).toString();
await pairagainstuserresult.save();
}
} else if (eventName == "removereserves") {
Expand Down Expand Up @@ -719,10 +721,12 @@ router.route("/geteventsdata").post(async function (req, res, next) {
});
await pairagainstuser.create(newData);
} else {
pairagainstuserresult.reserve0 =
pairagainstuserresult.reserve0 - reserve0;
pairagainstuserresult.reserve1 =
pairagainstuserresult.reserve1 - reserve1;
pairagainstuserresult.reserve0 = (
BigInt(pairagainstuserresult.reserve0) - BigInt(reserve0)
).toString();
pairagainstuserresult.reserve1 = (
BigInt(pairagainstuserresult.reserve1) - BigInt(reserve1)
).toString();
await pairagainstuserresult.save();
}
}
Expand Down

0 comments on commit 1bc206c

Please sign in to comment.