diff --git a/blockchains/ethereum/assets/0x0598C2Fdd3a0564970A86B69C72a6C57077c84bb/logo.png b/blockchains/ethereum/assets/0x0598C2Fdd3a0564970A86B69C72a6C57077c84bb/logo.png index 3d084374b..058f025a9 100644 Binary files a/blockchains/ethereum/assets/0x0598C2Fdd3a0564970A86B69C72a6C57077c84bb/logo.png and b/blockchains/ethereum/assets/0x0598C2Fdd3a0564970A86B69C72a6C57077c84bb/logo.png differ diff --git a/blockchains/ethereum/assets/0x068578338B146D64727428954cc348Cf92d9Ba88/logo.png b/blockchains/ethereum/assets/0x068578338B146D64727428954cc348Cf92d9Ba88/logo.png index 7d0473533..d5ce9a8db 100644 Binary files a/blockchains/ethereum/assets/0x068578338B146D64727428954cc348Cf92d9Ba88/logo.png and b/blockchains/ethereum/assets/0x068578338B146D64727428954cc348Cf92d9Ba88/logo.png differ diff --git a/blockchains/ethereum/assets/0x239836e951DD75Fea01beF8ba039119dc8D5352f/logo.png b/blockchains/ethereum/assets/0x239836e951DD75Fea01beF8ba039119dc8D5352f/logo.png index d22836f84..567d183ee 100644 Binary files a/blockchains/ethereum/assets/0x239836e951DD75Fea01beF8ba039119dc8D5352f/logo.png and b/blockchains/ethereum/assets/0x239836e951DD75Fea01beF8ba039119dc8D5352f/logo.png differ diff --git a/blockchains/ethereum/assets/0x39043aae9c48a628F5184Af7a5bB925137757B15/logo.png b/blockchains/ethereum/assets/0x39043aae9c48a628F5184Af7a5bB925137757B15/logo.png index 5472772ea..38a3335be 100644 Binary files a/blockchains/ethereum/assets/0x39043aae9c48a628F5184Af7a5bB925137757B15/logo.png and b/blockchains/ethereum/assets/0x39043aae9c48a628F5184Af7a5bB925137757B15/logo.png differ diff --git a/blockchains/ethereum/assets/0x43c1c012aA89C60019b4E941cCaC98f22D2f3C01/logo.png b/blockchains/ethereum/assets/0x43c1c012aA89C60019b4E941cCaC98f22D2f3C01/logo.png index f4319f435..2121f7697 100644 Binary files a/blockchains/ethereum/assets/0x43c1c012aA89C60019b4E941cCaC98f22D2f3C01/logo.png and b/blockchains/ethereum/assets/0x43c1c012aA89C60019b4E941cCaC98f22D2f3C01/logo.png differ diff --git a/blockchains/ethereum/assets/0x5Af2Be193a6ABCa9c8817001F45744777Db30756/logo.png b/blockchains/ethereum/assets/0x5Af2Be193a6ABCa9c8817001F45744777Db30756/logo.png index 055c6ed7b..45bb31d9f 100644 Binary files a/blockchains/ethereum/assets/0x5Af2Be193a6ABCa9c8817001F45744777Db30756/logo.png and b/blockchains/ethereum/assets/0x5Af2Be193a6ABCa9c8817001F45744777Db30756/logo.png differ diff --git a/blockchains/ethereum/assets/0x5aD866239154Bc912846576a60277e2a085E365C/logo.png b/blockchains/ethereum/assets/0x5aD866239154Bc912846576a60277e2a085E365C/logo.png index 3e8a96c59..cb289dcc3 100644 Binary files a/blockchains/ethereum/assets/0x5aD866239154Bc912846576a60277e2a085E365C/logo.png and b/blockchains/ethereum/assets/0x5aD866239154Bc912846576a60277e2a085E365C/logo.png differ diff --git a/blockchains/ethereum/assets/0x6443589eEE45DaBdcf7c5Ceb5e4375b6d786357d/logo.png b/blockchains/ethereum/assets/0x6443589eEE45DaBdcf7c5Ceb5e4375b6d786357d/logo.png index 08b41715a..9e4b72f7d 100644 Binary files a/blockchains/ethereum/assets/0x6443589eEE45DaBdcf7c5Ceb5e4375b6d786357d/logo.png and b/blockchains/ethereum/assets/0x6443589eEE45DaBdcf7c5Ceb5e4375b6d786357d/logo.png differ diff --git a/blockchains/ethereum/assets/0xAb418c5A8a85f9cC0fbA1802a57a30Bf7dB34d7C/logo.png b/blockchains/ethereum/assets/0xAb418c5A8a85f9cC0fbA1802a57a30Bf7dB34d7C/logo.png index 3dd675270..f78bf53c3 100644 Binary files a/blockchains/ethereum/assets/0xAb418c5A8a85f9cC0fbA1802a57a30Bf7dB34d7C/logo.png and b/blockchains/ethereum/assets/0xAb418c5A8a85f9cC0fbA1802a57a30Bf7dB34d7C/logo.png differ diff --git a/blockchains/ethereum/assets/0xBBbbCA6A901c926F240b89EacB641d8Aec7AEafD/logo.png b/blockchains/ethereum/assets/0xBBbbCA6A901c926F240b89EacB641d8Aec7AEafD/logo.png index a98f6de93..57db87970 100644 Binary files a/blockchains/ethereum/assets/0xBBbbCA6A901c926F240b89EacB641d8Aec7AEafD/logo.png and b/blockchains/ethereum/assets/0xBBbbCA6A901c926F240b89EacB641d8Aec7AEafD/logo.png differ diff --git a/blockchains/ethereum/assets/0xE98b5F11897d42Afd17185dd301Bcb2d46389bF1/logo.png b/blockchains/ethereum/assets/0xE98b5F11897d42Afd17185dd301Bcb2d46389bF1/logo.png index 536f9713c..295a730fc 100644 Binary files a/blockchains/ethereum/assets/0xE98b5F11897d42Afd17185dd301Bcb2d46389bF1/logo.png and b/blockchains/ethereum/assets/0xE98b5F11897d42Afd17185dd301Bcb2d46389bF1/logo.png differ diff --git a/blockchains/ethereum/assets/0xF02DAB52205aFf6Bb3d47Cc7B21624a5064F9FBA/logo.png b/blockchains/ethereum/assets/0xF02DAB52205aFf6Bb3d47Cc7B21624a5064F9FBA/logo.png index 08b41715a..9e4b72f7d 100644 Binary files a/blockchains/ethereum/assets/0xF02DAB52205aFf6Bb3d47Cc7B21624a5064F9FBA/logo.png and b/blockchains/ethereum/assets/0xF02DAB52205aFf6Bb3d47Cc7B21624a5064F9FBA/logo.png differ diff --git a/blockchains/ethereum/assets/0xF21D65979bD89b28f05EF19F3c65dd2A1D02946D/logo.png b/blockchains/ethereum/assets/0xF21D65979bD89b28f05EF19F3c65dd2A1D02946D/logo.png index 683fbd071..81521107f 100644 Binary files a/blockchains/ethereum/assets/0xF21D65979bD89b28f05EF19F3c65dd2A1D02946D/logo.png and b/blockchains/ethereum/assets/0xF21D65979bD89b28f05EF19F3c65dd2A1D02946D/logo.png differ diff --git a/blockchains/ethereum/assets/0xa4f267b2bf5C47873Ec85cB55749368bc15eC2ec/logo.png b/blockchains/ethereum/assets/0xa4f267b2bf5C47873Ec85cB55749368bc15eC2ec/logo.png index ad6ede4b4..03637f726 100644 Binary files a/blockchains/ethereum/assets/0xa4f267b2bf5C47873Ec85cB55749368bc15eC2ec/logo.png and b/blockchains/ethereum/assets/0xa4f267b2bf5C47873Ec85cB55749368bc15eC2ec/logo.png differ diff --git a/blockchains/ethereum/assets/0xcf0425a35f1FA900bb347Cb996D3094D1dF3Cd48/logo.png b/blockchains/ethereum/assets/0xcf0425a35f1FA900bb347Cb996D3094D1dF3Cd48/logo.png index 5950b3943..8b5b0537a 100644 Binary files a/blockchains/ethereum/assets/0xcf0425a35f1FA900bb347Cb996D3094D1dF3Cd48/logo.png and b/blockchains/ethereum/assets/0xcf0425a35f1FA900bb347Cb996D3094D1dF3Cd48/logo.png differ diff --git a/blockchains/ethereum/assets/0xd3CDc4e75750DC1e59F8342200742B6B29490e70/logo.png b/blockchains/ethereum/assets/0xd3CDc4e75750DC1e59F8342200742B6B29490e70/logo.png index 6954d88e4..b512bf358 100644 Binary files a/blockchains/ethereum/assets/0xd3CDc4e75750DC1e59F8342200742B6B29490e70/logo.png and b/blockchains/ethereum/assets/0xd3CDc4e75750DC1e59F8342200742B6B29490e70/logo.png differ diff --git a/blockchains/kava/validators/assets/kavavaloper1dede4flaq24j2g9u8f83vkqrqxe6cwzrxt5zsu/logo.png b/blockchains/kava/validators/assets/kavavaloper1dede4flaq24j2g9u8f83vkqrqxe6cwzrxt5zsu/logo.png index 48a0a0ac4..2b81022b4 100644 Binary files a/blockchains/kava/validators/assets/kavavaloper1dede4flaq24j2g9u8f83vkqrqxe6cwzrxt5zsu/logo.png and b/blockchains/kava/validators/assets/kavavaloper1dede4flaq24j2g9u8f83vkqrqxe6cwzrxt5zsu/logo.png differ diff --git a/blockchains/terra/assets/ukrw/logo.png b/blockchains/terra/assets/ukrw/logo.png index 6a43def80..eaf3bad62 100644 Binary files a/blockchains/terra/assets/ukrw/logo.png and b/blockchains/terra/assets/ukrw/logo.png differ diff --git a/blockchains/terra/assets/umnt/logo.png b/blockchains/terra/assets/umnt/logo.png index 4547c7ca1..7bb0c3486 100644 Binary files a/blockchains/terra/assets/umnt/logo.png and b/blockchains/terra/assets/umnt/logo.png differ diff --git a/blockchains/terra/assets/usdr/logo.png b/blockchains/terra/assets/usdr/logo.png index f7c03adbf..b4a47bf4f 100644 Binary files a/blockchains/terra/assets/usdr/logo.png and b/blockchains/terra/assets/usdr/logo.png differ diff --git a/blockchains/terra/assets/uusd/logo.png b/blockchains/terra/assets/uusd/logo.png index 0b5b7ef31..e87b9ef81 100644 Binary files a/blockchains/terra/assets/uusd/logo.png and b/blockchains/terra/assets/uusd/logo.png differ diff --git a/blockchains/tron/assets/1002683/logo.png b/blockchains/tron/assets/1002683/logo.png index 53b4011f0..bbcf2752d 100644 Binary files a/blockchains/tron/assets/1002683/logo.png and b/blockchains/tron/assets/1002683/logo.png differ diff --git a/blockchains/tron/assets/1002762/logo.png b/blockchains/tron/assets/1002762/logo.png index d00b3a96a..37d0489be 100644 Binary files a/blockchains/tron/assets/1002762/logo.png and b/blockchains/tron/assets/1002762/logo.png differ diff --git a/blockchains/tron/assets/TCRhVHPv6efvXgogNMhiunAMXFKcMmv2pF/logo.png b/blockchains/tron/assets/TCRhVHPv6efvXgogNMhiunAMXFKcMmv2pF/logo.png index 3d9e975b1..b17da696c 100644 Binary files a/blockchains/tron/assets/TCRhVHPv6efvXgogNMhiunAMXFKcMmv2pF/logo.png and b/blockchains/tron/assets/TCRhVHPv6efvXgogNMhiunAMXFKcMmv2pF/logo.png differ diff --git a/src/test/helpers.ts b/src/test/helpers.ts index 821827694..9bb76f774 100644 --- a/src/test/helpers.ts +++ b/src/test/helpers.ts @@ -1,4 +1,6 @@ import * as fs from "fs" +import * as path from "path" + const axios = require('axios') const Web3 = require('web3') const web3 = new Web3('ws://localhost:8546'); @@ -25,7 +27,9 @@ const whiteList = 'whitelist.json' const blackList = 'blacklist.json' export const logo = `logo.png` +export const root = './' export const chainsFolderPath = './blockchains' +export const pricingFolderPath = './pricing' export const getChainLogoPath = chain => `${chainsFolderPath}/${chain}/info/${logo}` export const getChainAssetsPath = (chain: string): string => `${chainsFolderPath}/${chain}/assets` @@ -88,4 +92,32 @@ export const calculateAspectRatioFit = (srcWidth: number, srcHeight: number, max const ratio = Math.min(maxWidth / srcWidth, maxHeight / srcHeight) return { width: Math.round(srcWidth * ratio), height: Math.round(srcHeight * ratio) } } - \ No newline at end of file + + export const findFiles = (base: string, ext: string, files: string[] = [], result: string[] = []) => { + files = fs.readdirSync(base) || files + result = result || result + + files.forEach( + function (file) { + var newbase = path.join(base, file) + if ( fs.statSync(newbase).isDirectory()) { + result = findFiles(newbase, ext, fs.readdirSync(newbase), result) + } else { + if ( file.substr(-1*(ext.length+1)) == '.' + ext) { + result.push(newbase) + } + } + } + ) + return result + } + + export const isValidJSON = (path: string) => { + let rawdata = fs.readFileSync(path, 'utf8') + try { + JSON.parse(rawdata) + return true + } catch { + return false + } + } \ No newline at end of file diff --git a/src/test/index.test.ts b/src/test/index.test.ts index a2d5333db..e39d3dbaf 100644 --- a/src/test/index.test.ts +++ b/src/test/index.test.ts @@ -3,6 +3,7 @@ const eztz = require('eztz-lib') import { Ethereum, Binance, Cosmos, Tezos, Tron, IoTeX, Waves, Classic, POA, TomoChain, GoChain, Wanchain, ThunderCore, chainsFolderPath, + pricingFolderPath, getChainLogoPath, getChainAssetsPath, getChainAssetLogoPath, @@ -19,7 +20,9 @@ import { isLogoOK, getChainWhitelistPath, getChainBlacklistPath, - mapList + mapList, + findFiles, + isValidJSON } from "./helpers" enum TickerType { @@ -326,3 +329,15 @@ describe.skip("Test blacklist and whitelist", () => { }) }) +describe("Test all JSON files to have valid content", () => { + + const files = [ + ...findFiles(chainsFolderPath, 'json'), + ...findFiles(pricingFolderPath, 'json') + ] + + files.forEach(file => { + expect(isValidJSON(file), `${file} path contains invalid JSON`).toBe(true) + }); +}) +