diff --git a/README.md b/README.md index 743672a082171..cd844bc468dd6 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Token repository [https://github.com/trustwallet/assets](https://github.com/trus ## Image Requirements - file extension: `png`. Uppercase `PNG` considered invalid. - nameļ¼šfile name requirements for: `logo.png` name, but [folder naming](#repository-structure) where they placed is most important part of contribution -- size: `256px by 256px` +- size: `256px by 256px` or `512px by 512px` - background: preferably transparent - use simple drag and drop online service [tinypng](https://tinypng.com/) to optimize image size diff --git a/blockchains/binance/assets/ETH-1C9/logo.png b/blockchains/binance/assets/ETH-1C9/logo.png new file mode 100644 index 0000000000000..bd9c147910acd Binary files /dev/null and b/blockchains/binance/assets/ETH-1C9/logo.png differ diff --git a/blockchains/binance/whitelist.json b/blockchains/binance/whitelist.json index 165f2b6e21d3a..c56d423d3c037 100644 --- a/blockchains/binance/whitelist.json +++ b/blockchains/binance/whitelist.json @@ -45,6 +45,7 @@ "ENTRP-C8D", "EQL-586", "ERD-D06", + "ETH-1C9", "EVT-49B", "FRM-DE7", "FSN-E14", diff --git a/blockchains/ethereum/blacklist.json b/blockchains/ethereum/blacklist.json index b99fd2f834bef..c2afe3370742e 100644 --- a/blockchains/ethereum/blacklist.json +++ b/blockchains/ethereum/blacklist.json @@ -87,6 +87,7 @@ "0x0b3A4677Fcc0243611d84bD4F207ceddEdDAa614", "0x0B762B6DF5940c6B55E21143142286c74299e174", "0x0ba000163959726c90D41C804386D37718D5edc8", + "0x0bDb10aD5C6FD85128469bE197e9A7f188289028", "0x0BDbcB36c0C106C960FbB0B5194735c552CCd213", "0x0C15D535F8c21d6f3A03dd46ae23A07e5d897C80", "0x0c62c429F5d2bACA26dbcfD800bFcc94943e81f9", @@ -594,6 +595,7 @@ "0x568e0B837B27C1EaFb7E172eaEB0f7fF5146F39B", "0x56938a9396D1AE050046b89997Fe067Db62Fcd42", "0x56a64d3e68779865787cf8a05023F95f389765eB", + "0x56aA5Fd3e1322652683C4614A39af01b59623d1d", "0x56C72CdA0B04Fc39A25d0b6a64FA258faD46d664", "0x56CD53067E5acD557dBBfB4c66580DFb9722962A", "0x56F123785b54978C6c0B117F15d3ee69eB9bf6c8", @@ -859,6 +861,7 @@ "0x7910254cEe5cb6BdCefd9b8eCE1d0e59B6Daa1d7", "0x7924520c2e627D27cA641fc78E6918973C8ed80a", "0x79679a8f135d7DaC7556588bb8f4039540f2a668", + "0x7997a159Cb3d194D68eb48ff66a1C6C618CfA3CE", "0x79986aF15539de2db9A5086382daEdA917A9CF0C", "0x79BF7a8391CB795FB32560F7288291ABfF6D3A5B", "0x79c3255baeb162764DC1e6AE382b696109Ae51f6", @@ -925,6 +928,7 @@ "0x8083986757ED1F1823E20c1D8458b45854Bafb9A", "0x809865309dfa75d3F18b4fFa219B396452076aE8", "0x80db22675DAd70e44b64029510778583187fadDb", + "0x81048F76b2A8A414b56Ce9b77f14f2F24c8A0275", "0x8116DbB0E89Ca936f0D5fc3b13125CC316114043", "0x811A804323D2F592d9736B70199a94b9E97C53A8", "0x813C315a72192805F99fD90D8d65b3EC3A83aC02", @@ -1211,6 +1215,7 @@ "0xA684C9333641376ad62CeDe5a65629627A5AB028", "0xA6afc8E0F393d74EDAd5ddD2396f996C33D8f1b4", "0xA6d954d08877f8ce1224f6BFb83484c7D3aBF8E9", + "0xa6ED82A4C2395687daEC7bf13cE38b133db22B10", "0xa7332A720aBE886754f288FF2Ad141A9Eb80DC67", "0xA73f400f6A8F1FEe275A15f7b763c93fA777bF9E", "0xA747089A248aD8B9d8cd8DB93EBc2DCeBF3607FA", @@ -1397,6 +1402,7 @@ "0xbc8182a035e40FA640078CA347399b086f59947A", "0xbC92abeE522870e255b5C3d77709a64B55604072", "0xbcd5AF129A14120ce86A1265Bb573731B71BC4d6", + "0xBCE981c214FB0D87112eDD383d9E9a0fce5A59Ea", "0xBd13e53255eF917DA7557db1B7D2d5C38a2EFe24", "0xbD4268B265e09421960da47D4Ae4F6EB16Af9293", "0xbd62a47FD8Ad82893aA8C91921938366C00b03D6", @@ -1499,6 +1505,7 @@ "0xCaA457cAF638C4fB3C73C3e990BFD99f0A8Ac298", "0xcAa86D11A065727df110846f696773B840A6E313", "0xCab298344DEC6547Af008D91064a24F0455c749C", + "0xCAE3c92A6d4B6520E00eEDEadA982261332d9494", "0xCB35D14759E2931022C7315F53E37cdcD38E570c", "0xcb4EA4672e6E4eDc80D002ab3Ac11D4aD0D45729", "0xcB60251ff3b93E4298d3b77919CD6a3DA059D7f7", @@ -1562,6 +1569,7 @@ "0xD3B353421FC5048AD38f7581097951bb9D6C52FF", "0xd3DFfC1aCFEa59557B9092A5C095ACA91d696a57", "0xd3fCD4c1fA2952CF3B1a3f531C95b4b89F0974E6", + "0xd4174697a0E17501E334A901aF58492322e78ea0", "0xD4202B234c15255BF0511D3380E83bda9172A72B", "0xd44b9D3cD8e028dCC3e3C7397AA8B23477498AbE", "0xd46BbdAc84181bdCbBea2087549Bb4d64041Ac75", @@ -1604,9 +1612,11 @@ "0xD90183850D1E1908Ed8012aC9C9A7B1B23a991A3", "0xd90F5Ebc01914BbD357B754956AaFB199F4d1624", "0xd964EdCc837cc284303c46CDCa1138C5dEcd7aF9", + "0xd973E05A6DB3206b8A5F17cbE34A6e0E5f1634CB", "0xD98DB983fA7cbd21Fd24ac84c9acA430191309C2", "0xd993AE4750b6B352399978EA5EAFf78632dCcdb6", "0xdA19C55b15DCCE34050710ced00f1DD35c9e7F10", + "0xDA396a2Fc5f0e3A87a874757f1317102f49da5B0", "0xDA9c03dFd4D137F926c3cF6953cb951832Eb08b2", "0xda9f43015749056182352e9dC6D3eE0B6293D80A", "0xdAb189B6DE4D458C9eE8EF7201719fb9E74b7481", diff --git a/blockchains/ethereum/whitelist.json b/blockchains/ethereum/whitelist.json index ee889620583af..6b82326143ff2 100644 --- a/blockchains/ethereum/whitelist.json +++ b/blockchains/ethereum/whitelist.json @@ -462,6 +462,7 @@ "0x1C62aCa2b7605Db3606eAcdA7Bc67A1857DDb8FF", "0x1C6d1310A0c084021B9b94ab460f9BAD560773a4", "0x1c6DD53Ccb74234C10410Af31F56082071D1C88b", + "0x1c74cFF0376FB4031Cd7492cD6dB2D66c3f2c6B9", "0x1c79ab32C66aCAa1e9E81952B8AAa581B43e54E7", "0x1C83501478f1320977047008496DACBD60Bb15ef", "0x1C95b093d6C236d3EF7c796fE33f9CC6b8606714", @@ -1143,6 +1144,7 @@ "0x490c95bE16384E1f28B9e864e98fFEcFCBfF386d", "0x490DBf7884B8e13c2161448b83Dd2d8909dB48eD", "0x491C9A23DB85623EEd455a8EfDd6AbA9b911C5dF", + "0x493C57C4763932315A328269E1ADaD09653B9081", "0x493Fc2760375a1d7bCcd50e82A6733883f63D167", "0x4943D17D370174D93b104E583F489175C22AD1b6", "0x4946583c5b86E01cCD30c71a05617D06E3E73060", @@ -1167,6 +1169,7 @@ "0x49d4C3629f93f49ba934dEBF28605D26CAaF3aCc", "0x49E34308DFF5F78Ee0CC4eE1d08Cb5EaB17E829E", "0x49f112c234969F2b13724b8Ad81C182aCF3B8410", + "0x49f4592E641820e928F9919Ef4aBd92a719B4b49", "0x49fa378b4550758731A0A4638330b2e59cE37fA6", "0x4a220E6096B25EADb88358cb44068A3248254675", "0x4A37A91eec4C97F9090CE66d21D3B3Aadf1aE5aD", diff --git a/blockchains/thundertoken/whitelist.json b/blockchains/thundertoken/whitelist.json index 297a966b3d1f4..39eb9af33fb8c 100644 --- a/blockchains/thundertoken/whitelist.json +++ b/blockchains/thundertoken/whitelist.json @@ -3,5 +3,6 @@ "0x2b31e3b88847f03c1335E99A0d1274A2c72059DE", "0x4f3C8E20942461e2c3Bdd8311AC57B0c222f2b82", "0x8c844A7Eb92C45e3B542B8ce3Fe5F82d37640d7F", + "0x92B82d80A51D9b280b75C7a3596358B2A67e4859", "0xf3Cab28E25b64fcd361446CCD6418D3e51d9cB52" ] \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 2adc6539729df..bef2a0c65511c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -642,6 +642,22 @@ "normalize-path": "^2.1.1" } }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "dev": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, "arg": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz", @@ -1414,6 +1430,12 @@ "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "dev": true }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, "codecov": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/codecov/-/codecov-2.3.1.tgz", @@ -1582,6 +1604,16 @@ "object-visit": "^1.0.0" } }, + "color": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/color/-/color-3.1.2.tgz", + "integrity": "sha512-vXTJhHebByxZn3lDvDJYw4lR5+uB3vuoHsuYA5AKuxRVn5wzzIfQKGLBmgdVRHKTJYeK5rvJcHnrd0Li49CFpg==", + "dev": true, + "requires": { + "color-convert": "^1.9.1", + "color-string": "^1.5.2" + } + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -1595,6 +1627,16 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, + "color-string": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz", + "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==", + "dev": true, + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -1623,6 +1665,12 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true + }, "content-disposition": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", @@ -1956,6 +2004,12 @@ } } }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -2021,6 +2075,12 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -2040,6 +2100,12 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, + "detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "dev": true + }, "detect-newline": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", @@ -2507,6 +2573,12 @@ } } }, + "expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "dev": true + }, "expect": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/expect/-/expect-24.9.0.tgz", @@ -3432,6 +3504,59 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, "generate-function": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", @@ -3476,6 +3601,12 @@ "assert-plus": "^1.0.0" } }, + "github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=", + "dev": true + }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -3611,6 +3742,12 @@ "has-symbol-support-x": "^1.4.1" } }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true + }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -3775,6 +3912,14 @@ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" }, + "image-size": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.8.3.tgz", + "integrity": "sha512-SMtq1AJ+aqHB45c3FsB4ERK0UCiA2d3H1uq8s+8T0Pf8A3W4teyBQyaFaktH6xvZqh+npwlKU7i4fJo0r7TYTg==", + "requires": { + "queue": "6.0.1" + } + }, "import-local": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", @@ -3812,6 +3957,12 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", @@ -5226,6 +5377,12 @@ "to-regex": "^3.0.1" } }, + "napi-build-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.1.tgz", + "integrity": "sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA==", + "dev": true + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -5254,6 +5411,15 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "node-abi": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.12.0.tgz", + "integrity": "sha512-VhPBXCIcvmo/5K8HPmnWJyyhvgKxnHTUMXR/XwGHV68+wrgkzST4UmQrY/XszSWA5dtnXpNp528zkcyJ/pzVcw==", + "dev": true, + "requires": { + "semver": "^5.4.1" + } + }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -5279,6 +5445,12 @@ "which": "^1.3.0" } }, + "noop-logger": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", + "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=", + "dev": true + }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -5314,6 +5486,24 @@ "path-key": "^2.0.0" } }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, "number-to-bn": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", @@ -5728,6 +5918,63 @@ "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", "dev": true }, + "prebuild-install": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.3.tgz", + "integrity": "sha512-GV+nsUXuPW2p8Zy7SarF/2W/oiK8bFQgJcncoJ0d7kRpekEA0ftChjfEaF9/Y+QJEc/wFR7RAEa8lYByuUIe2g==", + "dev": true, + "requires": { + "detect-libc": "^1.0.3", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "napi-build-utils": "^1.0.1", + "node-abi": "^2.7.0", + "noop-logger": "^0.1.1", + "npmlog": "^4.0.1", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^3.0.3", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0", + "which-pm-runs": "^1.0.0" + }, + "dependencies": { + "decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "dev": true, + "requires": { + "mimic-response": "^2.0.0" + } + }, + "mimic-response": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.0.0.tgz", + "integrity": "sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ==", + "dev": true + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "simple-get": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", + "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", + "dev": true, + "requires": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + } + } + }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -5827,6 +6074,14 @@ "strict-uri-encode": "^1.0.0" } }, + "queue": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.1.tgz", + "integrity": "sha512-AJBQabRCCNr9ANq8v77RJEv73DPbn55cdTb+Giq4X0AVnNVZvMHlYp7XlQiN+1npCZj1DuSmaA2hYVUUDgxFDg==", + "requires": { + "inherits": "~2.0.3" + } + }, "quick-lru": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", @@ -5866,6 +6121,26 @@ "unpipe": "1.0.0" } }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, "react-is": { "version": "16.11.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.11.0.tgz", @@ -6328,6 +6603,105 @@ } } }, + "sharp": { + "version": "0.23.3", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.23.3.tgz", + "integrity": "sha512-pjT4zyviQteXMC1Z8USIiSwQFQbZTlU5J59/UoygE25hh+sSb7PSYI/MZ2MCB1COtxWQuoUAaG3TYIOLon26Mg==", + "dev": true, + "requires": { + "color": "^3.1.2", + "detect-libc": "^1.0.3", + "nan": "^2.14.0", + "npmlog": "^4.1.2", + "prebuild-install": "^5.3.3", + "semver": "^6.3.0", + "simple-get": "^3.1.0", + "tar": "^5.0.5", + "tunnel-agent": "^0.6.0" + }, + "dependencies": { + "decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "dev": true, + "requires": { + "mimic-response": "^2.0.0" + } + }, + "fs-minipass": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.0.0.tgz", + "integrity": "sha512-40Qz+LFXmd9tzYVnnBmZvFfvAADfUA14TXPK1s7IfElJTIZ97rA8w4Kin7Wt5JBrC3ShnnFJO/5vPjPEeJIq9A==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "mimic-response": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.0.0.tgz", + "integrity": "sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ==", + "dev": true + }, + "minipass": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.1.tgz", + "integrity": "sha512-UFqVihv6PQgwj8/yTGvl9kPz7xIAY+R5z6XYjRInD3Gk3qx6QGSD6zEcpeG4Dy/lQnv1J6zv8ejV90hyYIKf3w==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "minizlib": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.0.tgz", + "integrity": "sha512-EzTZN/fjSvifSX0SlqUERCN39o6T40AMarPbv0MrarSFtIITCBh7bi+dU8nxGFHuqs9jdIAeoYoKuQAAASsPPA==", + "dev": true, + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "simple-get": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", + "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", + "dev": true, + "requires": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "tar": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/tar/-/tar-5.0.5.tgz", + "integrity": "sha512-MNIgJddrV2TkuwChwcSNds/5E9VijOiw7kAc1y5hTNJoLDSuIyid2QtLYiCYNnICebpuvjhPQZsXwUL0O3l7OQ==", + "dev": true, + "requires": { + "chownr": "^1.1.3", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.0", + "mkdirp": "^0.5.0", + "yallist": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -6370,6 +6744,23 @@ "simple-concat": "^1.0.0" } }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", + "dev": true, + "requires": { + "is-arrayish": "^0.3.1" + }, + "dependencies": { + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true + } + } + }, "sisteransi": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.3.tgz", @@ -6775,6 +7166,12 @@ "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", "dev": true }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -6868,6 +7265,53 @@ "yallist": "^3.0.3" } }, + "tar-fs": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.0.tgz", + "integrity": "sha512-vaY0obB6Om/fso8a8vakQBzwholQ7v5+uy+tF3Ozvxv1KNezmVQAiWtcNmMHFSFPqL3dJA8ha6gdtFbfX9mcxA==", + "dev": true, + "requires": { + "chownr": "^1.1.1", + "mkdirp": "^0.5.1", + "pump": "^3.0.0", + "tar-stream": "^2.0.0" + }, + "dependencies": { + "bl": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-3.0.0.tgz", + "integrity": "sha512-EUAyP5UHU5hxF8BPT0LKW8gjYLhq1DQIcneOX/pL/m2Alo+OYDQAJlHq+yseMP50Os2nHXOSic6Ss3vSQeyf4A==", + "dev": true, + "requires": { + "readable-stream": "^3.0.1" + } + }, + "readable-stream": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", + "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "tar-stream": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.0.tgz", + "integrity": "sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw==", + "dev": true, + "requires": { + "bl": "^3.0.0", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + } + } + } + }, "tar-stream": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", @@ -7737,6 +8181,48 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "dev": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", diff --git a/package.json b/package.json index e68386df3c133..d9f2b028f9632 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,9 @@ "test": "npm run cleanup && jest", "cleanup": "find ./.. -iname '.DS_Store' -type f -delete", "update-bep2": "node ./script/updateBEP2", - "checksum": "npm run cleanup && node ./script/erc20_to_checksum", - "list": "npm run cleanup && ts-node ./script/gen_list" + "checksum-erc20": "npm run cleanup && node ./script/erc20_to_checksum", + "list": "npm run cleanup && ts-node ./script/gen_list", + "resize": "npm run cleanup && ts-node ./script/resize_images" }, "repository": { "type": "git", @@ -36,6 +37,7 @@ "ethereum-checksum-address": "0.0.5", "jest": "^24.9.0", "jest-expect-message": "^1.0.2", + "sharp": "^0.23.3", "ts-jest": "^24.1.0", "ts-node": "^8.4.1", "typescript": "^3.7.2" @@ -45,6 +47,7 @@ "bluebird": "^3.5.5", "chalk": "^2.4.2", "eztz-lib": "^0.1.2", + "image-size": "^0.8.3", "web3": "^1.2.2" }, "jest": { diff --git a/script/resize_images.ts b/script/resize_images.ts new file mode 100644 index 0000000000000..18bccca8511e3 --- /dev/null +++ b/script/resize_images.ts @@ -0,0 +1,73 @@ +import { + maxLogoWidth, + maxLogoHeight, + readDirSync, + chainsFolderPath, + getChainLogoPath, + calculateAspectRatioFit, + getImageDimentions, + getChainAssetsPath, + getChainAssetLogoPath, + isPathExistsSync, + writeFileSync, + readFileSync, + getChainValidatorsListPath, + getChainValidatorAssetLogoPath +} from "../src/test/helpers" +const sharp = require('sharp') +const bluebird = require("bluebird") + +const foundChains = readDirSync(chainsFolderPath) + + +function downsize() { + console.log(`Start resizing`) + bluebird.mapSeries(foundChains, async chain => { + const chainLogoPath = getChainLogoPath(chain) + const { width: srcWidth, heigth: srcHeight } = getImageDimentions(chainLogoPath) + + // Check and resize if needed chain logo + if (isDownsizing(srcWidth, srcHeight)) { + await resize(srcWidth, srcHeight, chainLogoPath) + } + + // Check and resize if needed chain assets + const assetsPath = getChainAssetsPath(chain) + if (isPathExistsSync(assetsPath)) { + bluebird.mapSeries(readDirSync(assetsPath), async asset => { + const assetPath = getChainAssetLogoPath(chain, asset) + const { width: srcWidth, height: srcHeight } = getImageDimentions(assetPath) + if (isDownsizing(srcWidth, srcHeight)) { + await resize(srcWidth, srcHeight, assetPath) + } + }) + } + + // Check and resize if needed chain validators image + const chainValidatorsList = getChainValidatorsListPath(chain) + if (isPathExistsSync(chainValidatorsList)) { + const validatorsList = JSON.parse(readFileSync(getChainValidatorsListPath(chain))) + bluebird.mapSeries(validatorsList, async ({ id }) => { + const path = getChainValidatorAssetLogoPath(chain, id) + const { width: srcWidth, height: srcHeight } = getImageDimentions(path) + if (isDownsizing(srcWidth, srcHeight)) { + await resize(srcWidth, srcHeight, path) + } + }) + } + }) +} + +downsize() + +function isDownsizing(srcWidth: number, srcHeight: number): boolean { + return (srcWidth > maxLogoWidth) || (srcHeight > maxLogoHeight) +} + +async function resize(srcWidth: number, srcHeight: number, path: string) { + const { width, height } = calculateAspectRatioFit(srcWidth, srcHeight, maxLogoWidth, maxLogoHeight) + console.log(` Resizing image at ${path} from ${srcWidth}x${srcHeight} => ${width}x${height}`) + await sharp(path).resize(width, height).toBuffer() + .then(data => writeFileSync(path, data)) + .catch(e => console.log(e)) +} \ No newline at end of file diff --git a/src/test/helpers.ts b/src/test/helpers.ts index bc0b091569bc3..4bc2444ce5bc1 100644 --- a/src/test/helpers.ts +++ b/src/test/helpers.ts @@ -3,7 +3,9 @@ const axios = require('axios') const Web3 = require('web3') const web3 = new Web3('ws://localhost:8546'); import { CoinTypeUtils, CoinType } from "@trustwallet/types"; +const sizeOf = require("image-size"); +export const getChainName = (id: CoinType): string => CoinTypeUtils.id(id) export const Binance = getChainName(CoinType.binance) export const Cosmos = getChainName(CoinType.cosmos) export const Ethereum = getChainName(CoinType.ethereum) @@ -24,9 +26,12 @@ const blackList = 'blacklist.json' export const logo = `logo.png` export const chainsFolderPath = './blockchains' export const getChainLogoPath = chain => `${chainsFolderPath}/${chain}/info/${logo}` -export function getChainAssetsPath (chain) { - return `${chainsFolderPath}/${chain}/assets` -} +export const getChainAssetsPath = (chain: string): string => `${chainsFolderPath}/${chain}/assets` + +export const minLogoWidth = 64 +export const minLogoHeight = 64 +export const maxLogoWidth = 512 +export const maxLogoHeight = 512 export const getChainAssetLogoPath = (chain, address) => `${getChainAssetsPath(chain)}/${address}/${logo}` export const getChainValidatorsPath = chain => `${chainsFolderPath}/${chain}/validators` @@ -67,6 +72,19 @@ export const mapList = arr => { }, {}) } -function getChainName(id: CoinType): string { - return CoinTypeUtils.id(id) +export const getImageDimentions = (path: string) => sizeOf(path) + +export const isLogoOK = (path: string): [boolean, string] => { + const { width, height } = getImageDimentions(path) + if (((width >= minLogoWidth && width <= maxLogoWidth) && (height >= minLogoHeight && height <= maxLogoHeight))) { + return [true, ''] + } else { + return [false, `Image at path ${path} must have dimensions: min:${minLogoWidth}x${minLogoHeight} and max:${maxLogoWidth}x${maxLogoHeight} insted ${width}x${height}`] + } } + +export const calculateAspectRatioFit = (srcWidth: number, srcHeight: number, maxWidth: number, maxHeight: number) => { + 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 diff --git a/src/test/index.test.ts b/src/test/index.test.ts index 95ebefda179cc..a73664a8a7d38 100644 --- a/src/test/index.test.ts +++ b/src/test/index.test.ts @@ -15,7 +15,8 @@ import { isLowerCase, isChecksum, getBinanceBEP2Symbols, - isTRC10, isTRC20 + isTRC10, isTRC20, + isLogoOK, } from "./helpers" describe("Check repository root dir", () => { @@ -53,14 +54,16 @@ describe(`Test "blockchains" folder`, () => { foundChains.forEach(chain => { const chainLogoPath = getChainLogoPath(chain) expect(isPathExistsSync(chainLogoPath), `File missing at path "${chainLogoPath}"`).toBe(true) + const [isOk, msg] = isLogoOK(chainLogoPath) + expect(isOk, msg).toBe(true) }) - }); + }) test("Chain folder must have lowercase naming", () => { foundChains.forEach(chain => { expect(isLowerCase(chain), `Chain folder must be in lowercase "${chain}"`).toBe(true) }) - }); + }) describe("Check Ethereum side-chain folders", () => { const ethSidechains = [Ethereum, Classic, POA, TomoChain, GoChain, Wanchain, ThunderCore] @@ -74,6 +77,8 @@ describe(`Test "blockchains" folder`, () => { const assetLogoPath = getChainAssetLogoPath(chain, addr) expect(isPathExistsSync(assetLogoPath), `Missing file at path "${assetLogoPath}"`).toBe(true) + const [isOk, msg] = isLogoOK(assetLogoPath) + expect(isOk, msg).toBe(true) }) }) }) @@ -99,7 +104,9 @@ describe(`Test "blockchains" folder`, () => { const assetsLogoPath = getChainAssetLogoPath(Tron, asset) expect(isPathExistsSync(assetsLogoPath), `Missing file at path "${assetsLogoPath}"`).toBe(true) - }); + const [isOk, msg] = isLogoOK(assetsLogoPath) + expect(isOk, msg).toBe(true) + }) }) }) @@ -126,12 +133,15 @@ describe(`Test "blockchains" folder`, () => { }) - test(`Chain ${chain} validator must have coresponding asset logo`, () => { + test(`Chain ${chain} validator must have corresponding asset logo`, () => { validatorsList.forEach(({ id }) => { const path = getChainValidatorAssetLogoPath(chain, id) expect(isPathExistsSync(path), `Chain ${chain} asset ${id} logo must be present at path ${path}`).toBe(true) + + const [isOk, msg] = isLogoOK(path) + expect(isOk, msg).toBe(true) }) - }); + }) const chainValidatorsAssetsList = getChainValidatorsAssets(chain) switch (chain) { @@ -144,28 +154,25 @@ describe(`Test "blockchains" folder`, () => { case Tron: testTronValidatorsAssets(chainValidatorsAssetsList) break; - case Tron: - testTronValidatorsAssets(chainValidatorsAssetsList) - break; // TODO Add LOOM - // TODO Add + // TODO Add Waves + // TODO Add IoTex default: break; } test("Make sure number of validators in the list match validators assets", () => { expect(validatorsList.length).toBe(chainValidatorsAssetsList.length) - }); + }) }) - - }); + }) }) function testTezosValidatorsAssets(assets) { test("Tezos assets must be correctly formated tz1 address", () => { assets.forEach(addr => { expect(eztz.crypto.checkAddress(addr), `Ivalid Tezos address: ${addr}`).toBe(true) - }); + }) }) } @@ -173,7 +180,7 @@ function testTronValidatorsAssets(assets) { test("TRON assets must be correctly formated", () => { assets.forEach(addr => { expect(isTRC20(addr), `Address ${addr} should be TRC20`).toBe(true) - }); + }) }) } @@ -183,7 +190,7 @@ function testCosmosValidatorsAddress(assets) { expect(addr.startsWith("cosmosvaloper1"), `Address ${addr} should start from "cosmosvaloper1"`).toBe(true) expect(addr.length, `Address ${addr} should have length 52`).toBe(52) expect(isLowerCase(addr), `Address ${addr} should be in lowercase`).toBe(true) - }); + }) }) }