|
15 | 15 | */ |
16 | 16 |
|
17 | 17 | import { expect } from 'chai'; |
| 18 | +import { CreateTransactionFromPayload } from '../../../src'; |
18 | 19 | import { Convert } from '../../../src/core/format'; |
19 | 20 | import { Account } from '../../../src/model/account/Account'; |
20 | 21 | import { MosaicFlags } from '../../../src/model/mosaic/MosaicFlags'; |
@@ -199,4 +200,24 @@ describe('MosaicDefinitionTransaction', () => { |
199 | 200 | Object.assign(tx, { signer: account.publicAccount }); |
200 | 201 | expect(tx.shouldNotifyAccount(account.address)).to.be.true; |
201 | 202 | }); |
| 203 | + |
| 204 | + it('should set correctly revokable flag when generating transaction from payload', () => { |
| 205 | + const mosaicDefinitionTransaction = MosaicDefinitionTransaction.create( |
| 206 | + Deadline.create(epochAdjustment), |
| 207 | + MosaicNonce.createFromUint8Array(new Uint8Array([0xe6, 0xde, 0x84, 0xb8])), |
| 208 | + new MosaicId(UInt64.fromUint(1).toDTO()), |
| 209 | + MosaicFlags.create(false, false, false, true), |
| 210 | + 3, |
| 211 | + UInt64.fromUint(0), |
| 212 | + TestNetworkType, |
| 213 | + ); |
| 214 | + |
| 215 | + const signedTransaction = mosaicDefinitionTransaction.signWith(account, generationHash); |
| 216 | + const recreatedTransaction = CreateTransactionFromPayload(signedTransaction.payload) as MosaicDefinitionTransaction; |
| 217 | + |
| 218 | + expect(recreatedTransaction.flags.supplyMutable).to.be.equal(false); |
| 219 | + expect(recreatedTransaction.flags.transferable).to.be.equal(false); |
| 220 | + expect(recreatedTransaction.flags.restrictable).to.be.equal(false); |
| 221 | + expect(recreatedTransaction.flags.revokable).to.be.equal(true); |
| 222 | + }); |
202 | 223 | }); |
0 commit comments