Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions e2e/infrastructure/AccountHttp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import { expect } from 'chai';
import { AccountRepository } from '../../src/infrastructure/AccountRepository';
import { TransactionFilter } from '../../src/infrastructure/infrastructure';
import { MultisigRepository } from '../../src/infrastructure/MultisigRepository';
import { NamespaceRepository } from '../../src/infrastructure/NamespaceRepository';
import { QueryParams } from '../../src/infrastructure/QueryParams';
Expand All @@ -24,7 +25,7 @@ import { Address } from '../../src/model/account/Address';
import { PublicAccount } from '../../src/model/account/PublicAccount';
import { NetworkType } from '../../src/model/blockchain/NetworkType';
import { PlainMessage } from '../../src/model/message/PlainMessage';
import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic';
import { NetworkCurrencyLocal } from '../../src/model/mosaic/NetworkCurrencyLocal';
import { AliasAction } from '../../src/model/namespace/AliasAction';
import { NamespaceId } from '../../src/model/namespace/NamespaceId';
import { AddressAliasTransaction } from '../../src/model/transaction/AddressAliasTransaction';
Expand Down Expand Up @@ -92,7 +93,7 @@ describe('AccountHttp', () => {
const transferTransaction = TransferTransaction.create(
Deadline.create(),
account2.address,
[NetworkCurrencyMosaic.createAbsolute(1)],
[NetworkCurrencyLocal.createAbsolute(1)],
PlainMessage.create('test-message'),
networkType,
helper.maxFee,
Expand Down Expand Up @@ -213,7 +214,7 @@ describe('AccountHttp', () => {

describe('transactions', () => {
it('should not return accounts when account does not exist', () => {
return accountRepository.getAccountInfo(Account.generateNewAccount(networkType).address).toPromise().then((r) => {
return accountRepository.getAccountInfo(Account.generateNewAccount(networkType).address).toPromise().then(() => {
return Promise.reject('should fail!');
}, (err) => {
const error = JSON.parse(err.message);
Expand All @@ -227,7 +228,7 @@ describe('AccountHttp', () => {
describe('transactions', () => {
it('should call transactions successfully by type', async () => {
const transactions = await accountRepository.getAccountTransactions(
publicAccount.address, {transactionType: TransactionType.TRANSFER} as QueryParams).toPromise();
publicAccount.address, new QueryParams(), new TransactionFilter().setType([TransactionType.TRANSFER])).toPromise();
expect(transactions.length).to.be.greaterThan(0);
transactions.forEach((t) => {
expect(t.type).to.be.eq(TransactionType.TRANSFER);
Expand Down
7 changes: 4 additions & 3 deletions e2e/infrastructure/BlockHttp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { ReceiptRepository } from '../../src/infrastructure/ReceiptRepository';
import { Account } from '../../src/model/account/Account';
import { NetworkType } from '../../src/model/blockchain/NetworkType';
import { PlainMessage } from '../../src/model/message/PlainMessage';
import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic';
import { NetworkCurrencyLocal } from '../../src/model/mosaic/NetworkCurrencyLocal';
import { Deadline } from '../../src/model/transaction/Deadline';
import { TransactionInfo } from '../../src/model/transaction/TransactionInfo';
import { TransferTransaction } from '../../src/model/transaction/TransferTransaction';
Expand Down Expand Up @@ -73,7 +73,7 @@ describe('BlockHttp', () => {
const transferTransaction = TransferTransaction.create(
Deadline.create(),
account2.address,
[NetworkCurrencyMosaic.createAbsolute(1)],
[NetworkCurrencyLocal.createAbsolute(1)],
PlainMessage.create('test-message'),
networkType,
helper.maxFee,
Expand Down Expand Up @@ -111,7 +111,8 @@ describe('BlockHttp', () => {
});

it('should return block transactions data given height with paginated transactionId', async () => {
const transactions = await blockRepository.getBlockTransactions(UInt64.fromUint(1), new QueryParams(10, nextId)).toPromise();
const transactions = await blockRepository.getBlockTransactions(UInt64.fromUint(1),
new QueryParams().setPageSize(10).setId(nextId)).toPromise();
expect(transactions[0].transactionInfo!.id).to.be.equal(firstId);
expect(transactions.length).to.be.greaterThan(0);
});
Expand Down
16 changes: 8 additions & 8 deletions e2e/infrastructure/Listener.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { NetworkType } from '../../src/model/blockchain/NetworkType';
import { PlainMessage } from '../../src/model/message/PlainMessage';
import { Address, CosignatureTransaction, LockFundsTransaction, Mosaic, SignedTransaction, UInt64 } from '../../src/model/model';
import { MosaicId } from '../../src/model/mosaic/MosaicId';
import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic';
import { NetworkCurrencyLocal } from '../../src/model/mosaic/NetworkCurrencyLocal';
import { NamespaceId } from '../../src/model/namespace/NamespaceId';
import { AggregateTransaction } from '../../src/model/transaction/AggregateTransaction';
import { Deadline } from '../../src/model/transaction/Deadline';
Expand All @@ -45,7 +45,7 @@ describe('Listener', () => {
let namespaceRepository: NamespaceRepository;
let generationHash: string;
let networkType: NetworkType;
const networkCurrencyMosaicId: NamespaceId = NetworkCurrencyMosaic.NAMESPACE_ID;
const NetworkCurrencyLocalId: NamespaceId = NetworkCurrencyLocal.NAMESPACE_ID;
let transactionRepository: TransactionRepository;

before(() => {
Expand Down Expand Up @@ -100,7 +100,7 @@ describe('Listener', () => {
mosaicId: MosaicId | NamespaceId) => {
const lockFundsTransaction = LockFundsTransaction.create(
Deadline.create(),
new Mosaic(mosaicId, UInt64.fromUint(10 * Math.pow(10, NetworkCurrencyMosaic.DIVISIBILITY))),
new Mosaic(mosaicId, UInt64.fromUint(10 * Math.pow(10, NetworkCurrencyLocal.DIVISIBILITY))),
UInt64.fromUint(1000),
signedAggregatedTransaction,
networkType, helper.maxFee,
Expand Down Expand Up @@ -180,7 +180,7 @@ describe('Listener', () => {
const transferTransaction = TransferTransaction.create(
Deadline.create(),
cosignAccount1.address,
[new Mosaic(networkCurrencyMosaicId, UInt64.fromUint(10 * Math.pow(10, NetworkCurrencyMosaic.DIVISIBILITY)))],
[new Mosaic(NetworkCurrencyLocalId, UInt64.fromUint(10 * Math.pow(10, NetworkCurrencyLocal.DIVISIBILITY)))],
PlainMessage.create('test-message'),
networkType, helper.maxFee,
);
Expand Down Expand Up @@ -220,7 +220,7 @@ describe('Listener', () => {

it('aggregateBondedTransactionsAdded', (done) => {
const signedAggregatedTx = createSignedAggregatedBondTransaction(multisigAccount, account, account2.address);
createHashLockTransactionAndAnnounce(signedAggregatedTx, account, networkCurrencyMosaicId);
createHashLockTransactionAndAnnounce(signedAggregatedTx, account, NetworkCurrencyLocalId);
helper.listener.aggregateBondedAdded(account.address).subscribe(() => {
done();
});
Expand All @@ -239,7 +239,7 @@ describe('Listener', () => {
const signedAggregatedTx =
createSignedAggregatedBondTransaction(multisigAccount, cosignAccount1, account2.address);

createHashLockTransactionAndAnnounce(signedAggregatedTx, cosignAccount1, networkCurrencyMosaicId);
createHashLockTransactionAndAnnounce(signedAggregatedTx, cosignAccount1, NetworkCurrencyLocalId);
helper.listener.confirmed(cosignAccount1.address).subscribe(() => {
helper.listener.aggregateBondedRemoved(cosignAccount1.address).subscribe(() => {
done();
Expand Down Expand Up @@ -274,7 +274,7 @@ describe('Listener', () => {
const signedAggregatedTx =
createSignedAggregatedBondTransaction(multisigAccount, cosignAccount1, account2.address);

createHashLockTransactionAndAnnounce(signedAggregatedTx, cosignAccount1, networkCurrencyMosaicId);
createHashLockTransactionAndAnnounce(signedAggregatedTx, cosignAccount1, NetworkCurrencyLocalId);
helper.listener.cosignatureAdded(cosignAccount1.address).subscribe(() => {
done();
});
Expand Down Expand Up @@ -341,7 +341,7 @@ describe('Listener', () => {
describe('Transactions Status', () => {

it('transactionStatusGiven', () => {
const mosaics = [NetworkCurrencyMosaic.createRelative(1000000000000)];
const mosaics = [NetworkCurrencyLocal.createRelative(1000000000000)];
const transferTransaction = TransferTransaction.create(
Deadline.create(),
account2.address,
Expand Down
4 changes: 2 additions & 2 deletions e2e/infrastructure/NamespaceHttp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { expect } from 'chai';
import { NamespaceRepository } from '../../src/infrastructure/NamespaceRepository';
import { Account } from '../../src/model/account/Account';
import { Address } from '../../src/model/account/Address';
import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic';
import { NetworkCurrencyLocal } from '../../src/model/mosaic/NetworkCurrencyLocal';
import { AliasAction } from '../../src/model/namespace/AliasAction';
import { NamespaceId } from '../../src/model/namespace/NamespaceId';
import { AddressAliasTransaction } from '../../src/model/transaction/AddressAliasTransaction';
Expand All @@ -28,7 +28,7 @@ import { UInt64 } from '../../src/model/UInt64';
import { IntegrationTestHelper } from './IntegrationTestHelper';

describe('NamespaceHttp', () => {
const defaultNamespaceId = NetworkCurrencyMosaic.NAMESPACE_ID;
const defaultNamespaceId = NetworkCurrencyLocal.NAMESPACE_ID;
let namespaceId: NamespaceId;
let namespaceRepository: NamespaceRepository;
let account: Account;
Expand Down
Loading