Skip to content

Commit 47c0689

Browse files
committed
Fixed a few issues raised from PR
1 parent a746ed4 commit 47c0689

File tree

16 files changed

+41
-36
lines changed

16 files changed

+41
-36
lines changed

e2e/infrastructure/BlockHttp.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ describe('BlockHttp', () => {
8080
listener.confirmed(account.address).subscribe((transaction: Transaction) => {
8181

8282
chainHeight = transaction.transactionInfo!.height.lower;
83-
console.log(`Test chain height: ${chainHeight}`);
8483
done();
8584
});
8685
listener.status(account.address).subscribe((error) => {

src/infrastructure/AccountHttp.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {PublicAccount} from '../model/account/PublicAccount';
2828
import {Mosaic} from '../model/mosaic/Mosaic';
2929
import {MosaicId} from '../model/mosaic/MosaicId';
3030
import { NamespaceId } from '../model/namespace/NamespaceId';
31+
import { NamespaceName } from '../model/namespace/NamespaceName';
3132
import {AggregateTransaction} from '../model/transaction/AggregateTransaction';
3233
import {Transaction} from '../model/transaction/Transaction';
3334
import {UInt64} from '../model/UInt64';
@@ -147,7 +148,7 @@ export class AccountHttp extends Http implements AccountRepository {
147148
return new AccountNames(
148149
Address.createFromEncoded(accountName.address),
149150
accountName.names.map((name) => {
150-
new NamespaceId(name);
151+
new NamespaceName(new NamespaceId(name), name);
151152
}),
152153
);
153154
});

src/infrastructure/BlockHttp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 NEM
2+
* Copyright 2019 NEM
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/infrastructure/BlockRepository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 NEM
2+
* Copyright 2019 NEM
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/infrastructure/ChainHttp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 NEM
2+
* Copyright 2019 NEM
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/infrastructure/MosaicHttp.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ import {MosaicId} from '../model/mosaic/MosaicId';
2222
import {MosaicInfo} from '../model/mosaic/MosaicInfo';
2323
import { MosaicNames } from '../model/mosaic/MosaicNames';
2424
import {MosaicProperties} from '../model/mosaic/MosaicProperties';
25-
import { MosaicPropertyIdEnum } from '../model/mosaic/MosaicPropertyIdEnum';
25+
import { MosaicPropertyType } from '../model/mosaic/MosaicPropertyType';
2626
import {NamespaceId} from '../model/namespace/NamespaceId';
27+
import { NamespaceName } from '../model/namespace/NamespaceName';
2728
import {UInt64} from '../model/UInt64';
2829
import {Http} from './Http';
2930
import {MosaicRepository} from './MosaicRepository';
@@ -69,9 +70,9 @@ export class MosaicHttp extends Http implements MosaicRepository {
6970
PublicAccount.createFromPublicKey(mosaicInfoDTO.mosaic.owner, networkType),
7071
mosaicInfoDTO.mosaic.revision,
7172
new MosaicProperties(
72-
new UInt64(mosaicInfoDTO.mosaic.properties[MosaicPropertyIdEnum.MosaicFlags].value),
73-
(new UInt64(mosaicInfoDTO.mosaic.properties[MosaicPropertyIdEnum.Divisibility].value)).compact(),
74-
new UInt64(mosaicInfoDTO.mosaic.properties[MosaicPropertyIdEnum.Duration].value),
73+
new UInt64(mosaicInfoDTO.mosaic.properties[MosaicPropertyType.MosaicFlags].value),
74+
(new UInt64(mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Divisibility].value)).compact(),
75+
new UInt64(mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Duration].value),
7576
),
7677
);
7778
}))));
@@ -98,9 +99,9 @@ export class MosaicHttp extends Http implements MosaicRepository {
9899
PublicAccount.createFromPublicKey(mosaicInfoDTO.mosaic.owner, networkType),
99100
mosaicInfoDTO.mosaic.revision,
100101
new MosaicProperties(
101-
new UInt64(mosaicInfoDTO.mosaic.properties[MosaicPropertyIdEnum.MosaicFlags].value),
102-
(new UInt64(mosaicInfoDTO.mosaic.properties[MosaicPropertyIdEnum.Divisibility].value)).compact(),
103-
new UInt64(mosaicInfoDTO.mosaic.properties[MosaicPropertyIdEnum.Duration].value),
102+
new UInt64(mosaicInfoDTO.mosaic.properties[MosaicPropertyType.MosaicFlags].value),
103+
(new UInt64(mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Divisibility].value)).compact(),
104+
new UInt64(mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Duration].value),
104105
),
105106
);
106107
});
@@ -123,7 +124,7 @@ export class MosaicHttp extends Http implements MosaicRepository {
123124
return new MosaicNames(
124125
new MosaicId(mosaic.mosaicId),
125126
mosaic.names.map((name) => {
126-
new NamespaceId(name);
127+
new NamespaceName(new NamespaceId(name), name);
127128
}),
128129
);
129130
});

src/infrastructure/receipt/CreateReceiptFromDTO.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ import {UInt64} from '../../model/UInt64';
3939
* @param receiptDTO
4040
* @param networkType
4141
* @returns {Statement}
42+
* @see https://github.com/nemtech/catapult-server/blob/master/src/catapult/model/ReceiptType.h
43+
* @see https://github.com/nemtech/catapult-server/blob/master/src/catapult/model/ReceiptType.cpp
4244
* @constructor
4345
*/
4446
export const CreateStatementFromDTO = (receiptDTO, networkType): Statement => {

src/infrastructure/transaction/CreateTransactionFromDTO.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {Id} from '../../model/Id';
2222
import {Mosaic} from '../../model/mosaic/Mosaic';
2323
import {MosaicId} from '../../model/mosaic/MosaicId';
2424
import {MosaicProperties} from '../../model/mosaic/MosaicProperties';
25-
import { MosaicPropertyIdEnum } from '../../model/mosaic/MosaicPropertyIdEnum';
25+
import { MosaicPropertyType } from '../../model/mosaic/MosaicPropertyType';
2626
import {NamespaceId} from '../../model/namespace/NamespaceId';
2727
import { AccountLinkTransaction } from '../../model/transaction/AccountLinkTransaction';
2828
import {AccountPropertyModification} from '../../model/transaction/AccountPropertyModification';
@@ -160,10 +160,10 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr
160160
transactionDTO.nonce,
161161
new MosaicId(transactionDTO.mosaicId),
162162
new MosaicProperties(
163-
new UInt64(transactionDTO.properties[MosaicPropertyIdEnum.MosaicFlags].value),
164-
(new UInt64(transactionDTO.properties[MosaicPropertyIdEnum.Divisibility].value)).compact(),
165-
transactionDTO.properties.length === 3 && transactionDTO.properties[MosaicPropertyIdEnum.Duration].value ?
166-
new UInt64(transactionDTO.properties[MosaicPropertyIdEnum.Duration].value) : undefined,
163+
new UInt64(transactionDTO.properties[MosaicPropertyType.MosaicFlags].value),
164+
(new UInt64(transactionDTO.properties[MosaicPropertyType.Divisibility].value)).compact(),
165+
transactionDTO.properties.length === 3 && transactionDTO.properties[MosaicPropertyType.Duration].value ?
166+
new UInt64(transactionDTO.properties[MosaicPropertyType.Duration].value) : undefined,
167167
),
168168
transactionDTO.signature,
169169
transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer,

src/model/account/AccountNames.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 NEM
2+
* Copyright 2019 NEM
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { NamespaceId } from '../namespace/NamespaceId';
17+
import { NamespaceName } from '../namespace/NamespaceName';
1818
import {Address} from './Address';
1919

2020
/**
@@ -31,9 +31,9 @@ export class AccountNames {
3131
*/
3232
public readonly address: Address,
3333
/**
34-
* Address linked namespace names
34+
* Address linked namespace Ids
3535
*/
36-
public readonly names: NamespaceId[]) {
36+
public readonly names: NamespaceName[]) {
3737

3838
}
3939
}

src/model/model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export * from '../service/MosaicAmountView';
5555
export * from './mosaic/NetworkCurrencyMosaic';
5656
export * from './mosaic/NetworkHarvestMosaic';
5757
export * from './mosaic/MosaicNames';
58-
export * from './mosaic/MosaicPropertyIdEnum';
58+
export * from './mosaic/MosaicPropertyType';
5959

6060
// Namespace
6161
export * from '../service/Namespace';

0 commit comments

Comments
 (0)