1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

Mock token list (#14338)

* mock token list

* remove redundant state
This commit is contained in:
PeterYinusa 2022-04-04 16:02:29 +01:00 committed by GitHub
parent e77ff0bce8
commit beb7a0d7b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 714 deletions

View File

@ -123,10 +123,6 @@
"usePhishDetect": true,
"useStaticTokenList": false
},
"TokenListController": {
"tokenList": {},
"tokensChainsCache": {}
},
"TokensController": {
"allTokens": {
"0x539": {

View File

@ -91,361 +91,6 @@
}
]
},
"TokenListController": {
"tokenList": {
"0xbbbbca6a901c926f240b89eacb641d8aec7aeafd": {
"address": "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
"symbol": "LRC",
"decimals": 18,
"name": "Loopring",
"iconUrl": "",
"aggregators": [
"airswapLight",
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 12
},
"0x04fa0d235c4abf4bcf4787af4cf447de572ef828": {
"address": "0x04fa0d235c4abf4bcf4787af4cf447de572ef828",
"symbol": "UMA",
"decimals": 18,
"name": "UMA",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
"0x6b3595068778dd592e39a122f4f5a5cf09c90fe2": {
"address": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
"symbol": "SUSHI",
"decimals": 18,
"name": "SushiSwap",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
"0xd533a949740bb3306d119cc777fa900ba034cd52": {
"address": "0xd533a949740bb3306d119cc777fa900ba034cd52",
"symbol": "CRV",
"decimals": 18,
"name": "Curve DAO Token",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
"0xc00e94cb662c3520282e6f5717214004a7f26888": {
"address": "0xc00e94cb662c3520282e6f5717214004a7f26888",
"symbol": "COMP",
"decimals": 18,
"name": "Compound",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
"0xba100000625a3754423978a60c9317c58a424e3d": {
"address": "0xba100000625a3754423978a60c9317c58a424e3d",
"symbol": "BAL",
"decimals": 18,
"name": "Balancer",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
"0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0": {
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"decimals": 18,
"name": "Polygon",
"iconUrl": "",
"aggregators": [
"airswapLight",
"bancor",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
"0x0d8775f648430679a709e98d2b0cb6250d2887ef": {
"address": "0x0d8775f648430679a709e98d2b0cb6250d2887ef",
"symbol": "BAT",
"decimals": 18,
"name": "Basic Attention Tok",
"iconUrl": "",
"aggregators": [
"airswapLight",
"bancor",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
}
},
"tokensChainsCache": {
"1": {
"timestamp": 1628769574961,
"data": [
{
"address": "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
"symbol": "LRC",
"decimals": 18,
"name": "Loopring",
"iconUrl": "",
"aggregators": [
"airswapLight",
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 12
},
{
"address": "0x04fa0d235c4abf4bcf4787af4cf447de572ef828",
"symbol": "UMA",
"decimals": 18,
"name": "UMA",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
{
"address": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
"symbol": "SUSHI",
"decimals": 18,
"name": "SushiSwap",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
{
"address": "0xd533a949740bb3306d119cc777fa900ba034cd52",
"symbol": "CRV",
"decimals": 18,
"name": "Curve DAO Token",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
{
"address": "0xc00e94cb662c3520282e6f5717214004a7f26888",
"symbol": "COMP",
"decimals": 18,
"name": "Compound",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
{
"address": "0xba100000625a3754423978a60c9317c58a424e3d",
"symbol": "BAL",
"decimals": 18,
"name": "Balancer",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
{
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"decimals": 18,
"name": "Polygon",
"iconUrl": "",
"aggregators": [
"airswapLight",
"bancor",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
{
"address": "0x0d8775f648430679a709e98d2b0cb6250d2887ef",
"symbol": "BAT",
"decimals": 18,
"name": "Basic Attention Tok",
"iconUrl": "",
"aggregators": [
"airswapLight",
"bancor",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
}
]
},
"3": {
"timestamp": 1628769543620
},
"1337": {
"timestamp": 1628769513476
}
}
},
"PreferencesController": {
"accountTokens": {
"0x5cfe73b6021e818b776b421b1c4db2474086a7e1": {

View File

@ -91,361 +91,6 @@
}
]
},
"TokenListController": {
"tokenList": {
"0xbbbbca6a901c926f240b89eacb641d8aec7aeafd": {
"address": "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
"symbol": "LRC",
"decimals": 18,
"name": "Loopring",
"iconUrl": "",
"aggregators": [
"airswapLight",
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 12
},
"0x04fa0d235c4abf4bcf4787af4cf447de572ef828": {
"address": "0x04fa0d235c4abf4bcf4787af4cf447de572ef828",
"symbol": "UMA",
"decimals": 18,
"name": "UMA",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
"0x6b3595068778dd592e39a122f4f5a5cf09c90fe2": {
"address": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
"symbol": "SUSHI",
"decimals": 18,
"name": "SushiSwap",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
"0xd533a949740bb3306d119cc777fa900ba034cd52": {
"address": "0xd533a949740bb3306d119cc777fa900ba034cd52",
"symbol": "CRV",
"decimals": 18,
"name": "Curve DAO Token",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
"0xc00e94cb662c3520282e6f5717214004a7f26888": {
"address": "0xc00e94cb662c3520282e6f5717214004a7f26888",
"symbol": "COMP",
"decimals": 18,
"name": "Compound",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
"0xba100000625a3754423978a60c9317c58a424e3d": {
"address": "0xba100000625a3754423978a60c9317c58a424e3d",
"symbol": "BAL",
"decimals": 18,
"name": "Balancer",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
"0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0": {
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"decimals": 18,
"name": "Polygon",
"iconUrl": "",
"aggregators": [
"airswapLight",
"bancor",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
"0x0d8775f648430679a709e98d2b0cb6250d2887ef": {
"address": "0x0d8775f648430679a709e98d2b0cb6250d2887ef",
"symbol": "BAT",
"decimals": 18,
"name": "Basic Attention Tok",
"iconUrl": "",
"aggregators": [
"airswapLight",
"bancor",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
}
},
"tokensChainsCache": {
"1": {
"timestamp": 1628769574961,
"data": [
{
"address": "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
"symbol": "LRC",
"decimals": 18,
"name": "Loopring",
"iconUrl": "",
"aggregators": [
"airswapLight",
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 12
},
{
"address": "0x04fa0d235c4abf4bcf4787af4cf447de572ef828",
"symbol": "UMA",
"decimals": 18,
"name": "UMA",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
{
"address": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
"symbol": "SUSHI",
"decimals": 18,
"name": "SushiSwap",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
{
"address": "0xd533a949740bb3306d119cc777fa900ba034cd52",
"symbol": "CRV",
"decimals": 18,
"name": "Curve DAO Token",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
{
"address": "0xc00e94cb662c3520282e6f5717214004a7f26888",
"symbol": "COMP",
"decimals": 18,
"name": "Compound",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
{
"address": "0xba100000625a3754423978a60c9317c58a424e3d",
"symbol": "BAL",
"decimals": 18,
"name": "Balancer",
"iconUrl": "",
"aggregators": [
"bancor",
"cmc",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
{
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0",
"symbol": "MATIC",
"decimals": 18,
"name": "Polygon",
"iconUrl": "",
"aggregators": [
"airswapLight",
"bancor",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
},
{
"address": "0x0d8775f648430679a709e98d2b0cb6250d2887ef",
"symbol": "BAT",
"decimals": 18,
"name": "Basic Attention Tok",
"iconUrl": "",
"aggregators": [
"airswapLight",
"bancor",
"coinGecko",
"kleros",
"oneInch",
"paraswap",
"pmm",
"totle",
"zapper",
"zerion",
"zeroEx"
],
"occurrences": 11
}
]
},
"3": {
"timestamp": 1628769543620
},
"1337": {
"timestamp": 1628769513476
}
}
},
"PreferencesController": {
"accountTokens": {
"0x5cfe73b6021e818b776b421b1c4db2474086a7e1": {

View File

@ -57,6 +57,36 @@ async function setupMocking(server, testSpecificMock) {
};
});
await server
.forGet('https://token-api.metaswap.codefi.network/tokens/1337')
.thenCallback(() => {
return {
statusCode: 200,
json: [
{
address: '0x0d8775f648430679a709e98d2b0cb6250d2887ef',
symbol: 'BAT',
decimals: 18,
name: 'Basic Attention Token',
iconUrl:
'https://assets.coingecko.com/coins/images/677/thumb/basic-attention-token.png?1547034427',
aggregators: [
'aave',
'bancor',
'coinGecko',
'oneInch',
'paraswap',
'pmm',
'zapper',
'zerion',
'zeroEx',
],
occurrences: 9,
},
],
};
});
testSpecificMock(server);
}