Skip to content

Commit 881bfdf

Browse files
committed
More renames
1 parent 3a2ead6 commit 881bfdf

23 files changed

+221
-219
lines changed

e2e/infrastructure/AccountHttp.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import {AccountHttp} from '../../src/infrastructure/AccountHttp';
2020
import { Listener, TransactionHttp } from '../../src/infrastructure/infrastructure';
2121
import { Account } from '../../src/model/account/Account';
2222
import {Address} from '../../src/model/account/Address';
23-
import { PropertyModificationType } from '../../src/model/account/PropertyModificationType';
24-
import { PropertyType } from '../../src/model/account/PropertyType';
23+
import { RestrictionModificationType } from '../../src/model/account/RestrictionModificationType';
24+
import { RestrictionType } from '../../src/model/account/RestrictionType';
2525
import {PublicAccount} from '../../src/model/account/PublicAccount';
2626
import {NetworkType} from '../../src/model/blockchain/NetworkType';
2727
import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic';
@@ -195,12 +195,12 @@ describe('AccountHttp', () => {
195195

196196
it('Announce AccountRestrictionTransaction', (done) => {
197197
const addressPropertyFilter = AccountRestrictionModification.createForAddress(
198-
PropertyModificationType.Add,
198+
RestrictionModificationType.Add,
199199
account3.address,
200200
);
201201
const addressModification = AccountRestrictionTransaction.createAddressPropertyModificationTransaction(
202202
Deadline.create(),
203-
PropertyType.BlockAddress,
203+
RestrictionType.BlockAddress,
204204
[addressPropertyFilter],
205205
NetworkType.MIJIN_TEST,
206206
);
@@ -286,7 +286,7 @@ describe('AccountHttp', () => {
286286
it('should call getAccountProperty successfully', (done) => {
287287
setTimeout(() => {
288288
accountHttp.getAccountProperties(accountAddress).subscribe((accountProperty) => {
289-
deepEqual(accountProperty.accountProperties.address, accountAddress);
289+
deepEqual(accountProperty.accountRestrictions.address, accountAddress);
290290
done();
291291
});
292292
}, 1000);
@@ -297,7 +297,7 @@ describe('AccountHttp', () => {
297297
it('should call getAccountProperties successfully', (done) => {
298298
setTimeout(() => {
299299
accountHttp.getAccountPropertiesFromAccounts([accountAddress]).subscribe((accountProperties) => {
300-
deepEqual(accountProperties[0]!.accountProperties.address, accountAddress);
300+
deepEqual(accountProperties[0]!.accountRestrictions.address, accountAddress);
301301
done();
302302
});
303303
}, 1000);
@@ -421,12 +421,12 @@ describe('AccountHttp', () => {
421421

422422
it('Announce AccountRestrictionTransaction', (done) => {
423423
const addressPropertyFilter = AccountRestrictionModification.createForAddress(
424-
PropertyModificationType.Remove,
424+
RestrictionModificationType.Remove,
425425
account3.address,
426426
);
427427
const addressModification = AccountRestrictionTransaction.createAddressPropertyModificationTransaction(
428428
Deadline.create(),
429-
PropertyType.BlockAddress,
429+
RestrictionType.BlockAddress,
430430
[addressPropertyFilter],
431431
NetworkType.MIJIN_TEST,
432432
);

e2e/infrastructure/TransactionHttp.spec.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import {Listener} from '../../src/infrastructure/Listener';
2525
import {TransactionHttp} from '../../src/infrastructure/TransactionHttp';
2626
import {Account} from '../../src/model/account/Account';
2727
import {Address} from '../../src/model/account/Address';
28-
import { PropertyModificationType } from '../../src/model/account/PropertyModificationType';
29-
import { PropertyType } from '../../src/model/account/PropertyType';
28+
import { RestrictionModificationType } from '../../src/model/account/RestrictionModificationType';
29+
import { RestrictionType } from '../../src/model/account/RestrictionType';
3030
import {PublicAccount} from '../../src/model/account/PublicAccount';
3131
import {NetworkType} from '../../src/model/blockchain/NetworkType';
3232
import { Mosaic } from '../../src/model/mosaic/Mosaic';
@@ -284,12 +284,12 @@ describe('TransactionHttp', () => {
284284

285285
it('standalone', (done) => {
286286
const addressPropertyFilter = AccountRestrictionModification.createForAddress(
287-
PropertyModificationType.Add,
287+
RestrictionModificationType.Add,
288288
account3.address,
289289
);
290290
const addressModification = AccountRestrictionTransaction.createAddressPropertyModificationTransaction(
291291
Deadline.create(),
292-
PropertyType.BlockAddress,
292+
RestrictionType.BlockAddress,
293293
[addressPropertyFilter],
294294
NetworkType.MIJIN_TEST,
295295
);
@@ -299,7 +299,7 @@ describe('TransactionHttp', () => {
299299
expect(transaction.modifications, 'Modifications').not.to.be.undefined;
300300
expect(transaction.modifications[0].modificationType, 'Modifications.ModificationType').not.to.be.undefined;
301301
expect(transaction.modifications[0].value, 'Modifications.Value').not.to.be.undefined;
302-
expect(transaction.propertyType, 'PropertyType').not.to.be.undefined;
302+
expect(transaction.restrictionType, 'PropertyType').not.to.be.undefined;
303303
done();
304304
});
305305
listener.status(account.address).subscribe((error) => {
@@ -321,12 +321,12 @@ describe('TransactionHttp', () => {
321321
});
322322
it('aggregate', (done) => {
323323
const addressPropertyFilter = AccountRestrictionModification.createForAddress(
324-
PropertyModificationType.Remove,
324+
RestrictionModificationType.Remove,
325325
account3.address,
326326
);
327327
const addressModification = AccountRestrictionTransaction.createAddressPropertyModificationTransaction(
328328
Deadline.create(),
329-
PropertyType.BlockAddress,
329+
RestrictionType.BlockAddress,
330330
[addressPropertyFilter],
331331
NetworkType.MIJIN_TEST,
332332
);
@@ -359,12 +359,12 @@ describe('TransactionHttp', () => {
359359

360360
it('standalone', (done) => {
361361
const mosaicPropertyFilter = AccountRestrictionModification.createForMosaic(
362-
PropertyModificationType.Add,
362+
RestrictionModificationType.Add,
363363
mosaicId,
364364
);
365365
const addressModification = AccountRestrictionTransaction.createMosaicPropertyModificationTransaction(
366366
Deadline.create(),
367-
PropertyType.BlockMosaic,
367+
RestrictionType.BlockMosaic,
368368
[mosaicPropertyFilter],
369369
NetworkType.MIJIN_TEST,
370370
);
@@ -374,7 +374,7 @@ describe('TransactionHttp', () => {
374374
expect(transaction.modifications, 'Modifications').not.to.be.undefined;
375375
expect(transaction.modifications[0].modificationType, 'Modifications.ModificationType').not.to.be.undefined;
376376
expect(transaction.modifications[0].value, 'Modifications.Value').not.to.be.undefined;
377-
expect(transaction.propertyType, 'PropertyType').not.to.be.undefined;
377+
expect(transaction.restrictionType, 'PropertyType').not.to.be.undefined;
378378
done();
379379
});
380380
listener.status(account.address).subscribe((error) => {
@@ -396,12 +396,12 @@ describe('TransactionHttp', () => {
396396
});
397397
it('aggregate', (done) => {
398398
const mosaicPropertyFilter = AccountRestrictionModification.createForMosaic(
399-
PropertyModificationType.Remove,
399+
RestrictionModificationType.Remove,
400400
mosaicId,
401401
);
402402
const addressModification = AccountRestrictionTransaction.createMosaicPropertyModificationTransaction(
403403
Deadline.create(),
404-
PropertyType.BlockMosaic,
404+
RestrictionType.BlockMosaic,
405405
[mosaicPropertyFilter],
406406
NetworkType.MIJIN_TEST,
407407
);
@@ -434,12 +434,12 @@ describe('TransactionHttp', () => {
434434

435435
it('standalone', (done) => {
436436
const entityTypePropertyFilter = AccountRestrictionModification.createForEntityType(
437-
PropertyModificationType.Add,
437+
RestrictionModificationType.Add,
438438
TransactionType.LINK_ACCOUNT,
439439
);
440440
const addressModification = AccountRestrictionTransaction.createEntityTypePropertyModificationTransaction(
441441
Deadline.create(),
442-
PropertyType.BlockTransaction,
442+
RestrictionType.BlockTransaction,
443443
[entityTypePropertyFilter],
444444
NetworkType.MIJIN_TEST,
445445
);
@@ -449,7 +449,7 @@ describe('TransactionHttp', () => {
449449
expect(transaction.modifications, 'Modifications').not.to.be.undefined;
450450
expect(transaction.modifications[0].modificationType, 'Modifications.ModificationType').not.to.be.undefined;
451451
expect(transaction.modifications[0].value, 'Modifications.Value').not.to.be.undefined;
452-
expect(transaction.propertyType, 'PropertyType').not.to.be.undefined;
452+
expect(transaction.restrictionType, 'PropertyType').not.to.be.undefined;
453453
done();
454454
});
455455
listener.status(account3.address).subscribe((error) => {
@@ -471,12 +471,12 @@ describe('TransactionHttp', () => {
471471
});
472472
it('aggregate', (done) => {
473473
const entityTypePropertyFilter = AccountRestrictionModification.createForEntityType(
474-
PropertyModificationType.Remove,
474+
RestrictionModificationType.Remove,
475475
TransactionType.LINK_ACCOUNT,
476476
);
477477
const addressModification = AccountRestrictionTransaction.createEntityTypePropertyModificationTransaction(
478478
Deadline.create(),
479-
PropertyType.BlockTransaction,
479+
RestrictionType.BlockTransaction,
480480
[entityTypePropertyFilter],
481481
NetworkType.MIJIN_TEST,
482482
);

src/core/utils/DtoMapping.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { AccountProperties } from '../../model/account/AccountProperties';
18-
import { AccountPropertiesInfo } from '../../model/account/AccountPropertiesInfo';
19-
import { AccountProperty } from '../../model/account/AccountProperty';
17+
import { AccountRestrictions } from '../../model/account/AccountRestrictions';
18+
import { AccountRestrictionsInfo } from '../../model/account/AccountRestrictionsInfo';
19+
import { AccountRestriction } from '../../model/account/AccountRestriction';
2020
import { Address } from '../../model/account/Address';
21-
import { PropertyType } from '../../model/account/PropertyType';
21+
import { RestrictionType } from '../../model/account/RestrictionType';
2222
import { MosaicId } from '../../model/mosaic/MosaicId';
2323

2424
export class DtoMapping {
@@ -28,23 +28,23 @@ export class DtoMapping {
2828
* @param {object} dataJson The account property json object.
2929
* @returns {module: model/Account/AccountPropertiesInfo} The AccountPropertiesInfo class.
3030
*/
31-
public static extractAccountPropertyFromDto(accountProperties): AccountPropertiesInfo {
32-
return new AccountPropertiesInfo(
31+
public static extractAccountPropertyFromDto(accountProperties): AccountRestrictionsInfo {
32+
return new AccountRestrictionsInfo(
3333
accountProperties.meta,
34-
new AccountProperties(Address.createFromEncoded(accountProperties.accountProperties.address),
34+
new AccountRestrictions(Address.createFromEncoded(accountProperties.accountProperties.address),
3535
accountProperties.accountProperties.properties.map((prop) => {
3636
switch (prop.propertyType) {
37-
case PropertyType.AllowAddress:
38-
case PropertyType.BlockAddress:
39-
return new AccountProperty(prop.propertyType,
37+
case RestrictionType.AllowAddress:
38+
case RestrictionType.BlockAddress:
39+
return new AccountRestriction(prop.propertyType,
4040
prop.values.map((value) => Address.createFromEncoded(value)));
41-
case PropertyType.AllowMosaic:
42-
case PropertyType.BlockMosaic:
43-
return new AccountProperty(prop.propertyType,
41+
case RestrictionType.AllowMosaic:
42+
case RestrictionType.BlockMosaic:
43+
return new AccountRestriction(prop.propertyType,
4444
prop.values.map((value) => new MosaicId(value)));
45-
case PropertyType.AllowTransaction:
46-
case PropertyType.BlockTransaction:
47-
return new AccountProperty(prop.propertyType, prop.values);
45+
case RestrictionType.AllowTransaction:
46+
case RestrictionType.BlockTransaction:
47+
return new AccountRestriction(prop.propertyType, prop.values);
4848
default:
4949
throw new Error(`Invalid property type: ${prop.propertyType}`);
5050
}

src/infrastructure/AccountHttp.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {map, mergeMap} from 'rxjs/operators';
1919
import { DtoMapping } from '../core/utils/DtoMapping';
2020
import {AccountInfo} from '../model/account/AccountInfo';
2121
import { AccountNames } from '../model/account/AccountNames';
22-
import { AccountPropertiesInfo } from '../model/account/AccountPropertiesInfo';
22+
import { AccountRestrictionsInfo } from '../model/account/AccountRestrictionsInfo';
2323
import {Address} from '../model/account/Address';
2424
import {MultisigAccountGraphInfo} from '../model/account/MultisigAccountGraphInfo';
2525
import {MultisigAccountInfo} from '../model/account/MultisigAccountInfo';
@@ -97,7 +97,7 @@ export class AccountHttp extends Http implements AccountRepository {
9797
* @param publicAccount public account
9898
* @returns Observable<AccountProperty>
9999
*/
100-
public getAccountProperties(address: Address): Observable<AccountPropertiesInfo> {
100+
public getAccountProperties(address: Address): Observable<AccountRestrictionsInfo> {
101101
return observableFrom(this.accountRoutesApi.getAccountProperties(address.plain()))
102102
.pipe(map((accountProperties: AccountPropertiesInfoDTO) => {
103103
return DtoMapping.extractAccountPropertyFromDto(accountProperties);
@@ -109,7 +109,7 @@ export class AccountHttp extends Http implements AccountRepository {
109109
* @param address list of addresses
110110
* @returns Observable<AccountProperty[]>
111111
*/
112-
public getAccountPropertiesFromAccounts(addresses: Address[]): Observable<AccountPropertiesInfo[]> {
112+
public getAccountPropertiesFromAccounts(addresses: Address[]): Observable<AccountRestrictionsInfo[]> {
113113
const accountIds = {
114114
addresses: addresses.map((address) => address.plain()),
115115
};

src/infrastructure/AccountRepository.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {PublicAccount} from '../model/account/PublicAccount';
2323
import {AggregateTransaction} from '../model/transaction/AggregateTransaction';
2424
import {Transaction} from '../model/transaction/Transaction';
2525
import {QueryParams} from './QueryParams';
26-
import {AccountPropertiesInfo} from "../model/account/AccountPropertiesInfo";
26+
import {AccountRestrictionsInfo} from "../model/account/AccountRestrictionsInfo";
2727
import { AccountNames } from '../model/account/AccountNames';
2828

2929
/**
@@ -60,14 +60,14 @@ export interface AccountRepository {
6060
* @param publicAccount public account
6161
* @returns Observable<AccountProperty>
6262
*/
63-
getAccountProperties(address: Address): Observable<AccountPropertiesInfo>;
63+
getAccountProperties(address: Address): Observable<AccountRestrictionsInfo>;
6464

6565
/**
6666
* Gets Account properties.
6767
* @param address list of addresses
6868
* @returns Observable<AccountProperty[]>
6969
*/
70-
getAccountPropertiesFromAccounts(addresses: Address[]): Observable<AccountPropertiesInfo[]>;
70+
getAccountPropertiesFromAccounts(addresses: Address[]): Observable<AccountRestrictionsInfo[]>;
7171

7272
/**
7373
* Gets a MultisigAccountInfo for an account.

src/infrastructure/transaction/SerializeTransactionToJSON.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,23 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => {
7070
};
7171
case TransactionType.MODIFY_ACCOUNT_PROPERTY_ADDRESS:
7272
return {
73-
propertyType: (transaction as AccountAddressRestrictionModificationTransaction).propertyType,
73+
propertyType: (transaction as AccountAddressRestrictionModificationTransaction).restrictionType,
7474
modifications: (transaction as AccountAddressRestrictionModificationTransaction).
7575
modifications.map((modification) => {
7676
return modification.toDTO();
7777
}),
7878
};
7979
case TransactionType.MODIFY_ACCOUNT_PROPERTY_ENTITY_TYPE:
8080
return {
81-
propertyType: (transaction as AccountOperationRestrictionModificationTransaction).propertyType,
81+
propertyType: (transaction as AccountOperationRestrictionModificationTransaction).restrictionType,
8282
modifications: (transaction as AccountOperationRestrictionModificationTransaction).
8383
modifications.map((modification) => {
8484
return modification.toDTO();
8585
}),
8686
};
8787
case TransactionType.MODIFY_ACCOUNT_PROPERTY_MOSAIC:
8888
return {
89-
propertyType: (transaction as AccountMosaicRestrictionModificationTransaction).propertyType,
89+
propertyType: (transaction as AccountMosaicRestrictionModificationTransaction).restrictionType,
9090
modifications: (transaction as AccountMosaicRestrictionModificationTransaction).modifications.map((modification) => {
9191
return modification.toDTO();
9292
}),

src/model/account/AccountProperty.ts renamed to src/model/account/AccountRestriction.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,24 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { PropertyType } from './PropertyType';
17+
import { RestrictionType } from './RestrictionType';
1818
/**
19-
* Account property structure describes property information.
19+
* Account restriction structure describes restriction information.
2020
*/
21-
export class AccountProperty {
21+
export class AccountRestriction {
2222

2323
/**
2424
* Constructor
25-
* @param propertyType
25+
* @param restrictionType
2626
* @param values
2727
*/
2828
constructor(
2929
/**
30-
* Account property type
30+
* Account restriction type
3131
*/
32-
public readonly propertyType: PropertyType,
32+
public readonly restrictionType: RestrictionType,
3333
/**
34-
* Property values.
34+
* Restriction values.
3535
*/
3636
public readonly values: object[]) {
3737

src/model/account/AccountProperties.ts renamed to src/model/account/AccountRestrictions.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import { AccountProperty } from './AccountProperty';
16+
import { AccountRestriction } from './AccountRestriction';
1717
import { Address } from './Address';
1818
/**
19-
* Account properties structure describes property information for an account.
19+
* Account restrictions structure describes restriction information for an account.
2020
*/
21-
export class AccountProperties {
21+
export class AccountRestrictions {
2222

2323
/**
2424
* Constructor
2525
* @param address
26-
* @param properties
26+
* @param restrictions
2727
*/
2828
constructor(
2929
/**
3030
* Account Address
3131
*/
3232
public readonly address: Address,
3333
/**
34-
* Properties.
34+
* Restrictions.
3535
*/
36-
public readonly properties: AccountProperty[]) {
36+
public readonly restrictions: AccountRestriction[]) {
3737

3838
}
3939
}

0 commit comments

Comments
 (0)