fix: bigint conversion

This commit is contained in:
Danish Arora 2025-03-06 16:41:11 +05:30
parent 43c7843a5a
commit 7adb05431e
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E

View File

@ -180,12 +180,11 @@ export class RLNContract {
* @returns Promise<number> The remaining rate limit that can be allocated
*/
public async getRemainingTotalRateLimit(): Promise<number> {
// const [maxTotal, currentTotal] = await Promise.all([
// this.contract.maxTotalRateLimit(),
// this.contract.currentTotalRateLimit()
// ]);
// return maxTotal.sub(currentTotal).toNumber();
return 10_000;
const [maxTotal, currentTotal] = await Promise.all([
this.contract.maxTotalRateLimit(),
this.contract.currentTotalRateLimit()
]);
return Number(maxTotal) - Number(currentTotal);
}
/**