Checksum script (#1263)

* Add @types/node

* Add checksum script

* Update azl pipeline

* Update map

* Optimised images with calibre/image-actions

* Omit checkout

* remove

* Recreate with exectute permission

* Add lovercase for tsting script

* Change to chmod 700

* run with sudo

* run with sudo

* Use SYSTEM_PULLREQUEST_SOURCEBRANCH var to get branch name

* Use Bash task

* Checksum ERC20 addresses [skip ci]

* Add in lowercase for testing

* Checksum ERC20 addresses [skip ci]

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Mykola 2020-02-18 18:00:11 -08:00 committed by GitHub
parent cb6731d466
commit 3ac372ecf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 120 additions and 63 deletions

View File

@ -1,25 +1,55 @@
trigger:
- master
- master
pool:
vmImage: 'ubuntu-latest'
vmImage: 'ubuntu-latest'
variables:
npm_config_cache: '$(Pipeline.Workspace)/.npm'
npm_config_cache: '$(Pipeline.Workspace)/.npm'
steps:
- task: NodeTool@0
inputs:
versionSpec: '12.x'
displayName: Install Node.js
- checkout: self
persistCredentials: true
# - task: CmdLine@2
# displayName: Checkout $(Build.SourceBranchName)
# inputs:
# script: 'git checkout $(Build.SourceBranchName)'
- script: npm install
displayName: Install project dependencies
- task: NodeTool@0
inputs:
versionSpec: '12.x'
displayName: Install Node.js
- script: |
sudo npm install -g typescript
sudo npm install -g ts-node
displayName: Install global dependency
- task: Npm@1
inputs:
command: install
verbose: true
displayName: Install dependencies
# - task: Cache@2
# inputs:
# key: 'npm | "$(Agent.OS)" | package-lock.json'
# path: $(npm_config_cache)
# displayName: Cache npm
- script: |
git config --global user.email "bot@trustwallet.com"
git config --global user.name "TrustWalletBot"
- task: Cache@2
inputs:
key: 'npm | "$(Agent.OS)" | package-lock.json'
path: $(npm_config_cache)
displayName: Cache npm
- script: sudo npm run checksum-erc20
workingDirectory: $(Build.SourcesDirectory)
displayName: Run checksum script
- script: npm t
- task: Bash@3
displayName: Commit result of checksum script
inputs:
targetType: filePath
filePath: ./script/commit.sh
- script: npm t
displayName: Run tests

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

31
package-lock.json generated
View File

@ -643,10 +643,9 @@
}
},
"@types/node": {
"version": "12.12.11",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.11.tgz",
"integrity": "sha512-O+x6uIpa6oMNTkPuHDa9MhMMehlxLAd5QcOvKRjAFsBVpeFWTOPnXbDvILvFgFFZfQ1xh1EZi1FbXxUix+zpsQ==",
"dev": true
"version": "13.7.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.7.1.tgz",
"integrity": "sha512-Zq8gcQGmn4txQEJeiXo/KiLpon8TzAl0kmKH4zdWctPj05nWwp1ClMdAVEloqrQKfaC48PNLdgN/aVaLqUrluA=="
},
"@types/stack-utils": {
"version": "1.0.1",
@ -8712,6 +8711,14 @@
"web3-net": "1.2.4",
"web3-shh": "1.2.4",
"web3-utils": "1.2.4"
},
"dependencies": {
"@types/node": {
"version": "12.12.27",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.27.tgz",
"integrity": "sha512-odQFl/+B9idbdS0e8IxDl2ia/LP8KZLXhV3BUeI98TrZp0uoIzQPhGd+5EtzHmT0SMOIaPd7jfz6pOHLWTtl7A==",
"dev": true
}
}
},
"web3-bzz": {
@ -8747,6 +8754,14 @@
"web3-core-method": "1.2.4",
"web3-core-requestmanager": "1.2.4",
"web3-utils": "1.2.4"
},
"dependencies": {
"@types/node": {
"version": "12.12.27",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.27.tgz",
"integrity": "sha512-odQFl/+B9idbdS0e8IxDl2ia/LP8KZLXhV3BUeI98TrZp0uoIzQPhGd+5EtzHmT0SMOIaPd7jfz6pOHLWTtl7A==",
"dev": true
}
}
},
"web3-core-helpers": {
@ -8933,6 +8948,14 @@
"web3-core-method": "1.2.4",
"web3-net": "1.2.4",
"web3-utils": "1.2.4"
},
"dependencies": {
"@types/node": {
"version": "12.12.27",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.27.tgz",
"integrity": "sha512-odQFl/+B9idbdS0e8IxDl2ia/LP8KZLXhV3BUeI98TrZp0uoIzQPhGd+5EtzHmT0SMOIaPd7jfz6pOHLWTtl7A==",
"dev": true
}
}
},
"web3-net": {

View File

@ -54,7 +54,9 @@
"typescript": "^3.7.5",
"web3": "^1.2.4"
},
"dependencies": {},
"dependencies": {
"@types/node": "^13.7.1"
},
"jest": {
"setupFilesAfterEnv": [
"jest-expect-message"

View File

@ -500,12 +500,6 @@
"type": "coin",
"id": 1141
},
{
"coin": 60,
"type": "token",
"token_id": "0xAef38fBFBF932D1AeF3B808Bc8fBd8Cd8E1f8BC5",
"id": 1153
},
{
"coin": 42,
"type": "coin",
@ -666,6 +660,12 @@
"type": "coin",
"id": 1464
},
{
"coin": 60,
"type": "token",
"token_id": "0x92E78dAe1315067a8819EFD6dCA432de9DCdE2e9",
"id": 1465
},
{
"coin": 197,
"type": "coin",
@ -1574,12 +1574,6 @@
"token_id": "0xc42209aCcC14029c1012fB5680D95fBd6036E2a0",
"id": 2036
},
{
"coin": 60,
"type": "token",
"token_id": "0xEA610B1153477720748DC13ED378003941d84fAB",
"id": 2040
},
{
"coin": 177,
"type": "coin",
@ -3426,12 +3420,6 @@
"token_id": "0x5102791cA02FC3595398400BFE0e33d7B6C82267",
"id": 2580
},
{
"coin": 60,
"type": "token",
"token_id": "0xEF2463099360a085f1f10b076Ed72Ef625497a06",
"id": 2581
},
{
"coin": 60,
"type": "token",
@ -3492,12 +3480,6 @@
"token_id": "0x6Ba460AB75Cd2c56343b3517ffeBA60748654D26",
"id": 2597
},
{
"coin": 60,
"type": "token",
"token_id": "0x35a69642857083BA2F30bfaB735dacC7F0bac969",
"id": 2598
},
{
"coin": 60,
"type": "token",
@ -4218,12 +4200,6 @@
"type": "coin",
"id": 2773
},
{
"coin": 60,
"type": "token",
"token_id": "0xEcE83617Db208Ad255Ad4f45Daf81E25137535bb",
"id": 2774
},
{
"coin": 60,
"type": "token",
@ -5247,12 +5223,6 @@
"token_id": "0x832904863978b94802123106e6eB491BDF0Df928",
"id": 3101
},
{
"coin": 60,
"type": "token",
"token_id": "0x02F2D4a04E6E01aCE88bD2Cd632875543b2eF577",
"id": 3106
},
{
"coin": 60,
"type": "token",
@ -8533,12 +8503,6 @@
"token_id": "0xe577e0B200d00eBdecbFc1cd3F7E8E04C70476BE",
"id": 4109
},
{
"coin": 60,
"type": "token",
"token_id": "0x2D153f2aDCCbe9364F9e4eD5843308AbD0bF93dA",
"id": 4111
},
{
"coin": 60,
"type": "token",
@ -10045,6 +10009,12 @@
"type": "coin",
"id": 5127
},
{
"coin": 60,
"type": "token",
"token_id": "0xce9e84a26Ddb9E2283De164F7eD595E0D27E32b3",
"id": 5133
},
{
"coin": 60,
"type": "token",
@ -10080,6 +10050,18 @@
"token_id": "WRX-ED1",
"id": 5161
},
{
"coin": 60,
"type": "token",
"token_id": "0x14409B0Fc5C7f87b5DAd20754fE22d29A3dE8217",
"id": 5169
},
{
"coin": 60,
"type": "token",
"token_id": "0xc962ad021a69D457564e985738C719aE3f79B707",
"id": 5170
},
{
"coin": 60,
"type": "token",
@ -10127,5 +10109,11 @@
"type": "token",
"token_id": "0x70da48f4B7e83c386ef983D4CEF4e58c2c09D8Ac",
"id": 5220
},
{
"coin": 60,
"type": "token",
"token_id": "0x02b1669bC9EE893edAFf3cADfD326A294d643f99",
"id": 5232
}
]

View File

@ -39,6 +39,7 @@ const custom: mapTiker[] = [
{"coin": 60, "type": typeToken, "token_id": "0x2fe39f22EAC6d3c1C86DD9D143640EbB94609FCE", "id": 4929}, // JDC Coin ERC20
{"coin": 60, "type": typeToken, "token_id": "0xdfbc9050F5B01DF53512DCC39B4f2B2BBaCD517A", "id": 4287}, // new Jobchain (JOB)
{"coin": 60, "type": typeToken, "token_id": "0x5Cf04716BA20127F1E2297AdDCf4B5035000c9eb", "id": 2780}, // NKN (NKN)
{"coin": 714, "type": typeToken, "token_id": "CHZ-ECD", "id": 4066}, // Chilz (BEP-2)
]
const permanentRemove = [

14
script/commit.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
if [[ `git status --porcelain --untracked-files=no` ]]; then
git add .
git commit -m "Checksum ERC20 addresses [skip ci]"
echo Current branch
echo Pushing changes to branch: "$SYSTEM_PULLREQUEST_SOURCEBRANCH"
echo Current branch $(git branch)
git status
git push origin HEAD:"$SYSTEM_PULLREQUEST_SOURCEBRANCH"
echo Complete
else
echo "Nothing to commit"
fi

View File

@ -1,5 +1,4 @@
const { execSync } = require('child_process');
const fs = require('fs')
const path = require('path')
const Web3 = require('web3')
const web3 = new Web3('ws://localhost:8546');