Skip to content

Commit bfde2d4

Browse files
rg911fboucquezdgarcia360decentraliserTravis CI User
authored
v0.18.0 Release (#543)
* Post Release (#519) * v0.17.4 (#514) * Created `network` folder for network models * Fixed lint after files moved * Applied openAPI 0.8.7 changes * Added tests * Use UInt64 in retalFees * Fixed #455 Make namespace max depth configurable in idGenerator * - Fixed parser bug - Use rest json payload for unit testing * restored removed tests to cover models * Working on travis release process and ts-doc github deployments * Simplfied BlockHttp Added BlockHttp unit tests Changed travis to just report coveralls from one job * fixed travis * Uploading multiple versions of ts-docs into git hub pages * Improved ChainHttp, added unit tests * Removed maxDepth. Let server run the validation * Added unit tests * FIxed #493 * Added tests * useQuerystring on all https * Fixed github token env variable name Added escape skip flag to avoid republishing the same version Added missing git commit . after version increase * Update README links * Update README.md * Update release.sh * Update README.md * Installing typescript globally * Improved MetadataHttp, added unit tests * fixed #495 * Fixed #501 * fixed #503 * Refactored MosaicService unit test (#510) * Fixed #509 * Added mosaicHttp unit tests * Refactored mosaicHttp to use abstract caller * Add error trapping unit test * removed unused error catcher * add SimpleWallet.toDTO, fixes #504 (#508) * add SimpleWallet.toDTO, fixes #504 * add word2ua test * Update README.md (#512) * v0.17.4 release (#513) * v0.17.4 release * Updated md table header Co-authored-by: Fernando Boucquez <[email protected]> Co-authored-by: David Garcia <[email protected]> Co-authored-by: Decentraliser <[email protected]> * Trigger release build Co-authored-by: Fernando Boucquez <[email protected]> Co-authored-by: David Garcia <[email protected]> Co-authored-by: Decentraliser <[email protected]> * Post release (#520) * v0.17.4 (#514) * Created `network` folder for network models * Fixed lint after files moved * Applied openAPI 0.8.7 changes * Added tests * Use UInt64 in retalFees * Fixed #455 Make namespace max depth configurable in idGenerator * - Fixed parser bug - Use rest json payload for unit testing * restored removed tests to cover models * Working on travis release process and ts-doc github deployments * Simplfied BlockHttp Added BlockHttp unit tests Changed travis to just report coveralls from one job * fixed travis * Uploading multiple versions of ts-docs into git hub pages * Improved ChainHttp, added unit tests * Removed maxDepth. Let server run the validation * Added unit tests * FIxed #493 * Added tests * useQuerystring on all https * Fixed github token env variable name Added escape skip flag to avoid republishing the same version Added missing git commit . after version increase * Update README links * Update README.md * Update release.sh * Update README.md * Installing typescript globally * Improved MetadataHttp, added unit tests * fixed #495 * Fixed #501 * fixed #503 * Refactored MosaicService unit test (#510) * Fixed #509 * Added mosaicHttp unit tests * Refactored mosaicHttp to use abstract caller * Add error trapping unit test * removed unused error catcher * add SimpleWallet.toDTO, fixes #504 (#508) * add SimpleWallet.toDTO, fixes #504 * add word2ua test * Update README.md (#512) * v0.17.4 release (#513) * v0.17.4 release * Updated md table header Co-authored-by: Fernando Boucquez <[email protected]> Co-authored-by: David Garcia <[email protected]> Co-authored-by: Decentraliser <[email protected]> * Trigger release build * Creating new version 0.17.5 Co-authored-by: Fernando Boucquez <[email protected]> Co-authored-by: David Garcia <[email protected]> Co-authored-by: Decentraliser <[email protected]> Co-authored-by: Travis CI User <[email protected]> * LockHashAlgorithm (#522) * Fixed #518 - Added LockHashUtils - Removed Op_Keccak_256 algorithm - Renamed HashType to LockHashAlgorithm - Renamed model field name to be aligned with Catbuffer * Fixed #521 * - Added Hash method with algorithm input - Added unit tests - Added export * Added networkCurrency resolver for e2e tests (#529) * Fixed #523 - Added networkCurrency resolver for e2e tests * trigger travis * Removed metadata size validation (#527) * Fixed #526 - Removed metadata size validation * Added unit tests for coverage * added unit tests * improved coverage * Added check on Account.signData and PublicAccount.verifySignature for hexadecimal (#528) * Fixed #252 - Added check on Account.signData and PublicAccount.verifySignature for hexadecimal * trigger travis * Added isHexadecimal argument to account.signData and publicAccount.verifySignature * Fixed #525 * Removed unused condition * refactored signData and verifySignature * Prettier - ESLint (#531) * eslint and prettier * working on eslint * working on eslint * fixed travis * rolled back md changes * Added unit tests * improved NamespaceHttp * Fixed eslint warnings (#538) * Fixed #535 * Fixed #536 * maxFee in Aggregate transactions (#539) * Fixed #533 - Added setMaxFeeForAggregate - Changed setMaxFee for stand alone tx only - Addes getMaxCosignatures - Added getNetworkMaxCosignaturesPerAggregate * Fixed typo * Fixe typo * Fixed PR review comments * Added tests * Fixed #507 (#541) * upgrade crypto-js to v4.0.0, add AESEncryptionService and apply it to SimpleWallet, fixes #524 (#530) * upgrade crypto-js to v4.0.0, add AESEncryptionService and apply it to SimpleWallet, fixes #524 * remove passwordToPrivateKey, rename toMobileKey by encryptPBKDF2 * accept string as password in AESEncryptionService * remove unused functions in Crypto, merge AES Encryption service into Crypto Co-authored-by: Steven Liu <[email protected]> * Alias resolution for accountHttp (#540) * Fixed #499 - Added AccountService * Fixed e2e tests * Fixed lints * Fixed years * another year fix * Chaned to use address array and reduce rest calls * handle empty array * Fixed typos * more typo fix * Fixed function name * v0.18.0 release Co-authored-by: Fernando Boucquez <[email protected]> Co-authored-by: David Garcia <[email protected]> Co-authored-by: Decentraliser <[email protected]> Co-authored-by: Travis CI User <[email protected]>
1 parent fcf67e6 commit bfde2d4

File tree

339 files changed

+11097
-9051
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

339 files changed

+11097
-9051
lines changed

.eslintrc.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
3+
extends: [
4+
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
5+
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
6+
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
7+
],
8+
parserOptions: {
9+
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
10+
sourceType: 'module', // Allows for the use of imports
11+
},
12+
rules: {
13+
'@typescript-eslint/no-non-null-assertion': 'off',
14+
'@typescript-eslint/interface-name-prefix': 'off',
15+
'@typescript-eslint/camelcase': 'off',
16+
// TODO fix all the warnings
17+
'@typescript-eslint/no-explicit-any': 'off',
18+
},
19+
};

.github/issue_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
2. Steps to reproduce the problem.
44

5-
3. Specifications like the version of the project, operating system, or hardware.
5+
3. Specifications like the version of the project, operating system, or hardware.
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 NEM
2+
* Copyright 2020 NEM
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,9 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
export enum WalletAlgorithm {
18-
Pass_6k = 1,
19-
Pass_bip32 = 2,
20-
Pass_enc = 4,
21-
Trezor = 3,
22-
}
17+
module.exports = {
18+
semi: true,
19+
trailingComma: "all",
20+
singleQuote: true,
21+
printWidth: 140,
22+
tabWidth: 4
23+
};

.travis.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
11
language: node_js
22
node_js:
3-
- "8"
4-
- "9"
53
- "10"
4+
- "12"
65
cache:
76
directories:
87
- "node_modules"
8+
- .eslintcache
99
before_script:
1010
- npm run build
11+
- if [ "$TRAVIS_NODE_VERSION" = "10" ] || [ "$TRAVIS_NODE_VERSION" = "12" ]; then npm run lint; fi
1112
script:
1213
- npm run test:cov
1314
- npm install --global typedoc typescript
1415
- CURRENT_VERSION=$(npm run version --silent)
1516
- typedoc --out "ts-docs/$CURRENT_VERSION" src
1617
- touch ./ts-docs/.nojekyll
17-
- if [ "$TRAVIS_NODE_VERSION" = "8" ]; then npm run coveralls-report; fi
18+
- if [ "$TRAVIS_NODE_VERSION" = "10" ]; then npm run coveralls-report; fi
1819
deploy:
1920
- provider: script
2021
skip_cleanup: true
2122
script: /bin/sh travis/github-pages.sh
2223
on:
2324
branch: master
24-
node_js: "9"
25+
node_js: "12"
2526
- provider: script
2627
skip_cleanup: true
2728
script: /bin/sh travis/uploadArchives.sh
2829
on:
2930
branch: master
30-
node_js: "8"
31+
node_js: "10"
3132
- provider: script
3233
skip_cleanup: true
3334
script: /bin/sh travis/release.sh
3435
on:
3536
branch: $RELEASE_BRANCH
36-
node_js: "8"
37+
node_js: "10"

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,29 @@ All notable changes to this project will be documented in this file.
33

44
The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

6+
## [0.18.0] - 20-Apr-2020
7+
8+
**Milestone**: Fushicho.4(RC3 0.9.3.2)
9+
Package | Version | Link
10+
---|---|---
11+
SDK Core| v0.18.0 | https://www.npmjs.com/package/symbol-sdk
12+
Catbuffer | v0.0.11 | https://www.npmjs.com/package/catbuffer-typescript
13+
Client Library | v0.8.9 | https://www.npmjs.com/package/symbol-openapi-typescript-node-client
14+
15+
- **[BREAKING CHANGE]** Stopped NodeJS v8 and v9 support. From this version (`v0.18.0`) onwards, Symbol-SDK will target on Node v10+.
16+
- **[BREAKING CHANGE]** Removed `Keccac_256` from `LockHashAlgorithm` (enum index changed).
17+
- **[BREAKING CHANGE]** Updated enum name `HashType` to `LockHashAlgorithm`.
18+
- **[BREAKING CHANGE]** Updated property name `hashType` to `hashAlgorithm` in `SecretLockTransaction` and `SecretProofTransaction`.
19+
- **[BREAKING CHANGE]** Removed redundant argument `NetworkType` from `Transaction.createTransactionHash()` and `Address.isValidRawAddress()`.
20+
- **[BREAKING CHANGE]** Added `setMaxFeeForAggregate()` for `AggregateTransaction`. `Transaction.setMaxFee()` can only be used by standalone transaction objects.
21+
- **[BREAKING CHANGE]** Refactored `SimpleWallet` model and wallet private key `Encryption / Decryption` methods to patch potential security risk.
22+
- Added `AccountService` to resolve mosaic alias and return namespace name.
23+
- Migrated from `TSLint` to `ESLint`. Added `Prettier` support.
24+
- Removed metadata value size validation (1024 bytes).
25+
- Fixed `PublicAccount.verifySignature` bug when verify string in hexadecimal format.
26+
- Added check on `UInt64.compact()` which throw exception on over flow.
27+
- Added `Network currency resolver` for e2e tests.
28+
629
## [0.17.4] - 07-Apr-2020
730

831
**Milestone**: Fushicho.4(RC3 0.9.3.2)
@@ -437,6 +460,7 @@ Client Library | v0.7.20-alpha.6 | https://www.npmjs.com/package/nem2-sdk-opena
437460

438461
- Initial code release.
439462

463+
[0.18.0]: https://github.com/nemtech/symbol-sdk-typescript-javascript/compare/v0.17.4...v0.18.0
440464
[0.17.4]: https://github.com/nemtech/symbol-sdk-typescript-javascript/compare/v0.17.3...v0.17.4
441465
[0.17.3]: https://github.com/nemtech/symbol-sdk-typescript-javascript/compare/v0.17.2...v0.17.3
442466
[0.17.2]: https://github.com/nemtech/symbol-sdk-typescript-javascript/compare/v0.17.1...v0.17.2

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,17 @@ The Symbol SDK for TypeScript / JavaScript allows you to develop web, mobile, an
1111

1212
### _Fushicho_ Network Compatibility ([email protected])
1313

14-
**!!! Please be noted that the NEM2-SDK is rebranded to SYMBOL-SDK now**.
14+
Due to a network upgrade with [catapult-server@Fushicho](https://github.com/nemtech/catapult-server/releases/tag/v0.9.3.2) version, **it is recommended to use this package's 0.18.0 version and upwards to use this package with Fushicho versioned networks**.
1515

16-
Due to a network upgrade with [catapult-server@Fushicho](https://github.com/nemtech/catapult-server/releases/tag/v0.9.3.2) version, **it is recommended to use this package's 0.17.4 version and upwards to use this package with Fushicho versioned networks**.
17-
18-
The upgrade to this package's [version v0.17.4](https://github.com/nemtech/symbol-sdk-typescript-javascript/releases/tag/v0.17.4) is mandatory for **fushicho compatibility**.
16+
The upgrade to this package's [version v0.18.0](https://github.com/nemtech/symbol-sdk-typescript-javascript/releases/tag/v0.18.0) is mandatory for **fushicho compatibility**.
1917

2018
Find the complete release notes [here](CHANGELOG.md).
2119

2220
## Requirements
2321

2422
### NodeJS
2523

26-
- NodeJS 8.9.X
27-
- NodeJS 9.X.X
28-
- NodeJS 10.X.X
24+
- NodeJS 10.X.X and above (from v0.18.0)
2925

3026
## Installation
3127

@@ -46,14 +42,14 @@ Use the following available resources to get help:
4642

4743
- [Symbol Documentation][docs]
4844
- [Symbol SDK Typescript/Javascript Reference][sdk-ref]
49-
- Join the community [slack group (#sig-api)][slack]
45+
- Join the community [slack group (#sig-api)][slack]
5046
- If you found a bug, [open a new issue][issues]
5147

5248
## Contributing
5349

5450
This project is developed and maintained by NEM Foundation.
5551

56-
Contributions are welcome and appreciated.
52+
Contributions are welcome and appreciated.
5753
Check [CONTRIBUTING](CONTRIBUTING.md) for information on how to contribute.
5854

5955
You can also find useful notes for developers under our documentation [guidelines][guidelines] section.

e2e/infrastructure/AccountHttp.spec.ts

Lines changed: 55 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import { Account } from '../../src/model/account/Account';
2424
import { Address } from '../../src/model/account/Address';
2525
import { PublicAccount } from '../../src/model/account/PublicAccount';
2626
import { PlainMessage } from '../../src/model/message/PlainMessage';
27-
import { NetworkCurrencyLocal } from '../../src/model/mosaic/NetworkCurrencyLocal';
2827
import { AliasAction } from '../../src/model/namespace/AliasAction';
2928
import { NamespaceId } from '../../src/model/namespace/NamespaceId';
3029
import { NetworkType } from '../../src/model/network/NetworkType';
@@ -93,7 +92,7 @@ describe('AccountHttp', () => {
9392
const transferTransaction = TransferTransaction.create(
9493
Deadline.create(),
9594
account2.address,
96-
[NetworkCurrencyLocal.createAbsolute(1)],
95+
[helper.createNetworkCurrency(1, false)],
9796
PlainMessage.create('test-message'),
9897
networkType,
9998
helper.maxFee,
@@ -121,7 +120,6 @@ describe('AccountHttp', () => {
121120
});
122121

123122
describe('Setup test AddressAlias', () => {
124-
125123
it('Announce addressAliasTransaction', () => {
126124
const addressAliasTransaction = AddressAliasTransaction.create(
127125
Deadline.create(),
@@ -137,29 +135,29 @@ describe('AccountHttp', () => {
137135
});
138136

139137
describe('Setup test multisig account', () => {
140-
141138
it('Announce MultisigAccountModificationTransaction', () => {
142139
const modifyMultisigAccountTransaction = MultisigAccountModificationTransaction.create(
143140
Deadline.create(),
144141
2,
145142
1,
146-
[
147-
cosignAccount1.publicAccount,
148-
cosignAccount2.publicAccount,
149-
cosignAccount3.publicAccount,
150-
],
143+
[cosignAccount1.publicAccount, cosignAccount2.publicAccount, cosignAccount3.publicAccount],
151144
[],
152145
networkType,
153146
helper.maxFee,
154147
);
155148

156-
const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(),
149+
const aggregateTransaction = AggregateTransaction.createComplete(
150+
Deadline.create(),
157151
[modifyMultisigAccountTransaction.toAggregate(multisigAccount.publicAccount)],
158152
networkType,
159153
[],
160-
helper.maxFee);
161-
const signedTransaction = aggregateTransaction
162-
.signTransactionWithCosignatories(multisigAccount, [cosignAccount1, cosignAccount2, cosignAccount3], generationHash);
154+
helper.maxFee,
155+
);
156+
const signedTransaction = aggregateTransaction.signTransactionWithCosignatories(
157+
multisigAccount,
158+
[cosignAccount1, cosignAccount2, cosignAccount3],
159+
generationHash,
160+
);
163161

164162
return helper.announce(signedTransaction);
165163
});
@@ -187,8 +185,9 @@ describe('AccountHttp', () => {
187185

188186
describe('getMultisigAccountGraphInfo', () => {
189187
it('should call getMultisigAccountGraphInfo successfully', async () => {
190-
const multisigAccountGraphInfo =
191-
await multisigRepository.getMultisigAccountGraphInfo(multisigAccount.publicAccount.address).toPromise();
188+
const multisigAccountGraphInfo = await multisigRepository
189+
.getMultisigAccountGraphInfo(multisigAccount.publicAccount.address)
190+
.toPromise();
192191
expect(multisigAccountGraphInfo.multisigAccounts.get(0)![0].account.publicKey).to.be.equal(multisigAccount.publicKey);
193192
});
194193
});
@@ -214,26 +213,37 @@ describe('AccountHttp', () => {
214213

215214
describe('transactions', () => {
216215
it('should not return accounts when account does not exist', () => {
217-
return accountRepository.getAccountInfo(Account.generateNewAccount(networkType).address).toPromise().then(() => {
218-
return Promise.reject('should fail!');
219-
}, (err) => {
220-
const error = JSON.parse(err.message);
221-
expect(error.statusCode).to.be.eq(404);
222-
expect(error.errorDetails.statusMessage).to.be.eq('Not Found');
223-
return Promise.resolve();
224-
});
216+
return accountRepository
217+
.getAccountInfo(Account.generateNewAccount(networkType).address)
218+
.toPromise()
219+
.then(
220+
() => {
221+
return Promise.reject('should fail!');
222+
},
223+
(err) => {
224+
const error = JSON.parse(err.message);
225+
expect(error.statusCode).to.be.eq(404);
226+
expect(error.errorDetails.statusMessage).to.be.eq('Not Found');
227+
return Promise.resolve();
228+
},
229+
);
225230
});
226231
});
227232

228233
describe('transactions', () => {
229234
it('should call transactions successfully by type', async () => {
230-
const transactions = await accountRepository.getAccountTransactions(
231-
publicAccount.address, new QueryParams(), new TransactionFilter({
232-
types: [TransactionType.TRANSFER, TransactionType.AGGREGATE_COMPLETE],
233-
})).toPromise();
235+
const transactions = await accountRepository
236+
.getAccountTransactions(
237+
publicAccount.address,
238+
new QueryParams(),
239+
new TransactionFilter({
240+
types: [TransactionType.TRANSFER, TransactionType.AGGREGATE_COMPLETE],
241+
}),
242+
)
243+
.toPromise();
234244
expect(transactions.length).to.be.greaterThan(0);
235245
transactions.forEach((t) => {
236-
expect((t.type === TransactionType.TRANSFER || t.type === TransactionType.AGGREGATE_COMPLETE)).to.be.eq(true);
246+
expect(t.type === TransactionType.TRANSFER || t.type === TransactionType.AGGREGATE_COMPLETE).to.be.eq(true);
237247
});
238248
});
239249
});
@@ -286,8 +296,7 @@ describe('AccountHttp', () => {
286296
-1,
287297
0,
288298
[],
289-
[cosignAccount1.publicAccount,
290-
],
299+
[cosignAccount1.publicAccount],
291300
networkType,
292301
helper.maxFee,
293302
);
@@ -296,9 +305,7 @@ describe('AccountHttp', () => {
296305
0,
297306
0,
298307
[],
299-
[
300-
cosignAccount2.publicAccount,
301-
],
308+
[cosignAccount2.publicAccount],
302309
networkType,
303310
helper.maxFee,
304311
);
@@ -308,21 +315,27 @@ describe('AccountHttp', () => {
308315
-1,
309316
-1,
310317
[],
311-
[
312-
cosignAccount3.publicAccount,
313-
],
318+
[cosignAccount3.publicAccount],
314319
networkType,
315320
helper.maxFee,
316321
);
317322

318-
const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(),
319-
[removeCosigner1.toAggregate(multisigAccount.publicAccount),
323+
const aggregateTransaction = AggregateTransaction.createComplete(
324+
Deadline.create(),
325+
[
326+
removeCosigner1.toAggregate(multisigAccount.publicAccount),
320327
removeCosigner2.toAggregate(multisigAccount.publicAccount),
321-
removeCosigner3.toAggregate(multisigAccount.publicAccount)],
328+
removeCosigner3.toAggregate(multisigAccount.publicAccount),
329+
],
322330
networkType,
323-
[], helper.maxFee);
324-
const signedTransaction = aggregateTransaction
325-
.signTransactionWithCosignatories(cosignAccount1, [cosignAccount2, cosignAccount3], generationHash);
331+
[],
332+
helper.maxFee,
333+
);
334+
const signedTransaction = aggregateTransaction.signTransactionWithCosignatories(
335+
cosignAccount1,
336+
[cosignAccount2, cosignAccount3],
337+
generationHash,
338+
);
326339
return helper.announce(signedTransaction);
327340
});
328341
});

0 commit comments

Comments
 (0)