Remove verify tokens

This commit is contained in:
Mykola 2019-11-14 01:06:26 -08:00
parent a8a7ab518a
commit 744dfbe5c8
3 changed files with 1 additions and 34 deletions

View File

@ -8,7 +8,7 @@ cache:
- "node_modules" - "node_modules"
script: script:
- '[ "$TRAVIS_PULL_REQUEST" = "false" ] && npm run verify || npm run test' - 'npm t'
git: git:
depth: 5 depth: 5

View File

@ -4,7 +4,6 @@
"description": "Assets consumed by Trust Wallet", "description": "Assets consumed by Trust Wallet",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"verify": "npm run cleanup && ts-node ./script/verifyTokens",
"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": "node ./script/updateBEP2", "update-bep2": "node ./script/updateBEP2",

View File

@ -1,32 +0,0 @@
const axios = require("axios")
const fs = require('fs')
const TRUST_API_URL = process.env.TRUST_API_URL
const TOKEN_VERIFICATION_KEY = process.env.TOKEN_VERIFICATION_KEY
const ethereumSidechains = ["ethereum", "classic", "poa", "tomochain", "gochain", "wanchain", "thundertoken"]
const addresses = []
ethereumSidechains.forEach(chain => {
addresses.push(fs.readdirSync(`./blockchains/${chain}/assets`))
})
const tokens = [].concat.apply([], addresses).map(a => a.toLowerCase())
axios.post(TRUST_API_URL, {tokens}, {
headers: {
TOKEN_VERIFICATION_KEY
}
})
.then(res => {
if (res.status !== 200) {
exitWithMsg(`Error verifying tokens`)
}
console.log(`Tokens were successfully verified`, res.data)
})
.catch(e => {
exitWithMsg(`Failed to verify tokens ${e.message}`)
})
const exitWithMsg = (msg) => {
console.log(msg)
process.exit(1)
}