mirror of
https://github.com/Instadapp/trustwallet-assets.git
synced 2024-07-29 22:37:31 +00:00
Remove verify tokens
This commit is contained in:
parent
a8a7ab518a
commit
744dfbe5c8
|
@ -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
|
|
@ -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",
|
||||||
|
|
|
@ -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)
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user