Skip to content

Commit

Permalink
Remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhpn committed Dec 4, 2024
1 parent 59eb777 commit 39a84b1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions scripts/check_configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,12 @@ function isValidMarketPromo(marketPromo: {[marketId: string]: MarketPromo}, netw
const hasInvalidMarketPromoIds = checkValidEntries(marketPromoIds, marketIds)
const hasDuplicateMarketPromoIds = checkDuplicateEntries(marketPromoIds)

// check for valid market id
if (hasInvalidMarketPromoIds.status && hasInvalidMarketPromoIds.entry) {
let listOfInvalidIds: string = hasInvalidMarketPromoIds.entry.join(", ");
console.error(`ERROR: ${network}.json has the following invalid market ids under the market_promo field: ${listOfInvalidIds}`)
outcomeMap[network] = false;
}

// check for duplicated market id
if (hasDuplicateMarketPromoIds.status && hasDuplicateMarketPromoIds.entry) {
let listOfDuplicates: string = hasDuplicateMarketPromoIds.entry.join(", ");
console.error(`ERROR: ${network}.json has duplicated market promos for the following market ids: ${listOfDuplicates}. Please make sure to input each market promo only once in ${network}`);
Expand All @@ -339,15 +337,13 @@ function isValidMarketPromo(marketPromo: {[marketId: string]: MarketPromo}, netw
const startTimeStr = promoInfo.start;
const endTimeStr = promoInfo.end;

// Parse start and end times into Date objects
const startTime = new Date(startTimeStr);
const endTime = new Date(endTimeStr);

// Check if end time is before start time
if (endTime < startTime) {
console.error(`ERROR: ${network}.json has invalid end time (${endTimeStr}) is before start time (${startTimeStr}) for market promo id ${promoId}.`);
outcomeMap[network] = false;
break; // Exit the loop early upon encountering an error
break;
}
}

Expand Down

0 comments on commit 39a84b1

Please sign in to comment.