@@ -18,16 +18,17 @@ import {deepEqual} from 'assert';
18
18
import { assert , expect } from 'chai' ;
19
19
import { AccountHttp } from '../../src/infrastructure/AccountHttp' ;
20
20
import { Listener , TransactionHttp } from '../../src/infrastructure/infrastructure' ;
21
+ import { RestrictionHttp } from '../../src/infrastructure/RestrictionHttp' ;
21
22
import { Account } from '../../src/model/account/Account' ;
22
- import { AccountRestrictionModificationAction } from '../../src/model/account/AccountRestrictionModificationAction' ;
23
- import { AccountRestrictionType } from '../../src/model/account/AccountRestrictionType' ;
24
23
import { Address } from '../../src/model/account/Address' ;
25
24
import { PublicAccount } from '../../src/model/account/PublicAccount' ;
26
25
import { NetworkType } from '../../src/model/blockchain/NetworkType' ;
27
26
import { PlainMessage } from '../../src/model/message/PlainMessage' ;
28
27
import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic' ;
29
28
import { AliasAction } from '../../src/model/namespace/AliasAction' ;
30
29
import { NamespaceId } from '../../src/model/namespace/NamespaceId' ;
30
+ import { AccountRestrictionModificationAction } from '../../src/model/restriction/AccountRestrictionModificationAction' ;
31
+ import { AccountRestrictionType } from '../../src/model/restriction/AccountRestrictionType' ;
31
32
import { AccountRestrictionModification } from '../../src/model/transaction/AccountRestrictionModification' ;
32
33
import { AccountRestrictionTransaction } from '../../src/model/transaction/AccountRestrictionTransaction' ;
33
34
import { AddressAliasTransaction } from '../../src/model/transaction/AddressAliasTransaction' ;
@@ -52,6 +53,7 @@ describe('AccountHttp', () => {
52
53
let accountPublicKey : string ;
53
54
let publicAccount : PublicAccount ;
54
55
let accountHttp : AccountHttp ;
56
+ let restrictionHttp : RestrictionHttp ;
55
57
let transactionHttp : TransactionHttp ;
56
58
let namespaceId : NamespaceId ;
57
59
let generationHash : string ;
@@ -78,6 +80,7 @@ describe('AccountHttp', () => {
78
80
generationHash = json . generationHash ;
79
81
accountHttp = new AccountHttp ( json . apiUrl ) ;
80
82
transactionHttp = new TransactionHttp ( json . apiUrl ) ;
83
+ restrictionHttp = new RestrictionHttp ( json . apiUrl ) ;
81
84
done ( ) ;
82
85
} ) ;
83
86
} ) ;
@@ -183,39 +186,6 @@ describe('AccountHttp', () => {
183
186
} ) ;
184
187
} ) ;
185
188
186
- describe ( 'Setup Test AccountAddressRestriction' , ( ) => {
187
- let listener : Listener ;
188
- before ( ( ) => {
189
- listener = new Listener ( config . apiUrl ) ;
190
- return listener . open ( ) ;
191
- } ) ;
192
- after ( ( ) => {
193
- return listener . close ( ) ;
194
- } ) ;
195
-
196
- it ( 'Announce AccountRestrictionTransaction' , ( done ) => {
197
- const addressPropertyFilter = AccountRestrictionModification . createForAddress (
198
- AccountRestrictionModificationAction . Add ,
199
- account3 . address ,
200
- ) ;
201
- const addressModification = AccountRestrictionTransaction . createAddressRestrictionModificationTransaction (
202
- Deadline . create ( ) ,
203
- AccountRestrictionType . AllowIncomingAddress ,
204
- [ addressPropertyFilter ] ,
205
- NetworkType . MIJIN_TEST ,
206
- ) ;
207
- const signedTransaction = addressModification . signWith ( account , generationHash ) ;
208
- listener . confirmed ( account . address ) . subscribe ( ( ) => {
209
- done ( ) ;
210
- } ) ;
211
- listener . status ( account . address ) . subscribe ( ( error ) => {
212
- console . log ( 'Error:' , error ) ;
213
- assert ( false ) ;
214
- done ( ) ;
215
- } ) ;
216
- transactionHttp . announce ( signedTransaction ) ;
217
- } ) ;
218
- } ) ;
219
189
describe ( 'Setup test multisig account' , ( ) => {
220
190
let listener : Listener ;
221
191
before ( ( ) => {
@@ -281,28 +251,6 @@ describe('AccountHttp', () => {
281
251
} ) ;
282
252
} ) ;
283
253
284
- describe ( 'getAccountRestrictions' , ( ) => {
285
- it ( 'should call getAccountRestrictions successfully' , ( done ) => {
286
- setTimeout ( ( ) => {
287
- accountHttp . getAccountRestrictions ( accountAddress ) . subscribe ( ( accountRestrictions ) => {
288
- deepEqual ( accountRestrictions . accountRestrictions . address , accountAddress ) ;
289
- done ( ) ;
290
- } ) ;
291
- } , 1000 ) ;
292
- } ) ;
293
- } ) ;
294
-
295
- describe ( 'getAccountRestrictionsFromAccounts' , ( ) => {
296
- it ( 'should call getAccountRestrictionsFromAccounts successfully' , ( done ) => {
297
- setTimeout ( ( ) => {
298
- accountHttp . getAccountRestrictionsFromAccounts ( [ accountAddress ] ) . subscribe ( ( accountRestrictions ) => {
299
- deepEqual ( accountRestrictions [ 0 ] ! . accountRestrictions . address , accountAddress ) ;
300
- done ( ) ;
301
- } ) ;
302
- } , 1000 ) ;
303
- } ) ;
304
- } ) ;
305
-
306
254
describe ( 'getMultisigAccountGraphInfo' , ( ) => {
307
255
it ( 'should call getMultisigAccountGraphInfo successfully' , ( done ) => {
308
256
setTimeout ( ( ) => {
@@ -408,39 +356,6 @@ describe('AccountHttp', () => {
408
356
transactionHttp . announce ( signedTransaction ) ;
409
357
} ) ;
410
358
} ) ;
411
- describe ( 'Remove test AccountRestriction - Address' , ( ) => {
412
- let listener : Listener ;
413
- before ( ( ) => {
414
- listener = new Listener ( config . apiUrl ) ;
415
- return listener . open ( ) ;
416
- } ) ;
417
- after ( ( ) => {
418
- return listener . close ( ) ;
419
- } ) ;
420
-
421
- it ( 'Announce AccountRestrictionTransaction' , ( done ) => {
422
- const addressPropertyFilter = AccountRestrictionModification . createForAddress (
423
- AccountRestrictionModificationAction . Remove ,
424
- account3 . address ,
425
- ) ;
426
- const addressModification = AccountRestrictionTransaction . createAddressRestrictionModificationTransaction (
427
- Deadline . create ( ) ,
428
- AccountRestrictionType . AllowIncomingAddress ,
429
- [ addressPropertyFilter ] ,
430
- NetworkType . MIJIN_TEST ,
431
- ) ;
432
- const signedTransaction = addressModification . signWith ( account , generationHash ) ;
433
- listener . confirmed ( account . address ) . subscribe ( ( ) => {
434
- done ( ) ;
435
- } ) ;
436
- listener . status ( account . address ) . subscribe ( ( error ) => {
437
- console . log ( 'Error:' , error ) ;
438
- assert ( false ) ;
439
- done ( ) ;
440
- } ) ;
441
- transactionHttp . announce ( signedTransaction ) ;
442
- } ) ;
443
- } ) ;
444
359
445
360
describe ( 'Restore test multisig Accounts' , ( ) => {
446
361
let listener : Listener ;
0 commit comments