Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove isV3 property (After isV3 flag is removed from adapter) #227

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion overtimeV2Api/constants/markets.js
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,6 @@ const PARENT_MARKET_PROPERTIES_TO_EXCLUDE = [
"isPlayerPropsMarket",
"isOneSidePlayerPropsMarket",
"isYesNoPlayerPropsMarket",
"isV3",
];

const CHILD_MARKET_PROPERTIES_TO_EXCLUDE = [
Expand Down
5 changes: 1 addition & 4 deletions overtimeV2Api/source/liveMarkets.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ async function processAllMarkets(
const openMarketsMap = new Map(JSON.parse(openMarkets));

const supportedLiveMarkets = Array.from(openMarketsMap.values())
.filter(
(market) => !!market.isV3 && market.statusCode === "ongoing" && !market.isWholeGameResolved && !market.noTickets,
)
.filter((market) => market.statusCode === "ongoing" && !market.isWholeGameResolved && !market.noTickets)
.filter((market) => supportedLiveLeagueIds.includes(market.leagueId));
const uniqueLiveLeagueIds = uniq(supportedLiveMarkets.map((market) => market.leagueId));

Expand Down Expand Up @@ -450,7 +448,6 @@ async function processMarketsByLeague(
market.proof = [];
market.homeScoreByPeriod = gamesHomeScoreByPeriod;
market.awayScoreByPeriod = gamesAwayScoreByPeriod;
market.isV3 = true;

if (!errorMessage) {
const processedMarket = processMarket(
Expand Down
2 changes: 1 addition & 1 deletion overtimeV2Api/source/liveScores.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async function processAllLiveResults(resultsInitialization, isTestnet) {
const leagueProvider = getLeagueProvider(leagueId);
const gameInfo = gamesInfoMap.get(market.gameId);

if (leagueProvider === Provider.OPTICODDS && market.isV3) {
if (leagueProvider === Provider.OPTICODDS) {
opticOddsGameIdsWithLeagueID.push({ gameId: market.gameId, leagueId, gameInfo });
}
}
Expand Down
4 changes: 2 additions & 2 deletions overtimeV2Api/source/markets.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ const loadMarkets = async (isTestnet, shouldDoFullUpdate) => {
};

const mapMarket = (market) => {
const packedMarket = packMarket(market, false);
const packedMarket = packMarket(market);
packedMarket.childMarkets = [];
market.childMarkets.forEach((childMarket) => {
const packedChildMarket = packMarket(childMarket, true);
const packedChildMarket = packMarket(childMarket);
packedMarket.childMarkets.push(packedChildMarket);
});

Expand Down
6 changes: 1 addition & 5 deletions overtimeV2Api/utils/markets.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const convertFromBytes32 = (value) => {
return result.replace(/\0/g, "");
};

const packMarket = (market, isChild) => {
const packMarket = (market) => {
const leagueId = `${market.sportId}`.startsWith("152")
? League.TENNIS_WTA
: `${market.sportId}`.startsWith("153")
Expand Down Expand Up @@ -124,10 +124,6 @@ const packMarket = (market, isChild) => {
proof: market.proof,
};

if (!isChild) {
packedMarket.isV3 = !!market.isV3 || packedMarket.sport === Sport.TENNIS;
}

return packedMarket;
};

Expand Down