mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-09 18:45:38 +00:00
e7633c6d2f
* Replace all mentions of MyEtherWallet in translations with MyCrypto * Replace all translation mentions of kvhnuke/etherwallet repo with MyCryptoHQ/MyCrypto repo. * Replace all instances of MEW with MyCrypto in translations. * Replace all instances of myetherwallet.com with mycrypto.com * First pass of myetherwallet -> mycrypto in codebase. * Replace most MEWs and mews with MyCrypto or MyC or myc * Update all assets, clean out unused old assets. * Adjust v3 url * Convert all links to help articles to a help link component to make future changes easier. * Rework onboarding images * Adjust logo colors due to CMY issue. * Update donation address, remove mentions of mewtopia.eth * Update license * Update sosh meed and referral links. * Fix more translations strings. * Tscheck fix. * Update shapeshift api key.
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
import { dedupeCustomTokens } from 'utils/tokens';
|
||
|
||
describe('dedupeCustomTokens', () => {
|
||
const networkTokens = [
|
||
{
|
||
address: '0x48c80F1f4D53D5951e5D5438B54Cba84f29F32a5',
|
||
symbol: 'REP',
|
||
decimal: 18
|
||
},
|
||
{
|
||
address: '0xa74476443119A942dE498590Fe1f2454d7D4aC0d',
|
||
symbol: 'GNT',
|
||
decimal: 18
|
||
}
|
||
];
|
||
|
||
const DUPLICATE_ADDRESS = {
|
||
address: networkTokens[0].address,
|
||
symbol: 'REP2',
|
||
decimal: 18
|
||
};
|
||
const DUPLICATE_SYMBOL = {
|
||
address: '0x0',
|
||
symbol: networkTokens[1].symbol,
|
||
decimal: 18
|
||
};
|
||
const NONDUPLICATE_CUSTOM = {
|
||
address: '0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8',
|
||
symbol: 'TEST',
|
||
decimal: 0
|
||
};
|
||
|
||
const customTokens = [DUPLICATE_ADDRESS, DUPLICATE_SYMBOL, NONDUPLICATE_CUSTOM];
|
||
const dedupedTokens = dedupeCustomTokens(networkTokens, customTokens);
|
||
|
||
it('Should remove duplicate address custom tokens', () => {
|
||
expect(dedupedTokens.includes(DUPLICATE_ADDRESS)).toBeFalsy();
|
||
});
|
||
|
||
it('Should remove duplicate symbol custom tokens', () => {
|
||
expect(dedupedTokens.includes(DUPLICATE_SYMBOL)).toBeFalsy();
|
||
});
|
||
|
||
it('Should not remove custom tokens that aren’t duplicates', () => {
|
||
expect(dedupedTokens.includes(NONDUPLICATE_CUSTOM)).toBeTruthy();
|
||
});
|
||
});
|