Skip to content

Commit

Permalink
chore: update logoUrl to be handled as optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Bigshmow committed Jan 27, 2025
1 parent caa9529 commit dd78982
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('TokenSearchApiService', () => {
tokenAddress: '0x1',
usdPrice: 100,
usdPricePercentChange: { oneDay: 10 },
logoUrl: 'https://example.com/api/v1/tokenIcons/1/0x1.png',
logoUrl: 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0x1.png',
},
{
name: 'Token2',
Expand All @@ -23,7 +23,6 @@ describe('TokenSearchApiService', () => {
tokenAddress: '0x2',
usdPrice: 200,
usdPricePercentChange: { oneDay: 20 },
logoUrl: 'https://example.com/api/v1/tokenIcons/1/0x2.png',
},
],
onlyChain: [
Expand All @@ -34,7 +33,7 @@ describe('TokenSearchApiService', () => {
tokenAddress: '0x3',
usdPrice: 300,
usdPricePercentChange: { oneDay: 30 },
logoUrl: 'https://example.com/api/v1/tokenIcons/1/0x3.png',
logoUrl: 'https://static.cx.metamask.io/api/v1/tokenIcons/1/0x3.png',
},
],
onlyName: [
Expand All @@ -45,7 +44,6 @@ describe('TokenSearchApiService', () => {
tokenAddress: '0x4',
usdPrice: 400,
usdPricePercentChange: { oneDay: 40 },
logoUrl: 'https://example.com/api/v1/tokenIcons/1/0x4.png',
},
],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('TokenSearchDiscoveryController', () => {
usdPricePercentChange: {
oneDay: 10,
},
logoUrl: 'https://example.com/api/v1/tokenIcons/1/0x123.png',
// no logoUrl to test optional case
},
];

Expand Down
2 changes: 1 addition & 1 deletion packages/token-search-discovery-controller/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export type TokenSearchResponseItem = {
usdPricePercentChange: {
oneDay: number;
};
logoUrl: string;
logoUrl?: string;
};

0 comments on commit dd78982

Please sign in to comment.