Skip to content

Commit 869502e

Browse files
committed
Merge branch '400-OpenApiGeneratedLibrary' of github.com:NEMStudios/nem2-sdk-typescript-javascript into 400-OpenApiGeneratedLibrary
2 parents 3f4ecba + 912b69e commit 869502e

File tree

7 files changed

+14
-10
lines changed

7 files changed

+14
-10
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/infrastructure/TransactionHttp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ export class TransactionHttp extends Http implements TransactionRepository {
126126
*/
127127
private toTransactionStatus(dto: TransactionStatusDTO): TransactionStatus {
128128
return new TransactionStatus(
129-
dto.group.toString(),
129+
dto.group,
130130
dto.hash,
131131
Deadline.createFromDTO(UInt64.fromNumericString(dto.deadline).toDTO()),
132-
dto.code ? dto.code.toString() : '',
132+
dto.code,
133133
dto.height ? UInt64.fromNumericString(dto.height) : undefined);
134134
}
135135

src/model/model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ export * from './transaction/MosaicAddressRestrictionTransaction';
158158

159159
// Wallet
160160
export * from './wallet/EncryptedPrivateKey';
161+
export * from './wallet/ISimpleWalletDTO';
161162
export * from './wallet/Password';
162163
export * from './wallet/SimpleWallet';
163164
export * from './wallet/Wallet';

src/model/transaction/TransactionStatus.ts

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

17+
import { TransactionStateTypeEnum, TransactionStatusTypeEnum } from 'nem2-sdk-openapi-typescript-node-client';
1718
import {UInt64} from '../UInt64';
1819
import {Deadline} from './Deadline';
1920

@@ -33,7 +34,7 @@ export class TransactionStatus {
3334
/**
3435
* The transaction status group "failed", "unconfirmed", "confirmed", etc...
3536
*/
36-
public readonly group: string,
37+
public readonly group: TransactionStateTypeEnum,
3738
/**
3839
* The transaction hash.
3940
*/
@@ -45,7 +46,7 @@ export class TransactionStatus {
4546
/**
4647
* The transaction status code being the error name in case of failure and success otherwise.
4748
*/
48-
public readonly code?: string,
49+
public readonly code?: TransactionStatusTypeEnum,
4950
/**
5051
* The height of the block at which it was confirmed or rejected.
5152
*/
File renamed without changes.

src/model/wallet/SimpleWallet.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
import {LocalDateTime} from 'js-joda';
1818
import {Crypto, KeyPair, SHA3Hasher} from '../../core/crypto';
1919
import {Convert as convert} from '../../core/format';
20-
import {ISimpleWalletDTO} from '../../infrastructure/wallet/simpleWalletDTO';
2120
import {Account} from '../account/Account';
2221
import {Address} from '../account/Address';
2322
import {NetworkType} from '../blockchain/NetworkType';
2423
import {EncryptedPrivateKey} from './EncryptedPrivateKey';
24+
import {ISimpleWalletDTO} from './ISimpleWalletDTO';
2525
import {Password} from './Password';
2626
import {Wallet} from './Wallet';
2727

@@ -109,8 +109,9 @@ export class SimpleWallet extends Wallet {
109109
/**
110110
* Instantiate a SimpleWallet from a DTO
111111
* @param simpleWalletDTO simple wallet without prototype
112+
* @returns {SimpleWallet}
112113
*/
113-
static createFromDTO(simpleWalletDTO: ISimpleWalletDTO) {
114+
static createFromDTO(simpleWalletDTO: ISimpleWalletDTO): SimpleWallet {
114115
return new SimpleWallet(
115116
simpleWalletDTO.name,
116117
simpleWalletDTO.network,

test/model/transaction/TransactionStatus.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import { deepEqual } from 'assert';
1818
import { expect } from 'chai';
1919
import { TransactionStatusTypeEnum } from 'nem2-sdk-openapi-typescript-node-client';
20+
import { TransactionStateTypeEnum } from 'nem2-sdk-openapi-typescript-node-client';
2021
import { Deadline } from '../../../src/model/transaction/Deadline';
2122
import { TransactionStatus } from '../../../src/model/transaction/TransactionStatus';
2223
import { UInt64 } from '../../../src/model/UInt64';
@@ -25,7 +26,7 @@ describe('TransactionStatus', () => {
2526
it('should createComplete TransactionStatus object', () => {
2627
const transactionStatusDTO = {
2728
deadline: Deadline.createFromDTO('1'),
28-
group: 'confirmed',
29+
group: TransactionStateTypeEnum.Confirmed,
2930
hash: '18C036C20B32348D63684E09A13128A2C18F6A75650D3A5FB43853D716E5E219',
3031
height: new UInt64([1, 0]),
3132
code: TransactionStatusTypeEnum.Success,
@@ -35,7 +36,7 @@ describe('TransactionStatus', () => {
3536
transactionStatusDTO.group,
3637
transactionStatusDTO.hash,
3738
transactionStatusDTO.deadline,
38-
transactionStatusDTO.code.toString(),
39+
transactionStatusDTO.code,
3940
transactionStatusDTO.height,
4041
);
4142

0 commit comments

Comments
 (0)