Skip to content

Commit

Permalink
v0.18.0 Release (#543)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
5 people authored Apr 20, 2020
1 parent fcf67e6 commit bfde2d4
Show file tree
Hide file tree
Showing 339 changed files with 11,097 additions and 9,051 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'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.
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/camelcase': 'off',
// TODO fix all the warnings
'@typescript-eslint/no-explicit-any': 'off',
},
};
2 changes: 1 addition & 1 deletion .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

2. Steps to reproduce the problem.

3. Specifications like the version of the project, operating system, or hardware.
3. Specifications like the version of the project, operating system, or hardware.
15 changes: 8 additions & 7 deletions src/model/wallet/WalletAlgorithm.ts → .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 NEM
* Copyright 2020 NEM
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,9 +14,10 @@
* limitations under the License.
*/

export enum WalletAlgorithm {
Pass_6k = 1,
Pass_bip32 = 2,
Pass_enc = 4,
Trezor = 3,
}
module.exports = {
semi: true,
trailingComma: "all",
singleQuote: true,
printWidth: 140,
tabWidth: 4
};
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
language: node_js
node_js:
- "8"
- "9"
- "10"
- "12"
cache:
directories:
- "node_modules"
- .eslintcache
before_script:
- npm run build
- if [ "$TRAVIS_NODE_VERSION" = "10" ] || [ "$TRAVIS_NODE_VERSION" = "12" ]; then npm run lint; fi
script:
- npm run test:cov
- npm install --global typedoc typescript
- CURRENT_VERSION=$(npm run version --silent)
- typedoc --out "ts-docs/$CURRENT_VERSION" src
- touch ./ts-docs/.nojekyll
- if [ "$TRAVIS_NODE_VERSION" = "8" ]; then npm run coveralls-report; fi
- if [ "$TRAVIS_NODE_VERSION" = "10" ]; then npm run coveralls-report; fi
deploy:
- provider: script
skip_cleanup: true
script: /bin/sh travis/github-pages.sh
on:
branch: master
node_js: "9"
node_js: "12"
- provider: script
skip_cleanup: true
script: /bin/sh travis/uploadArchives.sh
on:
branch: master
node_js: "8"
node_js: "10"
- provider: script
skip_cleanup: true
script: /bin/sh travis/release.sh
on:
branch: $RELEASE_BRANCH
node_js: "8"
node_js: "10"
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,29 @@ All notable changes to this project will be documented in this file.

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

## [0.18.0] - 20-Apr-2020

**Milestone**: Fushicho.4(RC3 0.9.3.2)
Package | Version | Link
---|---|---
SDK Core| v0.18.0 | https://www.npmjs.com/package/symbol-sdk
Catbuffer | v0.0.11 | https://www.npmjs.com/package/catbuffer-typescript
Client Library | v0.8.9 | https://www.npmjs.com/package/symbol-openapi-typescript-node-client

- **[BREAKING CHANGE]** Stopped NodeJS v8 and v9 support. From this version (`v0.18.0`) onwards, Symbol-SDK will target on Node v10+.
- **[BREAKING CHANGE]** Removed `Keccac_256` from `LockHashAlgorithm` (enum index changed).
- **[BREAKING CHANGE]** Updated enum name `HashType` to `LockHashAlgorithm`.
- **[BREAKING CHANGE]** Updated property name `hashType` to `hashAlgorithm` in `SecretLockTransaction` and `SecretProofTransaction`.
- **[BREAKING CHANGE]** Removed redundant argument `NetworkType` from `Transaction.createTransactionHash()` and `Address.isValidRawAddress()`.
- **[BREAKING CHANGE]** Added `setMaxFeeForAggregate()` for `AggregateTransaction`. `Transaction.setMaxFee()` can only be used by standalone transaction objects.
- **[BREAKING CHANGE]** Refactored `SimpleWallet` model and wallet private key `Encryption / Decryption` methods to patch potential security risk.
- Added `AccountService` to resolve mosaic alias and return namespace name.
- Migrated from `TSLint` to `ESLint`. Added `Prettier` support.
- Removed metadata value size validation (1024 bytes).
- Fixed `PublicAccount.verifySignature` bug when verify string in hexadecimal format.
- Added check on `UInt64.compact()` which throw exception on over flow.
- Added `Network currency resolver` for e2e tests.

## [0.17.4] - 07-Apr-2020

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

- Initial code release.

[0.18.0]: https://github.com/nemtech/symbol-sdk-typescript-javascript/compare/v0.17.4...v0.18.0
[0.17.4]: https://github.com/nemtech/symbol-sdk-typescript-javascript/compare/v0.17.3...v0.17.4
[0.17.3]: https://github.com/nemtech/symbol-sdk-typescript-javascript/compare/v0.17.2...v0.17.3
[0.17.2]: https://github.com/nemtech/symbol-sdk-typescript-javascript/compare/v0.17.1...v0.17.2
Expand Down
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,17 @@ The Symbol SDK for TypeScript / JavaScript allows you to develop web, mobile, an

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

**!!! Please be noted that the NEM2-SDK is rebranded to SYMBOL-SDK now**.
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**.

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**.

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**.
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**.

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

## Requirements

### NodeJS

- NodeJS 8.9.X
- NodeJS 9.X.X
- NodeJS 10.X.X
- NodeJS 10.X.X and above (from v0.18.0)

## Installation

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

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

## Contributing

This project is developed and maintained by NEM Foundation.

Contributions are welcome and appreciated.
Contributions are welcome and appreciated.
Check [CONTRIBUTING](CONTRIBUTING.md) for information on how to contribute.

You can also find useful notes for developers under our documentation [guidelines][guidelines] section.
Expand Down
97 changes: 55 additions & 42 deletions e2e/infrastructure/AccountHttp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { Account } from '../../src/model/account/Account';
import { Address } from '../../src/model/account/Address';
import { PublicAccount } from '../../src/model/account/PublicAccount';
import { PlainMessage } from '../../src/model/message/PlainMessage';
import { NetworkCurrencyLocal } from '../../src/model/mosaic/NetworkCurrencyLocal';
import { AliasAction } from '../../src/model/namespace/AliasAction';
import { NamespaceId } from '../../src/model/namespace/NamespaceId';
import { NetworkType } from '../../src/model/network/NetworkType';
Expand Down Expand Up @@ -93,7 +92,7 @@ describe('AccountHttp', () => {
const transferTransaction = TransferTransaction.create(
Deadline.create(),
account2.address,
[NetworkCurrencyLocal.createAbsolute(1)],
[helper.createNetworkCurrency(1, false)],
PlainMessage.create('test-message'),
networkType,
helper.maxFee,
Expand Down Expand Up @@ -121,7 +120,6 @@ describe('AccountHttp', () => {
});

describe('Setup test AddressAlias', () => {

it('Announce addressAliasTransaction', () => {
const addressAliasTransaction = AddressAliasTransaction.create(
Deadline.create(),
Expand All @@ -137,29 +135,29 @@ describe('AccountHttp', () => {
});

describe('Setup test multisig account', () => {

it('Announce MultisigAccountModificationTransaction', () => {
const modifyMultisigAccountTransaction = MultisigAccountModificationTransaction.create(
Deadline.create(),
2,
1,
[
cosignAccount1.publicAccount,
cosignAccount2.publicAccount,
cosignAccount3.publicAccount,
],
[cosignAccount1.publicAccount, cosignAccount2.publicAccount, cosignAccount3.publicAccount],
[],
networkType,
helper.maxFee,
);

const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(),
const aggregateTransaction = AggregateTransaction.createComplete(
Deadline.create(),
[modifyMultisigAccountTransaction.toAggregate(multisigAccount.publicAccount)],
networkType,
[],
helper.maxFee);
const signedTransaction = aggregateTransaction
.signTransactionWithCosignatories(multisigAccount, [cosignAccount1, cosignAccount2, cosignAccount3], generationHash);
helper.maxFee,
);
const signedTransaction = aggregateTransaction.signTransactionWithCosignatories(
multisigAccount,
[cosignAccount1, cosignAccount2, cosignAccount3],
generationHash,
);

return helper.announce(signedTransaction);
});
Expand Down Expand Up @@ -187,8 +185,9 @@ describe('AccountHttp', () => {

describe('getMultisigAccountGraphInfo', () => {
it('should call getMultisigAccountGraphInfo successfully', async () => {
const multisigAccountGraphInfo =
await multisigRepository.getMultisigAccountGraphInfo(multisigAccount.publicAccount.address).toPromise();
const multisigAccountGraphInfo = await multisigRepository
.getMultisigAccountGraphInfo(multisigAccount.publicAccount.address)
.toPromise();
expect(multisigAccountGraphInfo.multisigAccounts.get(0)![0].account.publicKey).to.be.equal(multisigAccount.publicKey);
});
});
Expand All @@ -214,26 +213,37 @@ describe('AccountHttp', () => {

describe('transactions', () => {
it('should not return accounts when account does not exist', () => {
return accountRepository.getAccountInfo(Account.generateNewAccount(networkType).address).toPromise().then(() => {
return Promise.reject('should fail!');
}, (err) => {
const error = JSON.parse(err.message);
expect(error.statusCode).to.be.eq(404);
expect(error.errorDetails.statusMessage).to.be.eq('Not Found');
return Promise.resolve();
});
return accountRepository
.getAccountInfo(Account.generateNewAccount(networkType).address)
.toPromise()
.then(
() => {
return Promise.reject('should fail!');
},
(err) => {
const error = JSON.parse(err.message);
expect(error.statusCode).to.be.eq(404);
expect(error.errorDetails.statusMessage).to.be.eq('Not Found');
return Promise.resolve();
},
);
});
});

describe('transactions', () => {
it('should call transactions successfully by type', async () => {
const transactions = await accountRepository.getAccountTransactions(
publicAccount.address, new QueryParams(), new TransactionFilter({
types: [TransactionType.TRANSFER, TransactionType.AGGREGATE_COMPLETE],
})).toPromise();
const transactions = await accountRepository
.getAccountTransactions(
publicAccount.address,
new QueryParams(),
new TransactionFilter({
types: [TransactionType.TRANSFER, TransactionType.AGGREGATE_COMPLETE],
}),
)
.toPromise();
expect(transactions.length).to.be.greaterThan(0);
transactions.forEach((t) => {
expect((t.type === TransactionType.TRANSFER || t.type === TransactionType.AGGREGATE_COMPLETE)).to.be.eq(true);
expect(t.type === TransactionType.TRANSFER || t.type === TransactionType.AGGREGATE_COMPLETE).to.be.eq(true);
});
});
});
Expand Down Expand Up @@ -286,8 +296,7 @@ describe('AccountHttp', () => {
-1,
0,
[],
[cosignAccount1.publicAccount,
],
[cosignAccount1.publicAccount],
networkType,
helper.maxFee,
);
Expand All @@ -296,9 +305,7 @@ describe('AccountHttp', () => {
0,
0,
[],
[
cosignAccount2.publicAccount,
],
[cosignAccount2.publicAccount],
networkType,
helper.maxFee,
);
Expand All @@ -308,21 +315,27 @@ describe('AccountHttp', () => {
-1,
-1,
[],
[
cosignAccount3.publicAccount,
],
[cosignAccount3.publicAccount],
networkType,
helper.maxFee,
);

const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(),
[removeCosigner1.toAggregate(multisigAccount.publicAccount),
const aggregateTransaction = AggregateTransaction.createComplete(
Deadline.create(),
[
removeCosigner1.toAggregate(multisigAccount.publicAccount),
removeCosigner2.toAggregate(multisigAccount.publicAccount),
removeCosigner3.toAggregate(multisigAccount.publicAccount)],
removeCosigner3.toAggregate(multisigAccount.publicAccount),
],
networkType,
[], helper.maxFee);
const signedTransaction = aggregateTransaction
.signTransactionWithCosignatories(cosignAccount1, [cosignAccount2, cosignAccount3], generationHash);
[],
helper.maxFee,
);
const signedTransaction = aggregateTransaction.signTransactionWithCosignatories(
cosignAccount1,
[cosignAccount2, cosignAccount3],
generationHash,
);
return helper.announce(signedTransaction);
});
});
Expand Down
Loading

0 comments on commit bfde2d4

Please sign in to comment.