diff --git a/blockchains/ethereum/assets/0x2afd9cE07D4186e8F3671D52200850760a8E1F70/info.json b/blockchains/ethereum/assets/0x2afd9cE07D4186e8F3671D52200850760a8E1F70/info.json new file mode 100644 index 000000000..6cc64e532 --- /dev/null +++ b/blockchains/ethereum/assets/0x2afd9cE07D4186e8F3671D52200850760a8E1F70/info.json @@ -0,0 +1,14 @@ +{ + "name": "Flama", + "website": "https://flamanet.io/", + "short_description": "Flama is one of the first deflationary tokens in the market with enhanced futures like staking.", + "description": "Flama is one of the first deflationary tokens in the market with enhanced futures like staking.", + "socials": [ + { + "name": "Twitter", + "url": "https://twitter.com/FlamaToken", + "handle": "Flama" + } + ], + "explorer": "https://etherscan.io/token/0x2afd9ce07d4186e8f3671d52200850760a8e1f70" +} diff --git a/blockchains/ethereum/assets/0x2afd9cE07D4186e8F3671D52200850760a8E1F70/logo.png b/blockchains/ethereum/assets/0x2afd9cE07D4186e8F3671D52200850760a8E1F70/logo.png new file mode 100644 index 000000000..91dd2ee83 Binary files /dev/null and b/blockchains/ethereum/assets/0x2afd9cE07D4186e8F3671D52200850760a8E1F70/logo.png differ diff --git a/src/test/helpers.ts b/src/test/helpers.ts index 22abd992f..973fa255b 100644 --- a/src/test/helpers.ts +++ b/src/test/helpers.ts @@ -52,6 +52,7 @@ export const getChainLogoPath = (chain: string): string => `${chainsFolderPath}/ export const getChainInfoPath = (chain: string): string => `${chainsFolderPath}/${chain}/info/${info}` export const getChainAssetInfoPath = (chain: string, address: string): string => `${chainsFolderPath}/${chain}/assets/${address}/${info}` export const getChainAssetsPath = (chain: string): string => `${chainsFolderPath}/${chain}/assets` +export const getChainPath = (chain: string): string => `${chainsFolderPath}/${chain}` export const minLogoWidth = 64 export const minLogoHeight = 64 @@ -64,6 +65,7 @@ export const getChainAssetPath = (chain: string, address: string) => `${getChain export const getAllChainsList = (): string[] => readDirSync(chainsFolderPath) export const getChainAssetLogoPath = (chain: string, address: string) => `${getChainAssetsPath(chain)}/${address}/${logo}` export const getChainAssetFilesList = (chain: string, address: string) => readDirSync(getChainAssetPath(chain, address)) +export const getChainFolderFilesList = (chain: string) => readDirSync(getChainPath(chain)) export const getChainAssetsList = (chain: string): string[] => readDirSync(getChainAssetsPath(chain)) export const getChainValidatorsPath = (chain: string): string => `${chainsFolderPath}/${chain}/validators` export const getChainValidatorsAssets = (chain: string): string[] => readDirSync(getChainValidatorsAssetsPath(chain)) @@ -316,3 +318,11 @@ export const assetFolderAllowedFiles = [ logo, info ] + +export const chainFolderAllowedFiles = [ + "assets", + "whitelist.json", + "blacklist.json", + "validators", + infoName +] diff --git a/src/test/index.test.ts b/src/test/index.test.ts index 23bb65dfd..7e9ac9240 100644 --- a/src/test/index.test.ts +++ b/src/test/index.test.ts @@ -3,6 +3,7 @@ const eztz = require('eztz-lib') import { Binance, Cosmos, Tezos, Tron, IoTeX, Waves, Kava, Terra, assetFolderAllowedFiles, + chainFolderAllowedFiles, chainsFolderPath, ethSidechains, findFiles, @@ -10,6 +11,7 @@ import { getChainAssetLogoPath, getChainAssetPath, getChainAssetsPath, + getChainFolderFilesList, getChainBlacklistPath, getChainLogoPath, getChainValidatorAssetLogoPath, @@ -82,6 +84,14 @@ describe(`Test "blockchains" folder`, () => { }) }) + describe(`Chain folder should contain only predefined list of files`, () => { + readDirSync(chainsFolderPath).forEach(chain => { + getChainFolderFilesList(chain).forEach(file => { + expect(chainFolderAllowedFiles.indexOf(file),`File "${typeof file}" ${file} not allowed in chain folder: ${chain}`).not.toBe(-1) + }) + }) + }) + describe("Check Ethereum side-chain folders", () => { ethSidechains.forEach(chain => { test(`Test chain ${chain} folder`, () => {