Move checksum script to ts

This commit is contained in:
Mykola 2020-01-19 21:34:25 -08:00
parent 5c56f3fb2f
commit 048b941bf4
2 changed files with 5 additions and 8 deletions

View File

@ -8,7 +8,7 @@
"test": "npm run cleanup && jest",
"cleanup": "find ./.. -iname '.DS_Store' -type f -delete",
"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",
"gen:info": "ts-node ./script/gen_info",
"resize": "npm run cleanup && ts-node ./script/resize_images",

View File

@ -3,17 +3,14 @@ const fs = require('fs')
const path = require('path')
const Web3 = require('web3')
const web3 = new Web3('ws://localhost:8546');
import { ethSidechains, readDirSync } from "../src/test/helpers"
const readdirSync = path => fs.readdirSync(path)
const cheinsAddressesToChecksum = ["classic", "poa", "tomochain", "gochain", "wanchain", "thundertoken", "ethereum"]
cheinsAddressesToChecksum.forEach(chain => {
ethSidechains.forEach(chain => {
const assetsPath = path.resolve(`${__dirname}/../blockchains/${chain}/assets`)
const chainAddresses = readdirSync(assetsPath)
const chainAddresses = readDirSync(assetsPath)
chainAddresses.forEach(addr => {
isChecksum = web3.utils.checkAddressChecksum(addr)
const isChecksum = web3.utils.checkAddressChecksum(addr)
if (!isChecksum) {
console.log(`Address ${addr} not in checksum`)