Add tests to over lowercase file naming when address checksum (#1039)
* Add tests cover lwoercase file naming when address checksum * Optimised images with calibre/image-actions * SG10006(YOU) (YOU) * Optimised images with calibre/image-actions Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
@ -22,4 +22,4 @@ steps:
|
|||
path: $(npm_config_cache)
|
||||
displayName: Cache npm
|
||||
|
||||
- script: npm t
|
||||
- script: npm t
|
||||
|
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 6.0 KiB |
BIN
blockchains/ethereum/assets/0x8AAA0D43cc86ed98b7aA9c8e1f87A319Cd873DC4/logo.png
Executable file → Normal file
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 73 KiB |
BIN
blockchains/ethereum/assets/0x8F564dc862FfE7EC0436C3717EC7ED06150144E2/logo.png
Executable file → Normal file
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.0 KiB |
|
@ -2,8 +2,9 @@ const fs = require('fs')
|
|||
import { getOpenseaCollectionAddresses } from "./opesea_contrats"
|
||||
|
||||
import {
|
||||
Ethereum, Classic, POA, TomoChain, GoChain, Wanchain, ThunderCore, Terra, Tron,
|
||||
Ethereum, Terra, Tron,
|
||||
getChainAssetsPath,
|
||||
ethSidechains,
|
||||
readDirSync,
|
||||
readFileSync,
|
||||
isChainWhitelistExistSync,
|
||||
|
@ -16,7 +17,7 @@ import {
|
|||
mapList
|
||||
} from '../src/test/helpers'
|
||||
|
||||
const assetsChains = [Ethereum, Classic, POA, TomoChain, GoChain, Wanchain, ThunderCore, Terra, Tron]
|
||||
const assetsChains = ethSidechains.concat([Terra, Tron])
|
||||
|
||||
assetsChains.forEach(async chain => {
|
||||
const assets = readDirSync(getChainAssetsPath(chain))
|
||||
|
|
|
@ -23,6 +23,8 @@ export const Tron = getChainName(CoinType.tron)
|
|||
export const Wanchain = getChainName(CoinType.wanchain)
|
||||
export const Waves = getChainName(CoinType.waves)
|
||||
|
||||
export const ethSidechains = [Ethereum, Classic, POA, TomoChain, GoChain, Wanchain, ThunderCore]
|
||||
|
||||
const whiteList = 'whitelist.json'
|
||||
const blackList = 'blacklist.json'
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
const eztz = require('eztz-lib')
|
||||
|
||||
import {
|
||||
Ethereum, Binance, Cosmos, Tezos, Tron, IoTeX, Waves, Classic, POA, TomoChain, GoChain, Wanchain, ThunderCore,
|
||||
Binance, Cosmos, Tezos, Tron, IoTeX, Waves,
|
||||
ethSidechains,
|
||||
chainsFolderPath,
|
||||
pricingFolderPath,
|
||||
getChainLogoPath,
|
||||
|
@ -77,14 +78,18 @@ describe(`Test "blockchains" folder`, () => {
|
|||
})
|
||||
|
||||
describe("Check Ethereum side-chain folders", () => {
|
||||
const ethSidechains = [Ethereum, Classic, POA, TomoChain, GoChain, Wanchain, ThunderCore]
|
||||
|
||||
ethSidechains.forEach(chain => {
|
||||
test(`Test chain ${chain} folder`, () => {
|
||||
const assetsPath = getChainAssetsPath(chain)
|
||||
|
||||
readDirSync(assetsPath).forEach(addr => {
|
||||
expect(isChecksum(addr), `Address ${addr} on chain ${chain} must be in checksum`).toBe(true)
|
||||
const checksum: boolean = isChecksum(addr)
|
||||
expect(checksum, `Address ${addr} on chain ${chain} must be in checksum`).toBe(true)
|
||||
|
||||
const lowercase: boolean = isLowerCase(addr)
|
||||
if (lowercase) {
|
||||
expect(checksum, `Lowercase address ${addr} on chain ${chain} should be in checksum`).toBe(true)
|
||||
}
|
||||
|
||||
const assetLogoPath = getChainAssetLogoPath(chain, addr)
|
||||
expect(isPathExistsSync(assetLogoPath), `Missing file at path "${assetLogoPath}"`).toBe(true)
|
||||
|
|