Skip to content

Commit 849e34e

Browse files
authored
fix: failing tests on feat/dev-3.0-no-landing (#230)
* fix: linkcheck-internal test * fix: typecheck test * fix: lint test * fix: remove unused certification images and update srcset attributes * fix: update srcset attributes for certification images
1 parent aa20381 commit 849e34e

7 files changed

Lines changed: 37 additions & 22 deletions

File tree

src/components/CCIP/Chain/ChainTokenGrid.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Environment, Version, Network } from "~/config/data/ccip/types.ts"
1+
import { Environment, Version, Network, PoolType } from "~/config/data/ccip/types.ts"
22
import { getAllTokenLanes, getTokenData } from "~/config/data/ccip/data.ts"
33
import TokenCard from "../Cards/TokenCard.tsx"
44
import { drawerContentStore } from "../Drawer/drawerStore.ts"
@@ -54,9 +54,9 @@ function ChainTokenGrid({ tokens, network, environment }: ChainTokenGridProps) {
5454
tokenSymbol: data[key].symbol,
5555
tokenDecimals: data[key].decimals,
5656
tokenAddress: data[key].tokenAddress,
57-
tokenPoolType: data[key].pool.type,
58-
tokenPoolAddress: data[key].pool.address || "",
59-
tokenPoolVersion: data[key].pool.version || "",
57+
tokenPoolType: (data[key].pool?.type || data[key].poolType) as PoolType,
58+
tokenPoolAddress: data[key].pool?.address || data[key].poolAddress || "",
59+
tokenPoolVersion: data[key].pool?.version || "",
6060
explorer: network.explorer,
6161
chainType,
6262
}

src/components/CCIP/Drawer/LaneDrawer.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Address from "~/components/AddressReact.tsx"
22
import "../Tables/Table.css"
3-
import { Environment, LaneConfig, LaneFilter } from "~/config/data/ccip/types.ts"
3+
import { Environment, LaneConfig, LaneFilter, PoolType } from "~/config/data/ccip/types.ts"
44
import { getNetwork } from "~/config/data/ccip/data.ts"
55
import { determineTokenMechanism } from "~/config/data/ccip/utils.ts"
66
import { useState } from "react"
@@ -228,12 +228,16 @@ function LaneDrawer({
228228
<td>
229229
{inOutbound === LaneFilter.Outbound
230230
? determineTokenMechanism(
231-
token.data[sourceNetwork.key].pool.type,
232-
token.data[destinationNetwork.key].pool.type
231+
(token.data[sourceNetwork.key].pool?.type ||
232+
token.data[sourceNetwork.key].poolType) as PoolType,
233+
(token.data[destinationNetwork.key].pool?.type ||
234+
token.data[destinationNetwork.key].poolType) as PoolType
233235
)
234236
: determineTokenMechanism(
235-
token.data[destinationNetwork.key].pool.type,
236-
token.data[sourceNetwork.key].pool.type
237+
(token.data[destinationNetwork.key].pool?.type ||
238+
token.data[destinationNetwork.key].poolType) as PoolType,
239+
(token.data[sourceNetwork.key].pool?.type ||
240+
token.data[sourceNetwork.key].poolType) as PoolType
237241
)}
238242
</td>
239243

src/components/CCIP/Drawer/TokenDrawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function TokenDrawer({
133133
console.error(`No token data found for ${token.id} on ${network.key} -> ${destinationChain}`)
134134
return null
135135
}
136-
const destinationPoolType = destinationTokenData.pool.type
136+
const destinationPoolType = destinationTokenData.pool?.type || destinationTokenData.poolType
137137
if (!destinationPoolType) {
138138
console.error(`No pool type found for ${token.id} on ${network.key} -> ${destinationChain}`)
139139
return null

src/components/CCIP/Token/Token.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ const tokenStructuredData = generateTokenStructuredData(token, environment, chai
157157
tokenSymbol: data[key]?.symbol ?? "",
158158
tokenDecimals: data[key]?.decimals ?? 0,
159159
tokenAddress: data[key]?.tokenAddress ?? "",
160-
tokenPoolType: data[key]?.pool.type,
161-
tokenPoolAddress: data[key]?.pool.address ?? "",
162-
tokenPoolVersion: data[key]?.pool.version ?? "",
160+
tokenPoolType: data[key]?.pool?.type,
161+
tokenPoolAddress: data[key]?.pool?.address ?? "",
162+
tokenPoolVersion: data[key]?.pool?.version ?? "",
163163
explorer: explorer,
164164
chainType: chainType,
165165
}

src/config/data/ccip/data.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
VerifiersConfig,
1717
Verifier,
1818
VerifierType,
19+
PoolType,
1920
} from "./types.ts"
2021
import { determineTokenMechanism } from "./utils.ts"
2122
import { ExplorerInfo, SupportedChain, ChainType } from "@config/types.ts"
@@ -318,8 +319,9 @@ export const getTokenMechanism = (params: {
318319
const tokenConfig = tokensReferenceData[params.token]
319320
const sourceChainPoolInfo = tokenConfig[sourceChainRdd]
320321
const destinationChainPoolInfo = tokenConfig[destinationChainRdd]
321-
const sourceChainPoolType = sourceChainPoolInfo.pool.type
322-
const destinationChainPoolType = destinationChainPoolInfo.pool.type
322+
const sourceChainPoolType = (sourceChainPoolInfo.pool?.type || sourceChainPoolInfo.poolType) as PoolType
323+
const destinationChainPoolType = (destinationChainPoolInfo.pool?.type ||
324+
destinationChainPoolInfo.poolType) as PoolType
323325
const tokenMechanism = determineTokenMechanism(sourceChainPoolType, destinationChainPoolType)
324326
return tokenMechanism
325327
}
@@ -594,7 +596,13 @@ export const getChainsOfToken = ({ token, filter }: { token: string; filter: Env
594596
})()
595597

596598
// Get all valid chains for the given token
597-
return Object.entries(tokensData[token])
599+
const tokenData = tokensData[token]
600+
if (!tokenData) {
601+
console.warn(`No token data found for ${token} in ${filter} environment`)
602+
return []
603+
}
604+
605+
return Object.entries(tokenData)
598606
.filter(([, tokenData]) => tokenData.pool && tokenData.pool.type !== "feeTokenOnly")
599607
.filter(([chain]) => {
600608
const lanes = getAllTokenLanes({ token, environment: filter })
@@ -619,6 +627,11 @@ export const getAllNetworkLanes = async ({
619627

620628
const allLanes = lanesReferenceData[chain]
621629

630+
// Handle chains with no outbound lanes (e.g., newly added chains)
631+
if (!allLanes) {
632+
return []
633+
}
634+
622635
const lanesData: {
623636
name: string
624637
logo: string

src/config/data/ccip/types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ type Pool = {
4848
type PoolInfo = {
4949
tokenAddress: string
5050
allowListEnabled: boolean
51-
pool: Pool
51+
pool?: Pool
52+
poolAddress?: string
53+
poolType?: string
5254
name?: string
5355
symbol: string
5456
decimals: number

src/pages/certification.astro

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,18 @@ const formattedContentTitle = `Courses | Chainlink Certifications`
7272
width="Auto"
7373
height="Auto"
7474
alt=""
75-
srcset="/images/certification/image-200-p-500.png 500w, /images/certification/image-200.png 606w"
7675
sizes="(max-width: 606px) 100vw, 606px"
7776
class="plat-absolute plat-absolute--1"
7877
/><img
7978
src="/images/certification/image-201.png"
8079
loading="lazy"
8180
sizes="(max-width: 607px) 100vw, 607px"
82-
srcset="/images/certification/image-201-p-500.png 500w, /images/certification/image-201.png 607w"
8381
alt=""
8482
class="plat-absolute plat-absolute--2"
8583
/><img
8684
src="/images/certification/image-1.png"
8785
loading="lazy"
8886
sizes="(max-width: 607px) 100vw, 607px"
89-
srcset="/images/certification/image-1-p-500.png 500w, /images/certification/image-1.png 607w"
9087
alt=""
9188
class="plat-absolute plat-absolute--3"
9289
/>
@@ -189,7 +186,6 @@ const formattedContentTitle = `Courses | Chainlink Certifications`
189186
src="/images/certification/Imagedevhubvideo.png"
190187
loading="lazy"
191188
sizes="(max-width: 560px) 100vw, 560px"
192-
srcset="/images/certification/Imagedevhubvideo-p-500.png 500w, /images/certification/Imagedevhubvideo.png 560w"
193189
alt=""
194190
class="cover-image"
195191
/>
@@ -216,7 +212,7 @@ const formattedContentTitle = `Courses | Chainlink Certifications`
216212
src="/images/certification/Imagedevhubresources.png"
217213
loading="lazy"
218214
sizes="(max-width: 560px) 100vw, 560px"
219-
srcset="/images/certification/Imagedevhubresources-p-500.png 500w, /images/certification/Imagedevhubresources.png 560w"
215+
"
220216
alt=""
221217
class="cover-image"
222218
/>

0 commit comments

Comments
 (0)