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
6 changes: 3 additions & 3 deletions e2e/infrastructure/AccountHttp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ 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((r) => {
return Promise.reject('should fail!');
}, err => {
}, (err) => {
const error = JSON.parse(err.message);
expect(error.statusCode).to.be.eq(404);
expect(error.errorDetails.statusMessage).to.be.eq('Not Found');
Expand All @@ -245,7 +245,7 @@ describe('AccountHttp', () => {
const transactions = await accountRepository.getAccountTransactions(publicAccount.address, {transactionType: TransactionType.TRANSFER} as QueryParams).toPromise();

expect(transactions.length).to.be.greaterThan(0);
transactions.forEach(t => {
transactions.forEach((t) => {
expect(t.type).to.be.eq(TransactionType.TRANSFER);
});
});
Expand Down
2 changes: 1 addition & 1 deletion e2e/infrastructure/RestrictionHttp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { deepEqual } from 'assert';
import { expect } from 'chai';
import { RestrictionAccountRepository } from '../../src/infrastructure/RestrictionAccountRespository';
import { RestrictionAccountRepository } from '../../src/infrastructure/RestrictionAccountRepository';
import { RestrictionMosaicRepository } from '../../src/infrastructure/RestrictionMosaicRepository';
import { Account } from '../../src/model/account/Account';
import { Address } from '../../src/model/account/Address';
Expand Down
2 changes: 1 addition & 1 deletion src/core/crypto/nacl_catapult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ export const crypto_shared_key_hash = (shared, pk, sk, hashfunc, signSchema) =>
d[31] &= 127;
d[31] |= 64;

let q = [gf(), gf(), gf(), gf()];
const q = [gf(), gf(), gf(), gf()];
unpackneg(q, pk);
scalarmult(p, q, d);
pack(shared, p);
Expand Down
2 changes: 1 addition & 1 deletion src/core/format/KeyGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import { UInt64 } from '../../model/UInt64';
import { sha3_256 } from 'js-sha3';
import { UInt64 } from '../../model/UInt64';

export class KeyGenerator {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/core/format/RawArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class RawArray {
* @param {Array} array The array to check.
* @returns {boolean} true if the array is zero-filled, false otherwise.
*/
public static isZeroFilled = (array) => array.every(value => 0 === value);
public static isZeroFilled = (array) => array.every((value) => 0 === value);

/**
* Deeply checks the equality of two arrays.
Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/BlockHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { UInt64 } from '../model/UInt64';
import { BlockRepository } from './BlockRepository';
import { Http } from './Http';
import { QueryParams } from './QueryParams';
import { CreateTransactionFromDTO, extractBeneficiary, } from './transaction/CreateTransactionFromDTO';
import { CreateTransactionFromDTO, extractBeneficiary } from './transaction/CreateTransactionFromDTO';

/**
* Blockchain http repository.
Expand Down
21 changes: 10 additions & 11 deletions src/infrastructure/IListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { CosignatureSignedTransaction } from '../model/transaction/CosignatureSi
import { Transaction } from '../model/transaction/Transaction';
import { TransactionStatusError } from '../model/transaction/TransactionStatusError';


/**
* Listener service
*/
Expand Down Expand Up @@ -53,7 +52,7 @@ export interface IListener {
*
* @return an observable stream of BlockInfo
*/
newBlock(): Observable<BlockInfo>
newBlock(): Observable<BlockInfo>;

/**
* Returns an observable stream of Transaction for a specific address.
Expand All @@ -68,13 +67,13 @@ export interface IListener {
confirmed(address: Address, transactionHash?: string): Observable<Transaction>;

/**
* Returns an observable stream of Transaction for a specific address.
* Each time a transaction is in unconfirmed state an it involves the address,
* it emits a new Transaction in the event stream.
*
* @param address address we listen when a transaction is in unconfirmed state
* @return an observable stream of Transaction with state unconfirmed
*/
* Returns an observable stream of Transaction for a specific address.
* Each time a transaction is in unconfirmed state an it involves the address,
* it emits a new Transaction in the event stream.
*
* @param address address we listen when a transaction is in unconfirmed state
* @return an observable stream of Transaction with state unconfirmed
*/
unconfirmedAdded(address: Address): Observable<Transaction>;

/**
Expand All @@ -96,7 +95,7 @@ export interface IListener {
* @param transactionHash transactionHash for filtering multiple transactions
* @return an observable stream of AggregateTransaction with missing signatures state
*/
aggregateBondedAdded(address: Address, transactionHash?: string): Observable<AggregateTransaction>
aggregateBondedAdded(address: Address, transactionHash?: string): Observable<AggregateTransaction>;

/**
* Returns an observable stream of Transaction Hashes for specific address.
Expand All @@ -106,7 +105,7 @@ export interface IListener {
* @param address address we listen when a transaction is confirmed or rejected
* @return an observable stream of Strings with the transaction hash
*/
aggregateBondedRemoved(address: Address): Observable<string>
aggregateBondedRemoved(address: Address): Observable<string>;

/**
* Returns an observable stream of {@link TransactionStatusError} for specific address.
Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/RepositoryFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { NamespaceRepository } from './NamespaceRepository';
import { NetworkRepository } from './NetworkRepository';
import { NodeRepository } from './NodeRepository';
import { ReceiptRepository } from './ReceiptRepository';
import { RestrictionAccountRepository } from './RestrictionAccountRespository';
import { RestrictionAccountRepository } from './RestrictionAccountRepository';
import { RestrictionMosaicRepository } from './RestrictionMosaicRepository';
import { TransactionRepository } from './TransactionRepository';

Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/RepositoryFactoryHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { ReceiptHttp } from './ReceiptHttp';
import { ReceiptRepository } from './ReceiptRepository';
import { RepositoryFactory } from './RepositoryFactory';
import { RestrictionAccountHttp } from './RestrictionAccountHttp';
import { RestrictionAccountRepository } from './RestrictionAccountRespository';
import { RestrictionAccountRepository } from './RestrictionAccountRepository';
import { RestrictionMosaicHttp } from './RestrictionMosaicHttp';
import { RestrictionMosaicRepository } from './RestrictionMosaicRepository';
import { TransactionHttp } from './TransactionHttp';
Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/RestrictionAccountHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Address } from '../model/account/Address';
import { AccountRestriction } from '../model/restriction/AccountRestriction';
import { AccountRestrictions } from '../model/restriction/AccountRestrictions';
import { Http } from './Http';
import { RestrictionAccountRepository } from './RestrictionAccountRespository';
import { RestrictionAccountRepository } from './RestrictionAccountRepository';

/**
* RestrictionAccount http repository.
Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/RestrictionMosaicHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import {
MosaicAddressRestrictionDTO,
MosaicGlobalRestrictionDTO,
RestrictionMosaicRoutesApi
RestrictionMosaicRoutesApi,
} from 'nem2-sdk-openapi-typescript-node-client';
import { from as observableFrom, Observable, throwError } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/TransactionHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { ClientResponse } from 'http';
import { BlockInfoDTO, BlockRoutesApi, TransactionRoutesApi, TransactionStatusDTO, } from 'nem2-sdk-openapi-typescript-node-client';
import { BlockInfoDTO, BlockRoutesApi, TransactionRoutesApi, TransactionStatusDTO } from 'nem2-sdk-openapi-typescript-node-client';
import { from as observableFrom, Observable, throwError } from 'rxjs';
import { catchError, map, mergeMap } from 'rxjs/operators';
import { CosignatureSignedTransaction } from '../model/transaction/CosignatureSignedTransaction';
Expand Down
17 changes: 17 additions & 0 deletions src/infrastructure/infrastructure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,21 @@ export * from './RestrictionAccountHttp';
export * from './RestrictionMosaicHttp';
export * from './MultisigHttp';
export * from './ReceiptHttp';
export * from './RepositoryFactoryHttp';
export * from './transaction/NamespaceMosaicIdGenerator';
export * from './AccountRepository';
export * from './BlockRepository';
export * from './ChainRepository';
export * from './DiagnosticRepository';
export * from './IListener';
export * from './MetadataRepository';
export * from './MosaicRepository';
export * from './MultisigRepository';
export * from './NamespaceRepository';
export * from './NetworkRepository';
export * from './NodeRepository';
export * from './ReceiptRepository';
export * from './RepositoryFactory';
export * from './RestrictionAccountRepository';
export * from './RestrictionMosaicRepository';
export * from './TransactionRepository';
2 changes: 1 addition & 1 deletion src/model/mosaic/MosaicNonce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ export class MosaicNonce {
* @returns {string}
*/
public toHex(): string {
return convert.uint8ToHex(this.nonce)
return convert.uint8ToHex(this.nonce);
}
}
4 changes: 2 additions & 2 deletions src/model/mosaic/NetworkCurrencyMosaic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import {MosaicId} from './MosaicId';

/**
* NetworkCurrencyMosaic mosaic
*
*
* This represents the per-network currency mosaic. This mosaicId is aliased
* with namespace name `cat.currency`.
*
*
* @since 0.10.2
*/
export class NetworkCurrencyMosaic extends Mosaic {
Expand Down
2 changes: 1 addition & 1 deletion src/model/node/NodeTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { RoleType } from './RoleType';
import { NetworkType } from '../blockchain/NetworkType';
import { UInt64 } from '../UInt64';
import { RoleType } from './RoleType';
/**
* The node info structure describes basic information of a node.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/model/restriction/AccountRestrictionType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export enum AccountRestrictionFlags {
* Block outgoing transactions from a given address.
*/
BlockOutgoingAddress = (AccountRestrictionTypeEnum.Address +
AccountRestrictionTypeEnum.Block +
AccountRestrictionTypeEnum.Block +
AccountRestrictionTypeEnum.Outgoing),
/**
* Block outgoing transactions with a given transaction type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
KeyDto,
SignatureDto,
TimestampDto,
UnresolvedAddressDto
UnresolvedAddressDto,
} from 'catbuffer';
import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/AccountLinkTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
EmbeddedTransactionBuilder,
KeyDto,
SignatureDto,
TimestampDto
TimestampDto,
} from 'catbuffer';
import { Convert } from '../../core/format';
import { PublicAccount } from '../account/PublicAccount';
Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/AccountMetadataTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
EmbeddedTransactionBuilder,
KeyDto,
SignatureDto,
TimestampDto
TimestampDto,
} from 'catbuffer';
import { Convert } from '../../core/format';
import { PublicAccount } from '../account/PublicAccount';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
KeyDto,
SignatureDto,
TimestampDto,
UnresolvedMosaicIdDto
UnresolvedMosaicIdDto,
} from 'catbuffer';
import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/AddressAliasTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
KeyDto,
NamespaceIdDto,
SignatureDto,
TimestampDto
TimestampDto,
} from 'catbuffer';
import { Convert, RawAddress } from '../../core/format';
import { Address } from '../account/Address';
Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/AggregateTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
Hash256Dto,
KeyDto,
SignatureDto,
TimestampDto
TimestampDto,
} from 'catbuffer';
import { KeyPair, MerkleHashBuilder, SHA3Hasher, SignSchema } from '../../core/crypto';
import { Convert } from '../../core/format';
Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/LockFundsTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
SignatureDto,
TimestampDto,
UnresolvedMosaicBuilder,
UnresolvedMosaicIdDto
UnresolvedMosaicIdDto,
} from 'catbuffer';
import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/MosaicAliasTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
MosaicIdDto,
NamespaceIdDto,
SignatureDto,
TimestampDto
TimestampDto,
} from 'catbuffer';
import { Convert } from '../../core/format';
import { PublicAccount } from '../account/PublicAccount';
Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/MosaicDefinitionTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
MosaicIdDto,
MosaicNonceDto,
SignatureDto,
TimestampDto
TimestampDto,
} from 'catbuffer';
import { Convert } from '../../core/format';
import { PublicAccount } from '../account/PublicAccount';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
MosaicGlobalRestrictionTransactionBuilder,
SignatureDto,
TimestampDto,
UnresolvedMosaicIdDto
UnresolvedMosaicIdDto,
} from 'catbuffer';
import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/MosaicMetadataTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
MosaicMetadataTransactionBuilder,
SignatureDto,
TimestampDto,
UnresolvedMosaicIdDto
UnresolvedMosaicIdDto,
} from 'catbuffer';
import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/MosaicSupplyChangeTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
MosaicSupplyChangeTransactionBuilder,
SignatureDto,
TimestampDto,
UnresolvedMosaicIdDto
UnresolvedMosaicIdDto,
} from 'catbuffer';
import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
KeyDto,
MultisigAccountModificationTransactionBuilder,
SignatureDto,
TimestampDto
TimestampDto,
} from 'catbuffer';
import { Convert } from '../../core/format';
import { PublicAccount } from '../account/PublicAccount';
Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/NamespaceMetadataTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
NamespaceIdDto,
NamespaceMetadataTransactionBuilder,
SignatureDto,
TimestampDto
TimestampDto,
} from 'catbuffer';
import { Convert } from '../../core/format';
import { PublicAccount } from '../account/PublicAccount';
Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/NamespaceRegistrationTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
NamespaceIdDto,
NamespaceRegistrationTransactionBuilder,
SignatureDto,
TimestampDto
TimestampDto,
} from 'catbuffer';
import { Convert, Convert as convert } from '../../core/format';
import { NamespaceMosaicIdGenerator } from '../../infrastructure/transaction/NamespaceMosaicIdGenerator';
Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/SecretLockTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
TimestampDto,
UnresolvedAddressDto,
UnresolvedMosaicBuilder,
UnresolvedMosaicIdDto
UnresolvedMosaicIdDto,
} from 'catbuffer';
import { Convert, Convert as convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/SecretProofTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
SecretProofTransactionBuilder,
SignatureDto,
TimestampDto,
UnresolvedAddressDto
UnresolvedAddressDto,
} from 'catbuffer';
import { Convert, Convert as convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/TransferTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
TransferTransactionBuilder,
UnresolvedAddressDto,
UnresolvedMosaicBuilder,
UnresolvedMosaicIdDto
UnresolvedMosaicIdDto,
} from 'catbuffer';
import * as Long from 'long';
import { Convert } from '../../core/format';
Expand Down
Loading