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
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat: istanbul-badges-readme
AbigailDeng authored and AbigailDeng committed Apr 14, 2023
commit 96482cd7eda58e825bda0f22ff71d843fc6c5a8e
73 changes: 51 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# aelf-sdk.js - AELF JavaScript API

| Statements | Branches | Functions | Lines |
| --------------------------- | ----------------------- | ------------------------- | ----------------- |
| ![Statements](https://img.shields.io/badge/statements-99.44%25-brightgreen.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-98.85%25-brightgreen.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-99.02%25-brightgreen.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-99.41%25-brightgreen.svg?style=flat) |

[![Build Status][1]][2]

[1]: https://travis-ci.org/AElfProject/aelf-sdk.js.svg?branch=master
@@ -65,9 +69,9 @@ module.exports = {
// ...
resolve: {
alias: {
'aelf-sdk$': 'aelf-sdk/dist/aelf.umd.js'
}
}
'aelf-sdk$': 'aelf-sdk/dist/aelf.umd.js',
},
},
};
```

@@ -80,9 +84,9 @@ rollup({
// ...
plugins: [
alias({
'aelf-sdk': require.resolve('aelf-sdk/dist/aelf.umd.js')
})
]
'aelf-sdk': require.resolve('aelf-sdk/dist/aelf.umd.js'),
}),
],
});
```

@@ -95,9 +99,9 @@ module.exports = {
// ...
resolve: {
alias: {
'aelf-sdk$': 'aelf-sdk/dist/aelf.cjs.js'
}
}
'aelf-sdk$': 'aelf-sdk/dist/aelf.cjs.js',
},
},
};
```

@@ -110,9 +114,9 @@ rollup({
// ...
plugins: [
alias({
'aelf-sdk': require.resolve('aelf-sdk/dist/aelf.cjs.js')
})
]
'aelf-sdk': require.resolve('aelf-sdk/dist/aelf.cjs.js'),
}),
],
});
```

@@ -128,7 +132,9 @@ You can also see full examples in [./examples](./examples);
import AElf from 'aelf-sdk';

// create a new instance of AElf
const aelf = new AElf(new AElf.providers.HttpProvider('http://127.0.0.1:1235'));
const aelf = new AElf(
new AElf.providers.HttpProvider('http://127.0.0.1:1235')
);
```

2. Create or load a wallet with `AElf.wallet`
@@ -153,9 +159,14 @@ You can also see full examples in [./examples](./examples);
// get genesis contract address
const GenesisContractAddress = chainStatus.GenesisContractAddress;
// get genesis contract instance
const zeroContract = await aelf.chain.contractAt(GenesisContractAddress, newWallet);
const zeroContract = await aelf.chain.contractAt(
GenesisContractAddress,
newWallet
);
// Get contract address by the read only method `GetContractAddressByName` of genesis contract
tokenContractAddress = await zeroContract.GetContractAddressByName.call(AElf.utils.sha256(tokenContractName));
tokenContractAddress = await zeroContract.GetContractAddressByName.call(
AElf.utils.sha256(tokenContractName)
);
})();
```

@@ -193,7 +204,7 @@ You can also see full examples in [./examples](./examples);
// with `.call` method, `aelf-sdk` will only call read-only method
const result = await tokenContract.GetBalance.call({
symbol: 'ELF',
owner: '7s4XoUHfPuqoZAwnTV7pHWZAaivMiL8aZrDSnY9brE1woa8vz'
owner: '7s4XoUHfPuqoZAwnTV7pHWZAaivMiL8aZrDSnY9brE1woa8vz',
});
console.log(result);
/**
@@ -208,7 +219,7 @@ You can also see full examples in [./examples](./examples);
symbol: 'ELF',
to: '7s4XoUHfPuqoZAwnTV7pHWZAaivMiL8aZrDSnY9brE1woa8vz',
amount: '1000000000',
memo: 'transfer in demo'
memo: 'transfer in demo',
});
console.log(transactionId);
/**
@@ -224,7 +235,9 @@ You can also see full examples in [./examples](./examples);
```javascript
import AElf from 'aelf-sdk';

const aelf = new AElf(new AElf.providers.HttpProvider('http://127.0.0.1:1235'));
const aelf = new AElf(
new AElf.providers.HttpProvider('http://127.0.0.1:1235')
);
aelf.setProvider(new AElf.providers.HttpProvider('http://127.0.0.1:8000'));
```

@@ -568,13 +581,21 @@ Attempts to add a node to the connected network nodes
you need to create a aelf authorization instance and set a provider

```javascript
const aelf = new AElf(new AElf.providers.HttpProvider('http://127.0.0.1:8000', 8000, { Authorization: AElf.utils.getAuthorization('UseName', 'Password') }));
const aelf = new AElf(
new AElf.providers.HttpProvider('http://127.0.0.1:8000', 8000, {
Authorization: AElf.utils.getAuthorization('UseName', 'Password'),
})
);
```

_Example_

```javascript
const aelf = new AElf(new AElf.providers.HttpProvider('http://127.0.0.1:8000', 8000, { Authorization: AElf.utils.getAuthorization('aelf', '12345678') }));
const aelf = new AElf(
new AElf.providers.HttpProvider('http://127.0.0.1:8000', 8000, {
Authorization: AElf.utils.getAuthorization('aelf', '12345678'),
})
);

aelf.chain.addPeer('192.168.11.140:6801').then((res) => {
console.log(res);
@@ -588,13 +609,21 @@ Attempts to remove a node from the connected network nodes
you need to create a aelf authorization instance and set a provider

```javascript
const aelf = new AElf(new AElf.providers.HttpProvider('http://127.0.0.1:8000', 8000, { Authorization: AElf.utils.getAuthorization('UseName', 'Password') }));
const aelf = new AElf(
new AElf.providers.HttpProvider('http://127.0.0.1:8000', 8000, {
Authorization: AElf.utils.getAuthorization('UseName', 'Password'),
})
);
```

_Example_

```javascript
const aelf = new AElf(new AElf.providers.HttpProvider('http://127.0.0.1:8000', 8000, { Authorization: AElf.utils.getAuthorization('aelf', '12345678') }));
const aelf = new AElf(
new AElf.providers.HttpProvider('http://127.0.0.1:8000', 8000, {
Authorization: AElf.utils.getAuthorization('aelf', '12345678'),
})
);

aelf.chain.removePeer('192.168.11.140:6801').then((res) => {
console.log(res);
1 change: 1 addition & 0 deletions jest.browser.config.js
Original file line number Diff line number Diff line change
@@ -48,6 +48,7 @@ module.exports = {
// ],

// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: ['json-summary'],
// coverageReporters: [
// "json",
// "text",
1 change: 1 addition & 0 deletions jest.node.config.js
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@ module.exports = {
// ],

// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: ['json-summary'],
// coverageReporters: [
// "json",
// "text",
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -92,6 +92,7 @@
"git-cz": "^3.0.1",
"glob": "^7.1.4",
"husky": "^3.0.0",
"istanbul-badges-readme": "^1.8.5",
"jest": "^29.4.1",
"jest-environment-jsdom": "^29.4.3",
"jest-environment-jsdom-fifteen": "^1.0.2",
@@ -109,7 +110,7 @@
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"pre-commit": "lint-staged && istanbul-badges-readme && git add 'README.md'",
"commit-msg": "node scripts/verify-commit-msg.js"
}
},
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -6308,6 +6308,11 @@ isstream@~0.1.2:
resolved "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==

istanbul-badges-readme@^1.8.5:
version "1.8.5"
resolved "https://registry.npmmirror.com/istanbul-badges-readme/-/istanbul-badges-readme-1.8.5.tgz#60ad443a5bf71493bd4a6088a65d1a3739058510"
integrity sha512-VEh90ofuufPZIbLeDF2g14wpe0sebhirG0xHooYKpNPYOkGXm6y+HJFotQqIzCg0NmbCnlKnOPL1B2oxG7/piA==

istanbul-lib-coverage@^2.0.5:
version "2.0.5"
resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49"