Skip to content

Commit

Permalink
Releasing v2.0.4 #852
Browse files Browse the repository at this point in the history
Releasing v2.0.4
  • Loading branch information
AnthonyLaw committed Mar 6, 2023
2 parents 6ca1b3f + 1ae54ff commit 894a017
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 9 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ 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/).

## 2.0.4 - 7-Mar-2023

Package | Version | Link
---|---|---
SDK Core| v2.0.4 | [symbol-sdk](https://www.npmjs.com/package/symbol-sdk)
Catbuffer | v1.0.2 | [catbuffer-typescript](https://www.npmjs.com/package/catbuffer-typescript)
Client Library | v1.0.3 | [symbol-openapi-typescript-fetch-client](https://www.npmjs.com/package/symbol-openapi-typescript-fetch-client)

- [Bug] Fix mosaic definition transaction from payload method.

## 2.0.3 - 25-Oct-2022

Package | Version | Link
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ Then sit back and wait. There will probably be discussion about the pull request
*CONTRIBUTING.md is based on [CONTRIBUTING-template.md](https://github.com/nayafia/contributing-template/blob/master/CONTRIBUTING-template.md)* , [elasticsearch/CONTRIBUTING](https://github.com/elastic/elasticsearch/blob/master/CONTRIBUTING.md) and [spark/CONTRIBUTING](https://github.com/apache/spark/blob/master/CONTRIBUTING.md)

[pull-request]: https://help.github.com/articles/about-pull-requests/
[github-issues]: https://github.com/nemtech/symbol-sdk-typescript-javascript/issues
[github-issues]: https://github.com/symbol/symbol-sdk-typescript-javascript/issues
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ The Symbol SDK for TypeScript / JavaScript allows you to develop web, mobile, an

## Important Notes

### _Catapult-Server_ Network Compatibility (catapult-server@0.10.0.8)
### _Catapult-Server_ Network Compatibility (catapult-server@1.0.3.5)

Symbol network launched [catapult-client](https://github.com/symbol/catapult-client/releases/tag/v1.0.0.0), **it is recommended to use this package's 1.0.0 version and upwards for the Symbol public network**.
Symbol network launched [catapult-client](https://github.com/symbol/symbol/releases), **it is recommended to use this package's 2.0.3 version and upwards for the Symbol public network**.

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

Expand Down Expand Up @@ -58,8 +58,8 @@ Copyright (c) 2018-present NEM
Licensed under the [Apache License 2.0](LICENSE)

[self]: https://github.com/symbol/symbol-sdk-typescript-javascript
[docs]: http://docs.symbolplatform.com/getting-started/setup-workstation.html
[docs]: https://docs.symbol.dev/getting-started/setup-workstation.html
[issues]: https://github.com/symbol/symbol-sdk-typescript-javascript/issues
[sdk-ref]: https://docs.symbolplatform.com/references/typescript-sdk.html
[guidelines]: https://docs.symbolplatform.com/contribute/contributing.html#sdk
[sdk-ref]: https://docs.symbol.dev/references/typescript-sdk.html
[guidelines]: https://docs.symbol.dev/contribute/contributing.html#sdk
[discord]: https://discord.com/invite/xymcity
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "symbol-sdk",
"version": "2.0.3",
"version": "2.0.4",
"description": "Reactive symbol sdk for typescript and javascript",
"scripts": {
"pretest": "npm run build",
Expand Down
8 changes: 8 additions & 0 deletions src/model/mosaic/MosaicInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ export class MosaicInfo {
return this.flags.restrictable;
}

/**
* Is revokable
* @returns {boolean}
*/
public isRevokable(): boolean {
return this.flags.revokable;
}

/**
* Generate buffer
* @return {Uint8Array}
Expand Down
1 change: 1 addition & 0 deletions src/model/transaction/MosaicDefinitionTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export class MosaicDefinitionTransaction extends Transaction {
builder.getFlags().indexOf(MosaicFlagsDto.SUPPLY_MUTABLE) > -1,
builder.getFlags().indexOf(MosaicFlagsDto.TRANSFERABLE) > -1,
builder.getFlags().indexOf(MosaicFlagsDto.RESTRICTABLE) > -1,
builder.getFlags().indexOf(MosaicFlagsDto.REVOKABLE) > -1,
),
builder.getDivisibility(),
new UInt64(builder.getDuration().blockDuration),
Expand Down
21 changes: 21 additions & 0 deletions test/model/transaction/MosaicDefinitionTransaction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import { expect } from 'chai';
import { CreateTransactionFromPayload } from '../../../src';
import { Convert } from '../../../src/core/format';
import { Account } from '../../../src/model/account/Account';
import { MosaicFlags } from '../../../src/model/mosaic/MosaicFlags';
Expand Down Expand Up @@ -199,4 +200,24 @@ describe('MosaicDefinitionTransaction', () => {
Object.assign(tx, { signer: account.publicAccount });
expect(tx.shouldNotifyAccount(account.address)).to.be.true;
});

it('should set correctly revokable flag when generating transaction from payload', () => {
const mosaicDefinitionTransaction = MosaicDefinitionTransaction.create(
Deadline.create(epochAdjustment),
MosaicNonce.createFromUint8Array(new Uint8Array([0xe6, 0xde, 0x84, 0xb8])),
new MosaicId(UInt64.fromUint(1).toDTO()),
MosaicFlags.create(false, false, false, true),
3,
UInt64.fromUint(0),
TestNetworkType,
);

const signedTransaction = mosaicDefinitionTransaction.signWith(account, generationHash);
const recreatedTransaction = CreateTransactionFromPayload(signedTransaction.payload) as MosaicDefinitionTransaction;

expect(recreatedTransaction.flags.supplyMutable).to.be.equal(false);
expect(recreatedTransaction.flags.transferable).to.be.equal(false);
expect(recreatedTransaction.flags.restrictable).to.be.equal(false);
expect(recreatedTransaction.flags.revokable).to.be.equal(true);
});
});

0 comments on commit 894a017

Please sign in to comment.