Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/test chain util #190

Merged
merged 175 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
175 commits
Select commit Hold shift + click to select a range
39b4c6d
feat: wallet typing
Jan 3, 2023
7dc9419
feat: change to types
Jan 3, 2023
1822b82
feat: chain types
Jan 11, 2023
2cce34a
feat: add ts
Jan 13, 2023
4daab66
feat: util d.ts
Jan 18, 2023
06b8081
feat: fix test
Jan 31, 2023
29f6736
feat: merge ts
Jan 31, 2023
8211fad
feat: merge master
Feb 3, 2023
8a44e6b
feat: upgrade jest
Feb 3, 2023
2cadf00
feat: chain util test
Feb 27, 2023
c0bf1ea
feat: transform bloom
Mar 1, 2023
773171a
feat: chain.test.js
Mar 2, 2023
a2ee5ed
feat: chainMethod
Mar 3, 2023
8fe1586
feat: utils test
Mar 6, 2023
f646557
feat: test proto httpProvider
Mar 9, 2023
152b6cd
feat: test
Mar 10, 2023
1609c8b
feat: test utils
Mar 13, 2023
87995c8
feat: transform
Mar 15, 2023
5978c6e
feat: rewire
Mar 16, 2023
af44292
feat: keccak
Mar 17, 2023
11bb00c
feat: httpProvider
Mar 20, 2023
879808c
feat: add deprecated
Mar 20, 2023
c06678b
feat: keccak
Mar 21, 2023
045b833
feat: contract method
Apr 4, 2023
d9617d2
feat: wallet
Apr 11, 2023
dc999b0
feat: contract index
Apr 12, 2023
35cc241
feat: delete hash
Apr 12, 2023
dadfc99
feat: fix chainMethod cross origin problem
Apr 13, 2023
1d00e7a
feat: add jest-github-reporter
Apr 13, 2023
c3aeecc
feat: script
Apr 13, 2023
97dc3eb
feat: exclude
Apr 13, 2023
0113e5d
feat: ci cd test
Apr 13, 2023
fe26118
feat: tests
Apr 13, 2023
fe64070
feat: jest
Apr 13, 2023
290cf72
feat: upper case
Apr 13, 2023
72f412f
feat: ci
Apr 13, 2023
86561d6
feat: reports dir
Apr 13, 2023
ca485f2
feat: httpProvider-node
Apr 14, 2023
3adfaa2
feat: comment with Test Coverage
Apr 14, 2023
96482cd
feat: istanbul-badges-readme
Apr 14, 2023
d0c6846
feat: 'json-summary'
Apr 14, 2023
c2077c3
feat: coverageReporters
Apr 14, 2023
8ff569f
feat: jest-coverage-commenter-action@v1
Apr 14, 2023
b9fb403
feat: delete dependency
Apr 14, 2023
7b802fe
feat: delete readme
Apr 17, 2023
50a669f
feat: jest coverage diff
Apr 17, 2023
acbe989
feat: ci
Apr 17, 2023
115cc21
feat: delete ci
Apr 17, 2023
defa992
feat: yarn run test:coverage
Apr 17, 2023
0ddf36d
feat: install
Apr 17, 2023
872cb77
feat: jest coverage diff
Apr 17, 2023
9b67d8b
feat: jest coverage diff
Apr 17, 2023
4c8a646
feat: jest coverage diff
Apr 17, 2023
355e942
feat: coverage Diff
Apr 17, 2023
f0b735a
feat: base-summary.json
Apr 17, 2023
297a432
feat: coverage Diff
Apr 17, 2023
918e2a3
feat: revert
Apr 17, 2023
41e2ede
feat: update .gitignore
Apr 19, 2023
27dd871
feat: change readme
Apr 19, 2023
eae0f4a
test: 💍 upgrade dependencies
Apr 23, 2023
fa94278
feat: 🎸 test
Apr 23, 2023
73133e3
test: 💍 console
Apr 23, 2023
34dc594
feat: test
Apr 23, 2023
9f2b846
feat: husky upgrade
Apr 23, 2023
121c1ae
feat: husky upgrade
Apr 23, 2023
ee9c6e1
feat: commit-msg
Apr 23, 2023
c911d97
feat: webpack update
Apr 23, 2023
a71a50f
feat: delete useless code
Apr 24, 2023
b51641f
feat: change registry
Apr 24, 2023
0bde829
feat: lower node
Apr 25, 2023
e9dac66
feat: node version
Apr 25, 2023
c5801ad
feat: delete aelf.umd.js.LICENSE.txt
Apr 25, 2023
0c8917d
feat: change pre-commit
Apr 27, 2023
ff72bb5
feat: [email protected]
May 5, 2023
2a93d4f
Update test.yml
AbigailDeng Aug 30, 2023
a5fb22e
feat: test
Aug 30, 2023
aad7900
fix: 🐛 sha256 incorrect in google chrome
potter-sun Aug 30, 2023
5b1c87f
feat: workflow
Aug 30, 2023
d37a7b0
feat: workflow
Aug 30, 2023
9528b0f
feat: workflow
Aug 30, 2023
3fe441d
feat: workflow
Aug 30, 2023
93d96ed
feat: workflow
Aug 30, 2023
ebde628
feat: delete workflow for external pr
Aug 30, 2023
2c68f25
feat: delete workflow for external pr
Aug 30, 2023
a87774c
feat: delete workflow for external pr
Aug 30, 2023
64592b1
refactor: 💡 merge from feature/test-chain-util-workflow
potter-sun Aug 30, 2023
f1a779c
Merge pull request #123 from potter-sun/fix/sha256
AbigailDeng Aug 30, 2023
c9cb5b1
feat: revert workflow for external pr
Aug 30, 2023
5ff62ea
feat: revert workflow for external pr
Aug 30, 2023
e213f61
Merge branch 'feature/test-chain-util' of https://github.com/AElfProj…
Aug 30, 2023
0960945
feat: revert workflow
Aug 30, 2023
4c5b0fa
feat: change workflow
Aug 30, 2023
c74401d
feat: change workflow
Aug 30, 2023
7dff7e3
feat: change workflow
Aug 30, 2023
46532d8
feat: change workflow
Aug 30, 2023
8d90d25
Merge pull request #126 from AElfProject/feature/test-chain-util-work…
AbigailDeng Aug 30, 2023
7e330a5
feat: fix when arg is undefined
Sep 18, 2023
46f7cac
feat: add babel plugin
Sep 18, 2023
3958241
fix: 🐛 transformArrayToMap fieldsArray may undefined
lhoopox Sep 19, 2023
b617162
feat: delete workflow coverage
Sep 19, 2023
aa511e5
Merge pull request #129 from lhoopox/fix/support-enum-array
AbigailDeng Sep 19, 2023
1c8907b
feat: revert workflow
Sep 19, 2023
4a72eeb
feat: merge
Sep 19, 2023
36d0b33
Merge pull request #130 from AElfProject/feature/test-chain-util-work…
AbigailDeng Sep 19, 2023
c383265
feat: node version
Oct 23, 2023
fccb2b3
feat: node version
Oct 23, 2023
f66e315
feat: delete odd
Oct 24, 2023
07ec600
feat: add chain methods
Oct 25, 2023
c3c77f0
feat: fix ts
Oct 26, 2023
5d0a430
feat: name realPeerEndpoint
Oct 26, 2023
3715191
feat: httpProvider test
Oct 27, 2023
2475ac5
feat: ts fix
Oct 27, 2023
1e1a06d
feat: add files
Oct 30, 2023
ede90ff
feat: merge
Oct 30, 2023
d30bc3f
feat: merge update
Oct 30, 2023
3f0293c
feat: iWallet
Oct 30, 2023
898f938
feat: aws-crypto/[email protected]: The engine "node" Expected version …
Oct 31, 2023
c06d462
feat: add semantic type
Nov 14, 2023
4c43b29
feat: tChainId
Nov 14, 2023
a83c03c
feat: sha256
Dec 1, 2023
164db15
feat: types name
Dec 6, 2023
b81382d
feat: gitignore
Dec 7, 2023
b25b6c5
feat: add verify
Dec 29, 2023
8f39fb2
Merge pull request #136 from AElfProject/feature/test-chain-util-verify
hzz780 Jan 3, 2024
8ca7d8c
feat: change test
Jan 3, 2024
a2f2747
feat: delete useless
Jan 3, 2024
f4b16ab
Merge pull request #138 from AElfProject/feature/test-chain-util-verify
hzz780 Jan 3, 2024
e8e51ed
feat: crypto-js
Jan 8, 2024
95cada6
Merge pull request #139 from AElfProject/feature/test-chain-util-crypto
hzz780 Jan 9, 2024
91586f1
feat: fix type
Jan 11, 2024
eb1f599
feat: pull
Jan 11, 2024
22abcf4
feat: pubKey deprecatedParam
Feb 26, 2024
d3457c1
Merge pull request #141 from AElfProject/feature/test-chain-util-verify
hzz780 Feb 26, 2024
389c049
feat: virtualTransactionCreated
May 8, 2024
f3a2a76
feat: normal contract
May 8, 2024
19894c5
feat: logs
May 8, 2024
bb73d55
feat: proto
May 9, 2024
edbd29f
feat: proto
May 9, 2024
f0be18a
feat: deserializeLog
May 9, 2024
269d5e8
feat: console delete
May 9, 2024
6a62607
feat: if dataType cannot be found and also is not VirtualTransactionC…
May 9, 2024
ebc00b7
feat: change fn name
May 10, 2024
328bf65
feat: unit test
May 10, 2024
eeaaa32
Merge pull request #149 from AElfProject/feature/test-chain-util-dese…
hzz780 May 10, 2024
23091b1
feat: proto -> json
May 10, 2024
ec96a9f
Merge pull request #152 from AElfProject/feature/test-chain-util-dese…
hzz780 May 10, 2024
fc2e44c
feat: add address length check
May 22, 2024
097da78
feat: add base58 error
May 22, 2024
68d67e3
Merge pull request #154 from AElfProject/feature/test-chain-util-addr…
hzz780 May 22, 2024
70c07fa
feat: 🎸 node, use node-fetch instead of xmlhttprequest
hzz780 Jun 20, 2024
645250e
Merge pull request #159 from AElfProject/feature/node-fetch-test
hzz780 Jun 21, 2024
bc3de0d
fix: 🐛 sync, XMLHttp error
hzz780 Jun 21, 2024
1c290a4
feat: add jest config
Jun 21, 2024
5a61939
Merge pull request #161 from AElfProject/feature/node-fetch-test
hzz780 Jun 21, 2024
4148544
feat: merge master, fix conflict
Jun 24, 2024
3cb69fe
feat: fix conflict
Jun 24, 2024
5a9c028
feat: add lock
Jun 24, 2024
a195d31
Merge pull request #166 from AElfProject/feature/test-chain-mergeMaster
hzz780 Jun 24, 2024
857060d
feat: fix webpack v5 options
Jul 4, 2024
b896052
feat: fix webpack v5 options
Jul 4, 2024
556f6ac
feat: fix umd
Jul 4, 2024
29da5c6
feat: remove process
Jul 4, 2024
ca686b5
Merge pull request #176 from AElfProject/feature/test-chain-util-fix
hzz780 Jul 5, 2024
bf2b61e
feat: test-badge
aelf-lxy Aug 13, 2024
d8c5492
Merge pull request #183 from AElfProject/feature/test-chain-util-lxy
AbigailDeng Aug 13, 2024
e785773
Resolved conflict
rutvikghaskata18 Aug 14, 2024
7fdc987
feat(test): add new test cases
RutvikGhaskataEalf Aug 14, 2024
5015015
feat: headers
Aug 20, 2024
e7d8303
feat: fix conflict
Aug 20, 2024
a921109
Merge pull request #185 from AElfProject/feature/test-headers
hzz780 Aug 21, 2024
f75be64
feat: extract endpoint
Aug 21, 2024
f832e20
Merge pull request #188 from AElfProject/feature/test-endPoint
hzz780 Aug 21, 2024
13b0c05
feat: delete istanbul-badges-readme
Aug 22, 2024
45403fb
feat: delete console
Aug 22, 2024
4bf7d78
Merge pull request #189 from AElfProject/feature/test-rest
hzz780 Aug 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,28 @@
[
"@babel/preset-env",
{
"useBuiltIns": "usage",
"corejs": 3,
"modules": false,
"targets": "> 1%, not dead"
"targets": "> 0.5%, last 2 versions, Firefox ESR, not dead"
}
]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-runtime"
],
"ignore": [
"dist/*.js"
],
"ignore": ["dist/*.js"],
"env": {
"test": {
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "usage",
"corejs": 3,
"modules": "auto"
}
]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-runtime"
],
"ignore": [
"dist/*.js"
]
"plugins": ["rewire"],
"ignore": ["dist/*.js"]
}
}
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ jest.browser.config.js
jest.node.config.js
examples
test
types
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"root": true,
"parser": "babel-eslint",
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Unit Test Coverage

on:
push:
branches:
- feature/test-chain-util
pull_request:
branches:
- feature/test-chain-util

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install dependencies
run: yarn install

- name: Run tests with coverage
run: yarn run test:coverage

- name: Generate coverage badge
uses: jaywcjlove/coverage-badges-cli@main
with:
source: coverage/coverage-summary.json
output: coverage/badges.svg

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./coverage
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ jobs:
with:
node-version: 16

- name: Install and Build
- name: Install, Test and Build
run: |
yarn install
yarn run test
yarn run build

- name: Publish to npm
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish
env:
CI: true
on:
push:
branches:
- feature/test-chain-util
tags:
- '!*'
jobs:
release:
name: Setup
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
registry-url: 'https://npm.pkg.github.com'

- name: Install dependencies
run: yarn install

- name: Publish to npm
run: |
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
npm publish || (echo "pnpm publish failed" && exit 1)
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108 changes: 108 additions & 0 deletions .github/workflows/test-badge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Test Badge

permissions:
contents: write

on:
push:
branches:
- dev
- master
- feature/test-chain-util

env:
BRANCH_NAME: 'feature/badge-json'

jobs:
test:
name: Generate Test Badge
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 20
cache: yarn
- run: yarn install
- run: yarn run test:browser
- name: Install xmlstarlet
run: |
sudo apt-get update
sudo apt-get install -y xmlstarlet
- name: Extract test counts
run: |
echo "TESTS=$(xmlstarlet sel -t -v "testsuites/@tests" "jest-report.xml")" >> $GITHUB_ENV
echo "FAILURES=$(xmlstarlet sel -t -v "testsuites/@failures" "jest-report.xml")" >> $GITHUB_ENV
echo "ERRORS=$(xmlstarlet sel -t -v "testsuites/@errors" "jest-report.xml")" >> $GITHUB_ENV
- name: Set file name
run: echo "FILENAME=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '-')-test-results.json" >> $GITHUB_ENV

- name: Prepare Content
uses: actions/github-script@v5
with:
github-token: ${{ secrets.COMMIT_TOKEN }}
script: |
const fs = require('fs');
const tests = "${{ env.TESTS }}";
const failures = "${{ env.FAILURES }}";
const errors = "${{ env.ERRORS }}";
const success = tests - failures;
const color = errors > 0 ? "red" : (failures > 0 ? "green" : "brightgreen");
const content = `{"schemaVersion":1,"label":"tests","message":"${tests} tests, ${success} success","color":"${color}"}`;
fs.writeFileSync("${{ env.FILENAME }}", content);
- name: Check if file exists
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
let fileExists = false;
try {
const { data } = await github.rest.repos.getContent({
owner: context.repo.owner,
repo: context.repo.repo,
path: "${{ env.FILENAME }}",
ref: "${{ env.BRANCH_NAME }}",
});
fileExists = !!data;
} catch (error) {
if (error.status !== 404) {
throw error;
}
}
core.exportVariable('FILE_EXISTS', fileExists);
- name: Create or update file
uses: actions/github-script@v5
with:
github-token: ${{ secrets.COMMIT_TOKEN }}
script: |
const fs = require('fs');
const path = require('path');
const filePath = path.join(process.env.GITHUB_WORKSPACE, "${{ env.FILENAME }}");
const fileContent = fs.readFileSync(filePath, 'utf8');
const params = {
owner: context.repo.owner,
repo: context.repo.repo,
path: "${{ env.FILENAME }}",
message: `Update ${{ env.FILENAME }}`,
content: Buffer.from(fileContent).toString('base64'),
branch: "${{ env.BRANCH_NAME }}"
};
if (${{ env.FILE_EXISTS }}) {
const { data } = await github.rest.repos.getContent({
owner: context.repo.owner,
repo: context.repo.repo,
path: "${{ env.FILENAME }}",
ref: "${{ env.BRANCH_NAME }}"
});
params.sha = data.sha;
}
await github.rest.repos.createOrUpdateFileContents(params);
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Coverage Diff

on:
push:
branches:
- master
pull_request: {}

jobs:
test:
name: Coverage Diff
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
- run: yarn install
- run: yarn run test:coverage
- name: Coverage Diff
uses: greatwizard/coverage-diff-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 9 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,13 @@ typings/

### VisualStudioCode template
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

**.node-xmlhttprequest-*
**.node-xmlhttprequest-*

# macOS DS_Store files
.DS_Store

.vscode
aelf.umd.js.LICENSE.txt

dist
3 changes: 3 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
HUSKY_GIT_PARAMS=$1 node scripts/verify-commit-msg.js
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn run pre-commit
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
42 changes: 0 additions & 42 deletions .vscode/launch.json

This file was deleted.

Loading
Loading