@glowlabs-org/utils 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -414,16 +414,6 @@ export async function createWeeklyReport({
|
|
414
414
|
shortIdToAdjustedCredit.set(String(sid), splitBigInt);
|
415
415
|
}
|
416
416
|
|
417
|
-
const farmShortIds = new Set(farms.map((f: any) => String(f.shortId)));
|
418
|
-
audits.forEach((audit: any) =>
|
419
|
-
audit.activeShortIds?.forEach((sid: string | number) => {
|
420
|
-
if (!farmShortIds.has(String(sid)))
|
421
|
-
throw new Error(
|
422
|
-
`activeShortId ${sid} from audit ${audit.id} missing in filteredFarms`
|
423
|
-
);
|
424
|
-
})
|
425
|
-
);
|
426
|
-
|
427
417
|
let totalCreditsProduced18dp = BigInt(0);
|
428
418
|
|
429
419
|
for (const farm of farms) {
|
@@ -470,6 +460,11 @@ export async function createWeeklyReport({
|
|
470
460
|
const adjustedCreditBigInt =
|
471
461
|
shortIdToAdjustedCredit.get(String(farm.shortId)) ?? BigInt(0);
|
472
462
|
|
463
|
+
if (adjustedCreditBigInt <= BigInt(0))
|
464
|
+
throw new Error(
|
465
|
+
`Adjusted credit is less than or equal to 0 for farm ${farm.shortId}`
|
466
|
+
);
|
467
|
+
|
473
468
|
for (const split of farm.rewardSplits) {
|
474
469
|
const glowWeight = multiplyBigIntByDecimalPercentage(
|
475
470
|
glowBase,
|