Skip to content

Commit 60bd8b9

Browse files
committed
Merge branch 'task/g426_persistent_harvesting' of github.com:NEMStudios/nem2-sdk-typescript-javascript into task/g426_persistent_harvesting
2 parents c5809b6 + cd3db56 commit 60bd8b9

File tree

65 files changed

+264
-250
lines changed

Some content is hidden

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

65 files changed

+264
-250
lines changed

e2e/infrastructure/AccountHttp.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ describe('AccountHttp', () => {
229229

230230
describe('transactions', () => {
231231
it('should not return accounts when account does not exist', () => {
232-
return accountRepository.getAccountInfo(Account.generateNewAccount(networkType).address).toPromise().then(r => {
232+
return accountRepository.getAccountInfo(Account.generateNewAccount(networkType).address).toPromise().then((r) => {
233233
return Promise.reject('should fail!');
234-
}, err => {
234+
}, (err) => {
235235
const error = JSON.parse(err.message);
236236
expect(error.statusCode).to.be.eq(404);
237237
expect(error.errorDetails.statusMessage).to.be.eq('Not Found');
@@ -245,7 +245,7 @@ describe('AccountHttp', () => {
245245
const transactions = await accountRepository.getAccountTransactions(publicAccount.address, {transactionType: TransactionType.TRANSFER} as QueryParams).toPromise();
246246

247247
expect(transactions.length).to.be.greaterThan(0);
248-
transactions.forEach(t => {
248+
transactions.forEach((t) => {
249249
expect(t.type).to.be.eq(TransactionType.TRANSFER);
250250
});
251251
});

e2e/infrastructure/RestrictionHttp.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import { deepEqual } from 'assert';
1818
import { expect } from 'chai';
19-
import { RestrictionAccountRepository } from '../../src/infrastructure/RestrictionAccountRespository';
19+
import { RestrictionAccountRepository } from '../../src/infrastructure/RestrictionAccountRepository';
2020
import { RestrictionMosaicRepository } from '../../src/infrastructure/RestrictionMosaicRepository';
2121
import { Account } from '../../src/model/account/Account';
2222
import { Address } from '../../src/model/account/Address';

e2e/infrastructure/TransactionHttp.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ describe('TransactionHttp', () => {
531531
const addressModification = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction(
532532
Deadline.create(),
533533
AccountRestrictionFlags.BlockIncomingTransactionType,
534-
[TransactionType.LINK_ACCOUNT],
534+
[TransactionType.ACCOUNT_LINK],
535535
[],
536536
networkType, helper.maxFee,
537537
);
@@ -551,7 +551,7 @@ describe('TransactionHttp', () => {
551551
Deadline.create(),
552552
AccountRestrictionFlags.BlockIncomingTransactionType,
553553
[],
554-
[TransactionType.LINK_ACCOUNT],
554+
[TransactionType.ACCOUNT_LINK],
555555
networkType, helper.maxFee,
556556
);
557557
const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(),
@@ -569,12 +569,12 @@ describe('TransactionHttp', () => {
569569
it('standalone', () => {
570570
AccountRestrictionModification.createForOperation(
571571
AccountRestrictionModificationAction.Add,
572-
TransactionType.LINK_ACCOUNT,
572+
TransactionType.ACCOUNT_LINK,
573573
);
574574
const addressModification = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction(
575575
Deadline.create(),
576576
AccountRestrictionFlags.BlockOutgoingTransactionType,
577-
[TransactionType.LINK_ACCOUNT],
577+
[TransactionType.ACCOUNT_LINK],
578578
[],
579579
networkType, helper.maxFee,
580580
);
@@ -595,7 +595,7 @@ describe('TransactionHttp', () => {
595595
Deadline.create(),
596596
AccountRestrictionFlags.BlockOutgoingTransactionType,
597597
[],
598-
[TransactionType.LINK_ACCOUNT],
598+
[TransactionType.ACCOUNT_LINK],
599599
networkType, helper.maxFee,
600600
);
601601
const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(),

e2e/service/MetadataTransactionService.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ describe('MetadataTransactionService', () => {
160160
newValue,
161161
targetAccount.publicAccount,
162162
).subscribe((transaction: AccountMetadataTransaction) => {
163-
expect(transaction.type).to.be.equal(TransactionType.ACCOUNT_METADATA_TRANSACTION);
163+
expect(transaction.type).to.be.equal(TransactionType.ACCOUNT_METADATA);
164164
expect(transaction.scopedMetadataKey.toHex()).to.be.equal(key.toHex());
165165
expect(transaction.value).to.be.equal(newValue);
166166
expect(transaction.targetPublicKey).to.be.equal(targetAccount.publicKey);
@@ -180,7 +180,7 @@ describe('MetadataTransactionService', () => {
180180
targetAccount.publicAccount,
181181
mosaicId,
182182
).subscribe((transaction: MosaicMetadataTransaction) => {
183-
expect(transaction.type).to.be.equal(TransactionType.MOSAIC_METADATA_TRANSACTION);
183+
expect(transaction.type).to.be.equal(TransactionType.MOSAIC_METADATA);
184184
expect(transaction.scopedMetadataKey.toHex()).to.be.equal(key.toHex());
185185
expect(transaction.valueSizeDelta).to.be.equal(5);
186186
expect(transaction.value).to.be.equal(newValue + 'delta');
@@ -202,7 +202,7 @@ describe('MetadataTransactionService', () => {
202202
targetAccount.publicAccount,
203203
namespaceId,
204204
).subscribe((transaction: NamespaceMetadataTransaction) => {
205-
expect(transaction.type).to.be.equal(TransactionType.NAMESPACE_METADATA_TRANSACTION);
205+
expect(transaction.type).to.be.equal(TransactionType.NAMESPACE_METADATA);
206206
expect(transaction.scopedMetadataKey.toHex()).to.be.equal(key.toHex());
207207
expect(transaction.valueSizeDelta).to.be.equal(5);
208208
expect(transaction.value).to.be.equal(newValue + 'delta');

src/core/crypto/nacl_catapult.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ export const crypto_shared_key_hash = (shared, pk, sk, hashfunc, signSchema) =>
681681
d[31] &= 127;
682682
d[31] |= 64;
683683

684-
let q = [gf(), gf(), gf(), gf()];
684+
const q = [gf(), gf(), gf(), gf()];
685685
unpackneg(q, pk);
686686
scalarmult(p, q, d);
687687
pack(shared, p);

src/core/format/KeyGenerator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { UInt64 } from '../../model/UInt64';
1817
import { sha3_256 } from 'js-sha3';
18+
import { UInt64 } from '../../model/UInt64';
1919

2020
export class KeyGenerator {
2121
/**

src/core/format/RawArray.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class RawArray {
5050
* @param {Array} array The array to check.
5151
* @returns {boolean} true if the array is zero-filled, false otherwise.
5252
*/
53-
public static isZeroFilled = (array) => array.every(value => 0 === value);
53+
public static isZeroFilled = (array) => array.every((value) => 0 === value);
5454

5555
/**
5656
* Deeply checks the equality of two arrays.

src/infrastructure/BlockHttp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { UInt64 } from '../model/UInt64';
2626
import { BlockRepository } from './BlockRepository';
2727
import { Http } from './Http';
2828
import { QueryParams } from './QueryParams';
29-
import { CreateTransactionFromDTO, extractBeneficiary, } from './transaction/CreateTransactionFromDTO';
29+
import { CreateTransactionFromDTO, extractBeneficiary } from './transaction/CreateTransactionFromDTO';
3030

3131
/**
3232
* Blockchain http repository.

src/infrastructure/IListener.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { CosignatureSignedTransaction } from '../model/transaction/CosignatureSi
2222
import { Transaction } from '../model/transaction/Transaction';
2323
import { TransactionStatusError } from '../model/transaction/TransactionStatusError';
2424

25-
2625
/**
2726
* Listener service
2827
*/
@@ -53,7 +52,7 @@ export interface IListener {
5352
*
5453
* @return an observable stream of BlockInfo
5554
*/
56-
newBlock(): Observable<BlockInfo>
55+
newBlock(): Observable<BlockInfo>;
5756

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

7069
/**
71-
* Returns an observable stream of Transaction for a specific address.
72-
* Each time a transaction is in unconfirmed state an it involves the address,
73-
* it emits a new Transaction in the event stream.
74-
*
75-
* @param address address we listen when a transaction is in unconfirmed state
76-
* @return an observable stream of Transaction with state unconfirmed
77-
*/
70+
* Returns an observable stream of Transaction for a specific address.
71+
* Each time a transaction is in unconfirmed state an it involves the address,
72+
* it emits a new Transaction in the event stream.
73+
*
74+
* @param address address we listen when a transaction is in unconfirmed state
75+
* @return an observable stream of Transaction with state unconfirmed
76+
*/
7877
unconfirmedAdded(address: Address): Observable<Transaction>;
7978

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

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

111110
/**
112111
* Returns an observable stream of {@link TransactionStatusError} for specific address.

src/infrastructure/RepositoryFactory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { NamespaceRepository } from './NamespaceRepository';
2828
import { NetworkRepository } from './NetworkRepository';
2929
import { NodeRepository } from './NodeRepository';
3030
import { ReceiptRepository } from './ReceiptRepository';
31-
import { RestrictionAccountRepository } from './RestrictionAccountRespository';
31+
import { RestrictionAccountRepository } from './RestrictionAccountRepository';
3232
import { RestrictionMosaicRepository } from './RestrictionMosaicRepository';
3333
import { TransactionRepository } from './TransactionRepository';
3434

0 commit comments

Comments
 (0)