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>
This commit is contained in:
Mykola 2020-01-17 17:31:42 +09:00 committed by GitHub
parent 2275315e85
commit 10294db1cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 15 additions and 7 deletions

View File

@ -22,4 +22,4 @@ steps:
path: $(npm_config_cache)
displayName: Cache npm
- script: npm t
- script: npm t

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -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))

View File

@ -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'

View File

@ -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)