Skip to content

Commit

Permalink
Adding iconurl to Token type to TokenListController (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
NiranjanaBinoy authored and MajorLift committed Oct 11, 2023
1 parent 4e4e9a0 commit 9155d85
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/assets/TokenListController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const sampleMainnetTokenList = [
'oneInch',
],
name: 'Synthetix',
iconUrl: 'https://airswap-token-images.s3.amazonaws.com/SNX.png',
},
{
address: '0x514910771af9ca656af840dff83e8264ecf986ca',
Expand All @@ -54,6 +55,7 @@ const sampleMainnetTokenList = [
'oneInch',
],
name: 'Chainlink',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/LINK.png',
},
{
address: '0x1f573d6fb3f13d689ff844b4ce37794d79a7ff1c',
Expand All @@ -74,6 +76,7 @@ const sampleMainnetTokenList = [
'oneInch',
],
name: 'Bancor',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/BNT.png',
},
];
const sampleWithDuplicateSymbols = [
Expand All @@ -96,6 +99,7 @@ const sampleWithDuplicateSymbols = [
'oneInch',
],
name: 'Synthetix',
iconUrl: 'https://airswap-token-images.s3.amazonaws.com/SNX.png',
},
{
address: '0x514910771af9ca656af840dff83e8264ecf986ca',
Expand All @@ -116,6 +120,7 @@ const sampleWithDuplicateSymbols = [
'oneInch',
],
name: 'Chainlink',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/LINK.png',
},
{
address: '0x1f573d6fb3f13d689ff844b4ce37794d79a7ff1c',
Expand All @@ -136,6 +141,7 @@ const sampleWithDuplicateSymbols = [
'oneInch',
],
name: 'Bancor',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/BNT.png',
},
];
const sampleWithLessThan2Occurences = [
Expand All @@ -146,6 +152,7 @@ const sampleWithLessThan2Occurences = [
occurrences: 2,
aggregators: ['paraswap', 'pmm'],
name: 'Synthetix',
iconUrl: 'https://airswap-token-images.s3.amazonaws.com/SNX.png',
},
{
address: '0x514910771af9ca656af840dff83e8264ecf986ca',
Expand All @@ -166,6 +173,7 @@ const sampleWithLessThan2Occurences = [
'oneInch',
],
name: 'Chainlink',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/LINK.png',
},
{
address: '0x1f573d6fb3f13d689ff844b4ce37794d79a7ff1c',
Expand All @@ -174,6 +182,7 @@ const sampleWithLessThan2Occurences = [
occurrences: 1,
aggregators: ['paraswap'],
name: 'Bancor',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/BNT.png',
},
];
const sampleBinanceTokenList = [
Expand Down Expand Up @@ -215,6 +224,7 @@ const sampleSingleChainState = {
'oneInch',
],
name: 'Synthetix',
iconUrl: 'https://airswap-token-images.s3.amazonaws.com/SNX.png',
},
'0x514910771af9ca656af840dff83e8264ecf986ca': {
address: '0x514910771af9ca656af840dff83e8264ecf986ca',
Expand All @@ -235,6 +245,7 @@ const sampleSingleChainState = {
'oneInch',
],
name: 'Chainlink',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/LINK.png',
},
'0x1f573d6fb3f13d689ff844b4ce37794d79a7ff1c': {
address: '0x1f573d6fb3f13d689ff844b4ce37794d79a7ff1c',
Expand All @@ -255,6 +266,7 @@ const sampleSingleChainState = {
'oneInch',
],
name: 'Bancor',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/BNT.png',
},
},
tokensChainsCache: {
Expand Down Expand Up @@ -315,6 +327,7 @@ const sampleTokenMetaData = {
'oneInch',
],
name: 'Chainlink',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/LINK.png',
};

const existingState = {
Expand All @@ -338,6 +351,7 @@ const existingState = {
'oneInch',
],
name: 'Chainlink',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/LINK.png',
},
},
tokensChainsCache: {
Expand Down Expand Up @@ -369,6 +383,7 @@ const outdatedExistingState = {
'oneInch',
],
name: 'Chainlink',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/LINK.png',
},
},
tokensChainsCache: {
Expand Down Expand Up @@ -398,6 +413,7 @@ const expiredCacheExistingState = {
'zerion',
],
name: 'Chainlink',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/LINK.png',
},
},
tokensChainsCache: {
Expand All @@ -423,6 +439,7 @@ const expiredCacheExistingState = {
'oneInch',
],
name: 'Chainlink',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/LINK.png',
},
],
},
Expand Down Expand Up @@ -498,6 +515,7 @@ describe('TokenListController', () => {
'oneInch',
],
name: 'Chainlink',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/LINK.png',
},
},
tokensChainsCache: {
Expand Down Expand Up @@ -704,6 +722,7 @@ describe('TokenListController', () => {
'oneInch',
],
name: 'Bancor',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/BNT.png',
},
});
expect(
Expand Down Expand Up @@ -732,6 +751,7 @@ describe('TokenListController', () => {
occurrences: 2,
aggregators: ['paraswap', 'pmm'],
name: 'Synthetix',
iconUrl: 'https://airswap-token-images.s3.amazonaws.com/SNX.png',
},
'0x514910771af9ca656af840dff83e8264ecf986ca': {
address: '0x514910771af9ca656af840dff83e8264ecf986ca',
Expand All @@ -752,6 +772,7 @@ describe('TokenListController', () => {
'oneInch',
],
name: 'Chainlink',
iconUrl: 'https://s3.amazonaws.com/airswap-token-images/LINK.png',
},
});
expect(
Expand Down Expand Up @@ -867,6 +888,7 @@ describe('TokenListController', () => {
'oneInch',
],
name: 'Synthetix',
iconUrl: 'https://airswap-token-images.s3.amazonaws.com/SNX.png',
},
];
nock(TOKEN_END_POINT_API)
Expand Down Expand Up @@ -912,6 +934,7 @@ describe('TokenListController', () => {
'oneInch',
],
name: 'Synthetix',
iconUrl: 'https://airswap-token-images.s3.amazonaws.com/SNX.png',
},
});
expect(await controller.syncTokens()).toBeUndefined();
Expand Down
1 change: 1 addition & 0 deletions src/assets/TokenListController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type Token = {
symbol: string;
occurrences: number;
aggregators: string[];
iconUrl: string;
};

type TokenMap = {
Expand Down

0 comments on commit 9155d85

Please sign in to comment.