@@ -19,10 +19,10 @@ import {assert, expect} from 'chai';
1919import { AccountHttp } from '../../src/infrastructure/AccountHttp' ;
2020import { Listener , TransactionHttp } from '../../src/infrastructure/infrastructure' ;
2121import { Account } from '../../src/model/account/Account' ;
22+ import { AccountRestrictionModificationAction } from '../../src/model/account/AccountRestrictionModificationAction' ;
2223import { AccountRestrictionType } from '../../src/model/account/AccountRestrictionType' ;
2324import { Address } from '../../src/model/account/Address' ;
2425import { PublicAccount } from '../../src/model/account/PublicAccount' ;
25- import { RestrictionModificationType } from '../../src/model/account/RestrictionModificationType' ;
2626import { NetworkType } from '../../src/model/blockchain/NetworkType' ;
2727import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic' ;
2828import { AliasAction } from '../../src/model/namespace/AliasAction' ;
@@ -31,12 +31,12 @@ import { AccountRestrictionModification } from '../../src/model/transaction/Acco
3131import { AccountRestrictionTransaction } from '../../src/model/transaction/AccountRestrictionTransaction' ;
3232import { AddressAliasTransaction } from '../../src/model/transaction/AddressAliasTransaction' ;
3333import { AggregateTransaction } from '../../src/model/transaction/AggregateTransaction' ;
34+ import { CosignatoryModificationAction } from '../../src/model/transaction/CosignatoryModificationAction' ;
3435import { Deadline } from '../../src/model/transaction/Deadline' ;
35- import { ModifyMultisigAccountTransaction } from '../../src/model/transaction/ModifyMultisigAccountTransaction ' ;
36+ import { MultisigAccountModificationTransaction } from '../../src/model/transaction/MultisigAccountModificationTransaction ' ;
3637import { MultisigCosignatoryModification } from '../../src/model/transaction/MultisigCosignatoryModification' ;
37- import { MultisigCosignatoryModificationType } from '../../src/model/transaction/MultisigCosignatoryModificationType ' ;
38+ import { NamespaceRegistrationTransaction } from '../../src/model/transaction/NamespaceRegistrationTransaction ' ;
3839import { PlainMessage } from '../../src/model/transaction/PlainMessage' ;
39- import { RegisterNamespaceTransaction } from '../../src/model/transaction/RegisterNamespaceTransaction' ;
4040import { TransferTransaction } from '../../src/model/transaction/TransferTransaction' ;
4141import { UInt64 } from '../../src/model/UInt64' ;
4242
@@ -129,12 +129,12 @@ describe('AccountHttp', () => {
129129 after ( ( ) => {
130130 return listener . close ( ) ;
131131 } ) ;
132- it ( 'Announce RegisterNamespaceTransaction ' , ( done ) => {
132+ it ( 'Announce NamespaceRegistrationTransaction ' , ( done ) => {
133133 const namespaceName = 'root-test-namespace-' + Math . floor ( Math . random ( ) * 10000 ) ;
134- const registerNamespaceTransaction = RegisterNamespaceTransaction . createRootNamespace (
134+ const registerNamespaceTransaction = NamespaceRegistrationTransaction . createRootNamespace (
135135 Deadline . create ( ) ,
136136 namespaceName ,
137- UInt64 . fromUint ( 1000 ) ,
137+ UInt64 . fromUint ( 9 ) ,
138138 NetworkType . MIJIN_TEST ,
139139 ) ;
140140 namespaceId = new NamespaceId ( namespaceName ) ;
@@ -183,7 +183,7 @@ describe('AccountHttp', () => {
183183 } ) ;
184184 } ) ;
185185
186- describe ( 'Setup Test AccountAddressProperty ' , ( ) => {
186+ describe ( 'Setup Test AccountAddressRestriction ' , ( ) => {
187187 let listener : Listener ;
188188 before ( ( ) => {
189189 listener = new Listener ( config . apiUrl ) ;
@@ -195,17 +195,16 @@ describe('AccountHttp', () => {
195195
196196 it ( 'Announce AccountRestrictionTransaction' , ( done ) => {
197197 const addressPropertyFilter = AccountRestrictionModification . createForAddress (
198- RestrictionModificationType . Add ,
198+ AccountRestrictionModificationAction . Add ,
199199 account3 . address ,
200200 ) ;
201201 const addressModification = AccountRestrictionTransaction . createAddressRestrictionModificationTransaction (
202202 Deadline . create ( ) ,
203- AccountRestrictionType . BlockIncomingAddress ,
203+ AccountRestrictionType . AllowIncomingAddress ,
204204 [ addressPropertyFilter ] ,
205205 NetworkType . MIJIN_TEST ,
206206 ) ;
207207 const signedTransaction = addressModification . signWith ( account , generationHash ) ;
208-
209208 listener . confirmed ( account . address ) . subscribe ( ( ) => {
210209 done ( ) ;
211210 } ) ;
@@ -226,14 +225,14 @@ describe('AccountHttp', () => {
226225 after ( ( ) => {
227226 return listener . close ( ) ;
228227 } ) ;
229- it ( 'Announce ModifyMultisigAccountTransaction ' , ( done ) => {
230- const modifyMultisigAccountTransaction = ModifyMultisigAccountTransaction . create (
228+ it ( 'Announce MultisigAccountModificationTransaction ' , ( done ) => {
229+ const modifyMultisigAccountTransaction = MultisigAccountModificationTransaction . create (
231230 Deadline . create ( ) ,
232231 2 ,
233232 1 ,
234- [ new MultisigCosignatoryModification ( MultisigCosignatoryModificationType . Add , cosignAccount1 . publicAccount ) ,
235- new MultisigCosignatoryModification ( MultisigCosignatoryModificationType . Add , cosignAccount2 . publicAccount ) ,
236- new MultisigCosignatoryModification ( MultisigCosignatoryModificationType . Add , cosignAccount3 . publicAccount ) ,
233+ [ new MultisigCosignatoryModification ( CosignatoryModificationAction . Add , cosignAccount1 . publicAccount ) ,
234+ new MultisigCosignatoryModification ( CosignatoryModificationAction . Add , cosignAccount2 . publicAccount ) ,
235+ new MultisigCosignatoryModification ( CosignatoryModificationAction . Add , cosignAccount3 . publicAccount ) ,
237236 ] ,
238237 NetworkType . MIJIN_TEST ,
239238 ) ;
@@ -307,7 +306,7 @@ describe('AccountHttp', () => {
307306 describe ( 'getMultisigAccountGraphInfo' , ( ) => {
308307 it ( 'should call getMultisigAccountGraphInfo successfully' , ( done ) => {
309308 setTimeout ( ( ) => {
310- accountHttp . getMultisigAccountGraphInfo ( multisigAccount . address ) . subscribe ( ( multisigAccountGraphInfo ) => {
309+ accountHttp . getMultisigAccountGraphInfo ( multisigAccount . publicAccount . address ) . subscribe ( ( multisigAccountGraphInfo ) => {
311310 expect ( multisigAccountGraphInfo . multisigAccounts . get ( 0 ) ! [ 0 ] .
312311 account . publicKey ) . to . be . equal ( multisigAccount . publicKey ) ;
313312 done ( ) ;
@@ -318,7 +317,7 @@ describe('AccountHttp', () => {
318317 describe ( 'getMultisigAccountInfo' , ( ) => {
319318 it ( 'should call getMultisigAccountInfo successfully' , ( done ) => {
320319 setTimeout ( ( ) => {
321- accountHttp . getMultisigAccountInfo ( multisigAccount . address ) . subscribe ( ( multisigAccountInfo ) => {
320+ accountHttp . getMultisigAccountInfo ( multisigAccount . publicAccount . address ) . subscribe ( ( multisigAccountInfo ) => {
322321 expect ( multisigAccountInfo . account . publicKey ) . to . be . equal ( multisigAccount . publicKey ) ;
323322 done ( ) ;
324323 } ) ;
@@ -328,7 +327,7 @@ describe('AccountHttp', () => {
328327
329328 describe ( 'outgoingTransactions' , ( ) => {
330329 it ( 'should call outgoingTransactions successfully' , ( done ) => {
331- accountHttp . outgoingTransactions ( publicAccount ) . subscribe ( ( transactions ) => {
330+ accountHttp . outgoingTransactions ( publicAccount . address ) . subscribe ( ( transactions ) => {
332331 expect ( transactions . length ) . to . be . greaterThan ( 0 ) ;
333332 done ( ) ;
334333 } ) ;
@@ -337,7 +336,7 @@ describe('AccountHttp', () => {
337336
338337 describe ( 'aggregateBondedTransactions' , ( ) => {
339338 it ( 'should call aggregateBondedTransactions successfully' , ( done ) => {
340- accountHttp . aggregateBondedTransactions ( publicAccount ) . subscribe ( ( ) => {
339+ accountHttp . aggregateBondedTransactions ( publicAccount . address ) . subscribe ( ( ) => {
341340 done ( ) ;
342341 } , ( error ) => {
343342 console . log ( 'Error:' , error ) ;
@@ -348,7 +347,7 @@ describe('AccountHttp', () => {
348347
349348 describe ( 'transactions' , ( ) => {
350349 it ( 'should call transactions successfully' , ( done ) => {
351- accountHttp . transactions ( publicAccount ) . subscribe ( ( transactions ) => {
350+ accountHttp . transactions ( publicAccount . address ) . subscribe ( ( transactions ) => {
352351 expect ( transactions . length ) . to . be . greaterThan ( 0 ) ;
353352 done ( ) ;
354353 } ) ;
@@ -357,7 +356,7 @@ describe('AccountHttp', () => {
357356
358357 describe ( 'unconfirmedTransactions' , ( ) => {
359358 it ( 'should call unconfirmedTransactions successfully' , ( done ) => {
360- accountHttp . unconfirmedTransactions ( publicAccount ) . subscribe ( ( transactions ) => {
359+ accountHttp . unconfirmedTransactions ( publicAccount . address ) . subscribe ( ( transactions ) => {
361360 expect ( transactions . length ) . to . be . equal ( 0 ) ;
362361 done ( ) ;
363362 } ) ;
@@ -421,17 +420,16 @@ describe('AccountHttp', () => {
421420
422421 it ( 'Announce AccountRestrictionTransaction' , ( done ) => {
423422 const addressPropertyFilter = AccountRestrictionModification . createForAddress (
424- RestrictionModificationType . Remove ,
423+ AccountRestrictionModificationAction . Remove ,
425424 account3 . address ,
426425 ) ;
427426 const addressModification = AccountRestrictionTransaction . createAddressRestrictionModificationTransaction (
428427 Deadline . create ( ) ,
429- AccountRestrictionType . BlockIncomingAddress ,
428+ AccountRestrictionType . AllowIncomingAddress ,
430429 [ addressPropertyFilter ] ,
431430 NetworkType . MIJIN_TEST ,
432431 ) ;
433432 const signedTransaction = addressModification . signWith ( account , generationHash ) ;
434-
435433 listener . confirmed ( account . address ) . subscribe ( ( ) => {
436434 done ( ) ;
437435 } ) ;
@@ -453,29 +451,29 @@ describe('AccountHttp', () => {
453451 after ( ( ) => {
454452 return listener . close ( ) ;
455453 } ) ;
456- it ( 'Announce ModifyMultisigAccountTransaction ' , ( done ) => {
457- const removeCosigner1 = ModifyMultisigAccountTransaction . create (
454+ it ( 'Announce MultisigAccountModificationTransaction ' , ( done ) => {
455+ const removeCosigner1 = MultisigAccountModificationTransaction . create (
458456 Deadline . create ( ) ,
459457 - 1 ,
460458 0 ,
461- [ new MultisigCosignatoryModification ( MultisigCosignatoryModificationType . Remove , cosignAccount1 . publicAccount ) ,
459+ [ new MultisigCosignatoryModification ( CosignatoryModificationAction . Remove , cosignAccount1 . publicAccount ) ,
462460 ] ,
463461 NetworkType . MIJIN_TEST ,
464462 ) ;
465- const removeCosigner2 = ModifyMultisigAccountTransaction . create (
463+ const removeCosigner2 = MultisigAccountModificationTransaction . create (
466464 Deadline . create ( ) ,
467465 0 ,
468466 0 ,
469- [ new MultisigCosignatoryModification ( MultisigCosignatoryModificationType . Remove , cosignAccount2 . publicAccount ) ,
467+ [ new MultisigCosignatoryModification ( CosignatoryModificationAction . Remove , cosignAccount2 . publicAccount ) ,
470468 ] ,
471469 NetworkType . MIJIN_TEST ,
472470 ) ;
473471
474- const removeCosigner3 = ModifyMultisigAccountTransaction . create (
472+ const removeCosigner3 = MultisigAccountModificationTransaction . create (
475473 Deadline . create ( ) ,
476474 - 1 ,
477475 - 1 ,
478- [ new MultisigCosignatoryModification ( MultisigCosignatoryModificationType . Remove , cosignAccount3 . publicAccount ) ,
476+ [ new MultisigCosignatoryModification ( CosignatoryModificationAction . Remove , cosignAccount3 . publicAccount ) ,
479477 ] ,
480478 NetworkType . MIJIN_TEST ,
481479 ) ;
0 commit comments