Skip to content

Commit bfba61b

Browse files
committed
Fixed lint issues
1 parent bd9845e commit bfba61b

File tree

15 files changed

+41
-21
lines changed

15 files changed

+41
-21
lines changed

e2e/infrastructure/AccountHttp.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ describe('AccountHttp', () => {
186186

187187
describe('getMultisigAccountGraphInfo', () => {
188188
it('should call getMultisigAccountGraphInfo successfully', async () => {
189-
const multisigAccountGraphInfo = await multisigRepository.getMultisigAccountGraphInfo(multisigAccount.publicAccount.address).toPromise();
189+
const multisigAccountGraphInfo =
190+
await multisigRepository.getMultisigAccountGraphInfo(multisigAccount.publicAccount.address).toPromise();
190191
expect(multisigAccountGraphInfo.multisigAccounts.get(0)![0].account.publicKey).to.be.equal(multisigAccount.publicKey);
191192
});
192193
});
@@ -225,7 +226,8 @@ describe('AccountHttp', () => {
225226

226227
describe('transactions', () => {
227228
it('should call transactions successfully by type', async () => {
228-
const transactions = await accountRepository.getAccountTransactions(publicAccount.address, {transactionType: TransactionType.TRANSFER} as QueryParams).toPromise();
229+
const transactions = await accountRepository.getAccountTransactions(
230+
publicAccount.address, {transactionType: TransactionType.TRANSFER} as QueryParams).toPromise();
229231
expect(transactions.length).to.be.greaterThan(0);
230232
transactions.forEach((t) => {
231233
expect(t.type).to.be.eq(TransactionType.TRANSFER);

e2e/infrastructure/Listener.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('Listener', () => {
4545
let namespaceRepository: NamespaceRepository;
4646
let generationHash: string;
4747
let networkType: NetworkType;
48-
let networkCurrencyMosaicId: NamespaceId = NetworkCurrencyMosaic.NAMESPACE_ID;
48+
const networkCurrencyMosaicId: NamespaceId = NetworkCurrencyMosaic.NAMESPACE_ID;
4949
let transactionRepository: TransactionRepository;
5050

5151
before(() => {

e2e/infrastructure/MetadataHttp.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ describe('MetadataHttp', () => {
210210

211211
describe('getAccountMetadataByKeyAndSender', () => {
212212
it('should return metadata given a NEM Address and metadata key and sender public key', async () => {
213-
const metadata = await metadataRepository.getAccountMetadataByKeyAndSender(accountAddress, UInt64.fromUint(5).toHex(), account.publicKey).toPromise();
213+
const metadata = await metadataRepository.getAccountMetadataByKeyAndSender(
214+
accountAddress, UInt64.fromUint(5).toHex(), account.publicKey).toPromise();
214215
expect(metadata.metadataEntry.scopedMetadataKey.toString()).to.be.equal('5');
215216
expect(metadata.metadataEntry.senderPublicKey).to.be.equal(account.publicKey);
216217
expect(metadata.metadataEntry.targetPublicKey).to.be.equal(account.publicKey);
@@ -248,7 +249,8 @@ describe('MetadataHttp', () => {
248249

249250
describe('getMosaicMetadataByKeyAndSender', () => {
250251
it('should return metadata given a mosaicId and metadata key and sender public key', async () => {
251-
const metadata = await metadataRepository.getMosaicMetadataByKeyAndSender(mosaicId, UInt64.fromUint(5).toHex(), account.publicKey).toPromise();
252+
const metadata = await metadataRepository.getMosaicMetadataByKeyAndSender(
253+
mosaicId, UInt64.fromUint(5).toHex(), account.publicKey).toPromise();
252254
expect(metadata.metadataEntry.scopedMetadataKey.toString()).to.be.equal('5');
253255
expect(metadata.metadataEntry.senderPublicKey).to.be.equal(account.publicKey);
254256
expect(metadata.metadataEntry.targetPublicKey).to.be.equal(account.publicKey);
@@ -286,7 +288,8 @@ describe('MetadataHttp', () => {
286288

287289
describe('getNamespaceMetadataByKeyAndSender', () => {
288290
it('should return metadata given a namespaceId and metadata key and sender public key', async () => {
289-
const metadata = await metadataRepository.getNamespaceMetadataByKeyAndSender(namespaceId, UInt64.fromUint(5).toHex(), account.publicKey).toPromise();
291+
const metadata = await metadataRepository.getNamespaceMetadataByKeyAndSender(
292+
namespaceId, UInt64.fromUint(5).toHex(), account.publicKey).toPromise();
290293
expect(metadata.metadataEntry.scopedMetadataKey.toString()).to.be.equal('5');
291294
expect(metadata.metadataEntry.senderPublicKey).to.be.equal(account.publicKey);
292295
expect(metadata.metadataEntry.targetPublicKey).to.be.equal(account.publicKey);

e2e/infrastructure/RestrictionHttp.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ describe('RestrictionHttp', () => {
217217

218218
describe('getMosaicAddressRestrictions', () => {
219219
it('should call getMosaicAddressRestrictions successfully', async () => {
220-
const mosaicRestriction = await restrictionMosaicRepository.getMosaicAddressRestrictions(mosaicId, [account3.address]).toPromise();
220+
const mosaicRestriction =
221+
await restrictionMosaicRepository.getMosaicAddressRestrictions(mosaicId, [account3.address]).toPromise();
221222
deepEqual(mosaicRestriction[0].mosaicId.toHex(), mosaicId.toHex());
222223
deepEqual(mosaicRestriction[0].entryType, MosaicRestrictionEntryType.ADDRESS);
223224
deepEqual(mosaicRestriction[0].targetAddress.plain(), account3.address.plain());

e2e/infrastructure/UnresolvedMapping.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ describe('TransactionHttp', () => {
7979
*/
8080
describe('Get network currency mosaic id', () => {
8181
it('get mosaicId', async () => {
82-
networkCurrencyMosaicId = (await namespaceRepository.getLinkedMosaicId(new NamespaceId('cat.currency')).toPromise()) as MosaicId;
82+
networkCurrencyMosaicId =
83+
(await namespaceRepository.getLinkedMosaicId(new NamespaceId('cat.currency')).toPromise()) as MosaicId;
8384
});
8485
});
8586

e2e/service/MetadataTransactionService.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ describe('MetadataTransactionService', () => {
184184
expect(transaction.type).to.be.equal(TransactionType.MOSAIC_METADATA);
185185
expect(transaction.scopedMetadataKey.toHex()).to.be.equal(key.toHex());
186186
expect(transaction.valueSizeDelta).to.be.equal(5);
187-
expect(transaction.value).to.be.equals( Convert.decodeHex(Convert.xor(Convert.utf8ToUint8(newValue), Convert.utf8ToUint8(updateValue))));
187+
expect(transaction.value).to.be.equals(
188+
Convert.decodeHex(Convert.xor(Convert.utf8ToUint8(newValue), Convert.utf8ToUint8(updateValue))));
188189
expect(transaction.targetPublicKey).to.be.equal(targetAccount.publicKey);
189190
expect(transaction.targetMosaicId.toHex()).to.be.equal(mosaicId.toHex());
190191
});
@@ -207,7 +208,8 @@ describe('MetadataTransactionService', () => {
207208
expect(transaction.type).to.be.equal(TransactionType.NAMESPACE_METADATA);
208209
expect(transaction.scopedMetadataKey.toHex()).to.be.equal(key.toHex());
209210
expect(transaction.valueSizeDelta).to.be.equal(5);
210-
expect(transaction.value).to.be.equals( Convert.decodeHex(Convert.xor(Convert.utf8ToUint8(newValue), Convert.utf8ToUint8(updateValue))));
211+
expect(transaction.value).to.be.equals( Convert.decodeHex(
212+
Convert.xor(Convert.utf8ToUint8(newValue), Convert.utf8ToUint8(updateValue))));
211213
expect(transaction.targetPublicKey).to.be.equal(targetAccount.publicKey);
212214
expect(transaction.targetNamespaceId.toHex()).to.be.equal(namespaceId.toHex());
213215
});

e2e/service/TransactionService.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ describe('TransactionService', () => {
7171
transactionHashes = [];
7272
transactionHashesMultiple = [];
7373
transactionRepository = helper.repositoryFactory.createTransactionRepository();
74-
transactionService = new TransactionService(helper.repositoryFactory.createTransactionRepository(), helper.repositoryFactory.createReceiptRepository());
74+
transactionService = new TransactionService(
75+
helper.repositoryFactory.createTransactionRepository(), helper.repositoryFactory.createReceiptRepository());
7576
});
7677
});
7778
before(() => {

e2e/service/TransactionService_AggregateBonded.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ describe('TransactionService', () => {
170170
networkType, helper.maxFee,
171171
);
172172
const signedLockFundsTransaction = lockFundsTransaction.signWith(account, generationHash);
173-
const tx = await transactionService.announceHashLockAggregateBonded(signedLockFundsTransaction, signedAggregatedTransaction, helper.listener).toPromise();
173+
const tx = await transactionService.announceHashLockAggregateBonded(
174+
signedLockFundsTransaction, signedAggregatedTransaction, helper.listener).toPromise();
174175
expect(tx.signer!.publicKey).to.be.equal(account.publicKey);
175176
expect(tx.type).to.be.equal(TransactionType.AGGREGATE_BONDED);
176177

@@ -189,7 +190,8 @@ describe('TransactionService', () => {
189190
networkType, helper.maxFee,
190191
);
191192
const signedLockFundsTransaction = lockFundsTransaction.signWith(account, generationHash);
192-
const signedLockFundsTransactionResponse = await transactionService.announce(signedLockFundsTransaction, helper.listener).toPromise();
193+
const signedLockFundsTransactionResponse =
194+
await transactionService.announce(signedLockFundsTransaction, helper.listener).toPromise();
193195
expect(signedLockFundsTransactionResponse.transactionInfo!.hash).to.be.equal(signedLockFundsTransaction.hash);
194196
const tx = await transactionService.announceAggregateBonded(signedAggregatedTransaction, helper.listener).toPromise();
195197
expect(tx.signer!.publicKey).to.be.equal(account.publicKey);

src/core/crypto/Utilities.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616

1717
import { RawArray as array } from '../format';
1818
import * as nacl from './nacl_catapult';
19+
// tslint:disable-next-line: no-var-requires
1920
export const CryptoJS = require('crypto-js');
2021
export const Key_Size = 32;
2122
export const Signature_Size = 64;
2223
export const Half_Signature_Size = Signature_Size / 2;
2324
export const Hash_Size = 64;
2425
export const Half_Hash_Size = Hash_Size / 2;
26+
// tslint:disable-next-line: no-var-requires
2527
export const hkdf = require('futoin-hkdf');
2628
import { sha512 } from 'js-sha512';
2729

src/core/crypto/nacl_catapult.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
//
2222
// Implementation derived from TweetNaCl version 20140427.
2323
// See for details: http://tweetnacl.cr.yp.to/
24+
2425
const _0 = new Uint8Array(16);
2526
const _9 = new Uint8Array(32);
2627
_9[0] = 9;
@@ -106,6 +107,7 @@ const M = (o, a, b) => {
106107
t28 = 0,
107108
t29 = 0,
108109
t30 = 0,
110+
// tslint:disable: prefer-const
109111
b0 = b[0],
110112
b1 = b[1],
111113
b2 = b[2],
@@ -649,6 +651,7 @@ const neq25519 = (a, b) => {
649651
d = new Uint8Array(32);
650652
pack25519(c, a);
651653
pack25519(d, b);
654+
// tslint:disable-next-line: no-use-before-declare
652655
return crypto_verify_32(c, 0, d, 0);
653656
};
654657

@@ -682,6 +685,7 @@ export const crypto_shared_key_hash = (shared, pk, sk, hashfunc) => {
682685
d[31] |= 64;
683686

684687
const q = [gf(), gf(), gf(), gf()];
688+
// tslint:disable: no-use-before-declare
685689
unpackneg(q, pk);
686690
scalarmult(p, q, d);
687691
pack(shared, p);

0 commit comments

Comments
 (0)