mirror of
https://github.com/Instadapp/trustwallet-assets.git
synced 2024-07-29 22:37:31 +00:00
Move checksum script to ts
This commit is contained in:
parent
5c56f3fb2f
commit
048b941bf4
|
@ -8,7 +8,7 @@
|
||||||
"test": "npm run cleanup && jest",
|
"test": "npm run cleanup && jest",
|
||||||
"cleanup": "find ./.. -iname '.DS_Store' -type f -delete",
|
"cleanup": "find ./.. -iname '.DS_Store' -type f -delete",
|
||||||
"update-bep2": "npm run cleanup && node ./script/updateBEP2",
|
"update-bep2": "npm run cleanup && node ./script/updateBEP2",
|
||||||
"checksum-erc20": "npm run cleanup && node ./script/erc20_to_checksum",
|
"checksum-erc20": "npm run cleanup && ts-node ./script/erc20_to_checksum",
|
||||||
"list": "npm run cleanup && ts-node ./script/gen_list",
|
"list": "npm run cleanup && ts-node ./script/gen_list",
|
||||||
"gen:info": "ts-node ./script/gen_info",
|
"gen:info": "ts-node ./script/gen_info",
|
||||||
"resize": "npm run cleanup && ts-node ./script/resize_images",
|
"resize": "npm run cleanup && ts-node ./script/resize_images",
|
||||||
|
|
|
@ -3,17 +3,14 @@ const fs = require('fs')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const Web3 = require('web3')
|
const Web3 = require('web3')
|
||||||
const web3 = new Web3('ws://localhost:8546');
|
const web3 = new Web3('ws://localhost:8546');
|
||||||
|
import { ethSidechains, readDirSync } from "../src/test/helpers"
|
||||||
|
|
||||||
const readdirSync = path => fs.readdirSync(path)
|
ethSidechains.forEach(chain => {
|
||||||
|
|
||||||
const cheinsAddressesToChecksum = ["classic", "poa", "tomochain", "gochain", "wanchain", "thundertoken", "ethereum"]
|
|
||||||
|
|
||||||
cheinsAddressesToChecksum.forEach(chain => {
|
|
||||||
const assetsPath = path.resolve(`${__dirname}/../blockchains/${chain}/assets`)
|
const assetsPath = path.resolve(`${__dirname}/../blockchains/${chain}/assets`)
|
||||||
const chainAddresses = readdirSync(assetsPath)
|
const chainAddresses = readDirSync(assetsPath)
|
||||||
|
|
||||||
chainAddresses.forEach(addr => {
|
chainAddresses.forEach(addr => {
|
||||||
isChecksum = web3.utils.checkAddressChecksum(addr)
|
const isChecksum = web3.utils.checkAddressChecksum(addr)
|
||||||
|
|
||||||
if (!isChecksum) {
|
if (!isChecksum) {
|
||||||
console.log(`Address ${addr} not in checksum`)
|
console.log(`Address ${addr} not in checksum`)
|
Loading…
Reference in New Issue
Block a user