@@ -25,6 +25,7 @@ import { PropertyModificationType } from '../../../src/model/account/PropertyMod
2525import { PropertyType } from '../../../src/model/account/PropertyType' ;
2626import { PublicAccount } from '../../../src/model/account/PublicAccount' ;
2727import { NetworkType } from '../../../src/model/blockchain/NetworkType' ;
28+ import { EncryptedMessage } from '../../../src/model/model' ;
2829import { MosaicId } from '../../../src/model/mosaic/MosaicId' ;
2930import { MosaicNonce } from '../../../src/model/mosaic/MosaicNonce' ;
3031import { MosaicProperties } from '../../../src/model/mosaic/MosaicProperties' ;
@@ -34,13 +35,15 @@ import { AliasActionType } from '../../../src/model/namespace/AliasActionType';
3435import { NamespaceId } from '../../../src/model/namespace/NamespaceId' ;
3536import { NamespaceType } from '../../../src/model/namespace/NamespaceType' ;
3637import { AccountLinkTransaction } from '../../../src/model/transaction/AccountLinkTransaction' ;
38+ import { AccountPropertyModification } from '../../../src/model/transaction/AccountPropertyModification' ;
3739import { AccountPropertyTransaction } from '../../../src/model/transaction/AccountPropertyTransaction' ;
3840import { AddressAliasTransaction } from '../../../src/model/transaction/AddressAliasTransaction' ;
3941import { AggregateTransaction } from '../../../src/model/transaction/AggregateTransaction' ;
4042import { Deadline } from '../../../src/model/transaction/Deadline' ;
4143import { HashType } from '../../../src/model/transaction/HashType' ;
4244import { LinkAction } from '../../../src/model/transaction/LinkAction' ;
4345import { LockFundsTransaction } from '../../../src/model/transaction/LockFundsTransaction' ;
46+ import { MessageType } from '../../../src/model/transaction/MessageType' ;
4447import { ModifyAccountPropertyAddressTransaction } from '../../../src/model/transaction/ModifyAccountPropertyAddressTransaction' ;
4548import { ModifyAccountPropertyMosaicTransaction } from '../../../src/model/transaction/ModifyAccountPropertyMosaicTransaction' ;
4649import { ModifyMultisigAccountTransaction } from '../../../src/model/transaction/ModifyMultisigAccountTransaction' ;
@@ -67,7 +70,7 @@ describe('TransactionMapping - createFromPayload', () => {
6770
6871 it ( 'should create AccountPropertyAddressTransaction' , ( ) => {
6972 const address = Address . createFromRawAddress ( 'SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC' ) ;
70- const addressPropertyFilter = AccountPropertyTransaction . createAddressFilter (
73+ const addressPropertyFilter = AccountPropertyModification . createForAddress (
7174 PropertyModificationType . Add ,
7275 address ,
7376 ) ;
@@ -89,7 +92,7 @@ describe('TransactionMapping - createFromPayload', () => {
8992
9093 it ( 'should create AccountPropertyMosaicTransaction' , ( ) => {
9194 const mosaicId = new MosaicId ( [ 2262289484 , 3405110546 ] ) ;
92- const mosaicPropertyFilter = AccountPropertyTransaction . createMosaicFilter (
95+ const mosaicPropertyFilter = AccountPropertyModification . createForMosaic (
9396 PropertyModificationType . Add ,
9497 mosaicId ,
9598 ) ;
@@ -111,7 +114,7 @@ describe('TransactionMapping - createFromPayload', () => {
111114
112115 it ( 'should create AccountPropertyMosaicTransaction' , ( ) => {
113116 const entityType = TransactionType . ADDRESS_ALIAS ;
114- const entityTypePropertyFilter = AccountPropertyTransaction . createEntityTypeFilter (
117+ const entityTypePropertyFilter = AccountPropertyModification . createForEntityType (
115118 PropertyModificationType . Add ,
116119 entityType ,
117120 ) ;
@@ -572,6 +575,23 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () =>
572575 expect ( transaction . message . payload ) . to . be . equal ( 'test-message' ) ;
573576 } ) ;
574577
578+ it ( 'should create TransferTransaction - Encrypted Message' , ( ) => {
579+ const transferTransaction = TransferTransaction . create (
580+ Deadline . create ( ) ,
581+ Address . createFromRawAddress ( 'SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC' ) ,
582+ [
583+ NetworkCurrencyMosaic . createRelative ( 100 ) ,
584+ ] ,
585+ new EncryptedMessage ( '12324556' ) ,
586+ NetworkType . MIJIN_TEST ,
587+ ) ;
588+
589+ const transaction = TransactionMapping . createFromDTO ( transferTransaction . toJSON ( ) ) as TransferTransaction ;
590+
591+ expect ( ( transaction . recipient as Address ) . plain ( ) ) . to . be . equal ( 'SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC' ) ;
592+ expect ( transaction . message . type ) . to . be . equal ( MessageType . EncryptedMessage ) ;
593+ } ) ;
594+
575595 it ( 'should create AccountLinkTransaction' , ( ) => {
576596 const accountLinkTransaction = AccountLinkTransaction . create (
577597 Deadline . create ( ) ,
@@ -588,7 +608,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () =>
588608
589609 it ( 'should create AccountPropertyAddressTransaction' , ( ) => {
590610 const address = Address . createFromRawAddress ( 'SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC' ) ;
591- const addressPropertyFilter = AccountPropertyTransaction . createAddressFilter (
611+ const addressPropertyFilter = AccountPropertyModification . createForAddress (
592612 PropertyModificationType . Add ,
593613 address ,
594614 ) ;
@@ -609,7 +629,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () =>
609629
610630 it ( 'should create AccountPropertyMosaicTransaction' , ( ) => {
611631 const mosaicId = new MosaicId ( [ 2262289484 , 3405110546 ] ) ;
612- const mosaicPropertyFilter = AccountPropertyTransaction . createMosaicFilter (
632+ const mosaicPropertyFilter = AccountPropertyModification . createForMosaic (
613633 PropertyModificationType . Add ,
614634 mosaicId ,
615635 ) ;
@@ -630,7 +650,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () =>
630650
631651 it ( 'should create AccountPropertyMosaicTransaction' , ( ) => {
632652 const entityType = TransactionType . ADDRESS_ALIAS ;
633- const entityTypePropertyFilter = AccountPropertyTransaction . createEntityTypeFilter (
653+ const entityTypePropertyFilter = AccountPropertyModification . createForEntityType (
634654 PropertyModificationType . Add ,
635655 entityType ,
636656 ) ;
0 commit comments