Skip to content

Commit 6c39166

Browse files
authored
Merge pull request #453 from NEMStudios/task/g451_open_api_0.8.4
Apply open api 0.8.4
2 parents fd830ca + 2808eb8 commit 6c39166

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+873
-267
lines changed

e2e/infrastructure/AccountHttp.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import { expect } from 'chai';
1818
import { AccountRepository } from '../../src/infrastructure/AccountRepository';
19+
import { TransactionFilter } from '../../src/infrastructure/infrastructure';
1920
import { MultisigRepository } from '../../src/infrastructure/MultisigRepository';
2021
import { NamespaceRepository } from '../../src/infrastructure/NamespaceRepository';
2122
import { QueryParams } from '../../src/infrastructure/QueryParams';
@@ -24,7 +25,7 @@ import { Address } from '../../src/model/account/Address';
2425
import { PublicAccount } from '../../src/model/account/PublicAccount';
2526
import { NetworkType } from '../../src/model/blockchain/NetworkType';
2627
import { PlainMessage } from '../../src/model/message/PlainMessage';
27-
import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic';
28+
import { NetworkCurrencyLocal } from '../../src/model/mosaic/NetworkCurrencyLocal';
2829
import { AliasAction } from '../../src/model/namespace/AliasAction';
2930
import { NamespaceId } from '../../src/model/namespace/NamespaceId';
3031
import { AddressAliasTransaction } from '../../src/model/transaction/AddressAliasTransaction';
@@ -92,7 +93,7 @@ describe('AccountHttp', () => {
9293
const transferTransaction = TransferTransaction.create(
9394
Deadline.create(),
9495
account2.address,
95-
[NetworkCurrencyMosaic.createAbsolute(1)],
96+
[NetworkCurrencyLocal.createAbsolute(1)],
9697
PlainMessage.create('test-message'),
9798
networkType,
9899
helper.maxFee,
@@ -213,7 +214,7 @@ describe('AccountHttp', () => {
213214

214215
describe('transactions', () => {
215216
it('should not return accounts when account does not exist', () => {
216-
return accountRepository.getAccountInfo(Account.generateNewAccount(networkType).address).toPromise().then((r) => {
217+
return accountRepository.getAccountInfo(Account.generateNewAccount(networkType).address).toPromise().then(() => {
217218
return Promise.reject('should fail!');
218219
}, (err) => {
219220
const error = JSON.parse(err.message);
@@ -227,7 +228,7 @@ describe('AccountHttp', () => {
227228
describe('transactions', () => {
228229
it('should call transactions successfully by type', async () => {
229230
const transactions = await accountRepository.getAccountTransactions(
230-
publicAccount.address, {transactionType: TransactionType.TRANSFER} as QueryParams).toPromise();
231+
publicAccount.address, new QueryParams(), new TransactionFilter().setType([TransactionType.TRANSFER])).toPromise();
231232
expect(transactions.length).to.be.greaterThan(0);
232233
transactions.forEach((t) => {
233234
expect(t.type).to.be.eq(TransactionType.TRANSFER);

e2e/infrastructure/BlockHttp.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { ReceiptRepository } from '../../src/infrastructure/ReceiptRepository';
2323
import { Account } from '../../src/model/account/Account';
2424
import { NetworkType } from '../../src/model/blockchain/NetworkType';
2525
import { PlainMessage } from '../../src/model/message/PlainMessage';
26-
import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic';
26+
import { NetworkCurrencyLocal } from '../../src/model/mosaic/NetworkCurrencyLocal';
2727
import { Deadline } from '../../src/model/transaction/Deadline';
2828
import { TransactionInfo } from '../../src/model/transaction/TransactionInfo';
2929
import { TransferTransaction } from '../../src/model/transaction/TransferTransaction';
@@ -73,7 +73,7 @@ describe('BlockHttp', () => {
7373
const transferTransaction = TransferTransaction.create(
7474
Deadline.create(),
7575
account2.address,
76-
[NetworkCurrencyMosaic.createAbsolute(1)],
76+
[NetworkCurrencyLocal.createAbsolute(1)],
7777
PlainMessage.create('test-message'),
7878
networkType,
7979
helper.maxFee,
@@ -111,7 +111,8 @@ describe('BlockHttp', () => {
111111
});
112112

113113
it('should return block transactions data given height with paginated transactionId', async () => {
114-
const transactions = await blockRepository.getBlockTransactions(UInt64.fromUint(1), new QueryParams(10, nextId)).toPromise();
114+
const transactions = await blockRepository.getBlockTransactions(UInt64.fromUint(1),
115+
new QueryParams().setPageSize(10).setId(nextId)).toPromise();
115116
expect(transactions[0].transactionInfo!.id).to.be.equal(firstId);
116117
expect(transactions.length).to.be.greaterThan(0);
117118
});

e2e/infrastructure/Listener.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { NetworkType } from '../../src/model/blockchain/NetworkType';
2424
import { PlainMessage } from '../../src/model/message/PlainMessage';
2525
import { Address, CosignatureTransaction, LockFundsTransaction, Mosaic, SignedTransaction, UInt64 } from '../../src/model/model';
2626
import { MosaicId } from '../../src/model/mosaic/MosaicId';
27-
import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic';
27+
import { NetworkCurrencyLocal } from '../../src/model/mosaic/NetworkCurrencyLocal';
2828
import { NamespaceId } from '../../src/model/namespace/NamespaceId';
2929
import { AggregateTransaction } from '../../src/model/transaction/AggregateTransaction';
3030
import { Deadline } from '../../src/model/transaction/Deadline';
@@ -45,7 +45,7 @@ describe('Listener', () => {
4545
let namespaceRepository: NamespaceRepository;
4646
let generationHash: string;
4747
let networkType: NetworkType;
48-
const networkCurrencyMosaicId: NamespaceId = NetworkCurrencyMosaic.NAMESPACE_ID;
48+
const NetworkCurrencyLocalId: NamespaceId = NetworkCurrencyLocal.NAMESPACE_ID;
4949
let transactionRepository: TransactionRepository;
5050

5151
before(() => {
@@ -100,7 +100,7 @@ describe('Listener', () => {
100100
mosaicId: MosaicId | NamespaceId) => {
101101
const lockFundsTransaction = LockFundsTransaction.create(
102102
Deadline.create(),
103-
new Mosaic(mosaicId, UInt64.fromUint(10 * Math.pow(10, NetworkCurrencyMosaic.DIVISIBILITY))),
103+
new Mosaic(mosaicId, UInt64.fromUint(10 * Math.pow(10, NetworkCurrencyLocal.DIVISIBILITY))),
104104
UInt64.fromUint(1000),
105105
signedAggregatedTransaction,
106106
networkType, helper.maxFee,
@@ -180,7 +180,7 @@ describe('Listener', () => {
180180
const transferTransaction = TransferTransaction.create(
181181
Deadline.create(),
182182
cosignAccount1.address,
183-
[new Mosaic(networkCurrencyMosaicId, UInt64.fromUint(10 * Math.pow(10, NetworkCurrencyMosaic.DIVISIBILITY)))],
183+
[new Mosaic(NetworkCurrencyLocalId, UInt64.fromUint(10 * Math.pow(10, NetworkCurrencyLocal.DIVISIBILITY)))],
184184
PlainMessage.create('test-message'),
185185
networkType, helper.maxFee,
186186
);
@@ -220,7 +220,7 @@ describe('Listener', () => {
220220

221221
it('aggregateBondedTransactionsAdded', (done) => {
222222
const signedAggregatedTx = createSignedAggregatedBondTransaction(multisigAccount, account, account2.address);
223-
createHashLockTransactionAndAnnounce(signedAggregatedTx, account, networkCurrencyMosaicId);
223+
createHashLockTransactionAndAnnounce(signedAggregatedTx, account, NetworkCurrencyLocalId);
224224
helper.listener.aggregateBondedAdded(account.address).subscribe(() => {
225225
done();
226226
});
@@ -239,7 +239,7 @@ describe('Listener', () => {
239239
const signedAggregatedTx =
240240
createSignedAggregatedBondTransaction(multisigAccount, cosignAccount1, account2.address);
241241

242-
createHashLockTransactionAndAnnounce(signedAggregatedTx, cosignAccount1, networkCurrencyMosaicId);
242+
createHashLockTransactionAndAnnounce(signedAggregatedTx, cosignAccount1, NetworkCurrencyLocalId);
243243
helper.listener.confirmed(cosignAccount1.address).subscribe(() => {
244244
helper.listener.aggregateBondedRemoved(cosignAccount1.address).subscribe(() => {
245245
done();
@@ -274,7 +274,7 @@ describe('Listener', () => {
274274
const signedAggregatedTx =
275275
createSignedAggregatedBondTransaction(multisigAccount, cosignAccount1, account2.address);
276276

277-
createHashLockTransactionAndAnnounce(signedAggregatedTx, cosignAccount1, networkCurrencyMosaicId);
277+
createHashLockTransactionAndAnnounce(signedAggregatedTx, cosignAccount1, NetworkCurrencyLocalId);
278278
helper.listener.cosignatureAdded(cosignAccount1.address).subscribe(() => {
279279
done();
280280
});
@@ -341,7 +341,7 @@ describe('Listener', () => {
341341
describe('Transactions Status', () => {
342342

343343
it('transactionStatusGiven', () => {
344-
const mosaics = [NetworkCurrencyMosaic.createRelative(1000000000000)];
344+
const mosaics = [NetworkCurrencyLocal.createRelative(1000000000000)];
345345
const transferTransaction = TransferTransaction.create(
346346
Deadline.create(),
347347
account2.address,

e2e/infrastructure/NamespaceHttp.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { expect } from 'chai';
1818
import { NamespaceRepository } from '../../src/infrastructure/NamespaceRepository';
1919
import { Account } from '../../src/model/account/Account';
2020
import { Address } from '../../src/model/account/Address';
21-
import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic';
21+
import { NetworkCurrencyLocal } from '../../src/model/mosaic/NetworkCurrencyLocal';
2222
import { AliasAction } from '../../src/model/namespace/AliasAction';
2323
import { NamespaceId } from '../../src/model/namespace/NamespaceId';
2424
import { AddressAliasTransaction } from '../../src/model/transaction/AddressAliasTransaction';
@@ -28,7 +28,7 @@ import { UInt64 } from '../../src/model/UInt64';
2828
import { IntegrationTestHelper } from './IntegrationTestHelper';
2929

3030
describe('NamespaceHttp', () => {
31-
const defaultNamespaceId = NetworkCurrencyMosaic.NAMESPACE_ID;
31+
const defaultNamespaceId = NetworkCurrencyLocal.NAMESPACE_ID;
3232
let namespaceId: NamespaceId;
3333
let namespaceRepository: NamespaceRepository;
3434
let account: Account;

0 commit comments

Comments
 (0)