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
23 changes: 10 additions & 13 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: "module" // Allows for the use of imports
sourceType: 'module', // Allows for the use of imports
},
rules: {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/camelcase": "off",
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/camelcase': 'off',
// TODO fix all the warnings
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-inferrable-types": "warn",
"@typescript-eslint/no-use-before-define": "warn"
}
'@typescript-eslint/no-explicit-any': 'off',
},
};
14 changes: 6 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
language: node_js
node_js:
- '8'
- '9'
- '10'
- '12'
- "10"
- "12"
cache:
directories:
- 'node_modules'
- "node_modules"
- .eslintcache
before_script:
- npm run build
Expand All @@ -24,16 +22,16 @@ deploy:
script: /bin/sh travis/github-pages.sh
on:
branch: master
node_js: '12'
node_js: "12"
- provider: script
skip_cleanup: true
script: /bin/sh travis/uploadArchives.sh
on:
branch: master
node_js: '10'
node_js: "10"
- provider: script
skip_cleanup: true
script: /bin/sh travis/release.sh
on:
branch: $RELEASE_BRANCH
node_js: '10'
node_js: "10"
4 changes: 0 additions & 4 deletions e2e/infrastructure/BlockHttp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ describe('BlockHttp', () => {
let account2: Account;
let blockRepository: BlockRepository;
let receiptRepository: ReceiptRepository;
let blockReceiptHash = '';
let blockTransactionHash = '';
let chainHeight;
let generationHash: string;
let networkType: NetworkType;
Expand Down Expand Up @@ -86,8 +84,6 @@ describe('BlockHttp', () => {
describe('getBlockByHeight', () => {
it('should return block info given height', async () => {
const blockInfo = await blockRepository.getBlockByHeight(UInt64.fromUint(1)).toPromise();
blockReceiptHash = blockInfo.blockReceiptsHash;
blockTransactionHash = blockInfo.blockTransactionsHash;
expect(blockInfo.height.lower).to.be.equal(1);
expect(blockInfo.height.higher).to.be.equal(0);
expect(blockInfo.timestamp.lower).to.be.equal(0);
Expand Down
1 change: 0 additions & 1 deletion e2e/infrastructure/IntegrationTestHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { SignedTransaction } from '../../src/model/transaction/SignedTransaction
import { Transaction } from '../../src/model/transaction/Transaction';
import { UInt64 } from '../../src/model/UInt64';
import { TransactionService } from '../../src/service/TransactionService';
import { NetworkHarvestLocal } from '../../src/model/mosaic/NetworkHarvestLocal';
import { NetworkCurrencyPublic } from '../../src/model/mosaic/NetworkCurrencyPublic';
import { NetworkCurrencyLocal } from '../../src/model/mosaic/NetworkCurrencyLocal';
import { NamespaceId } from '../../src/model/namespace/NamespaceId';
Expand Down
5 changes: 1 addition & 4 deletions e2e/infrastructure/Listener.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { assert, expect } from 'chai';
import { ChronoUnit } from 'js-joda';
import { filter } from 'rxjs/operators';
import { AccountRepository } from '../../src/infrastructure/AccountRepository';
import { NamespaceRepository } from '../../src/infrastructure/NamespaceRepository';
import { TransactionRepository } from '../../src/infrastructure/TransactionRepository';
import { Account } from '../../src/model/account/Account';
import { PlainMessage } from '../../src/model/message/PlainMessage';
Expand All @@ -40,7 +39,6 @@ describe('Listener', () => {
let cosignAccount2: Account;
let cosignAccount3: Account;
let accountRepository: AccountRepository;
let namespaceRepository: NamespaceRepository;
let generationHash: string;
let networkType: NetworkType;
const NetworkCurrencyLocalId: NamespaceId = helper.networkCurrencyNamespaceId;
Expand All @@ -57,7 +55,6 @@ describe('Listener', () => {
generationHash = helper.generationHash;
networkType = helper.networkType;
accountRepository = helper.repositoryFactory.createAccountRepository();
namespaceRepository = helper.repositoryFactory.createNamespaceRepository();
transactionRepository = helper.repositoryFactory.createTransactionRepository();
});
});
Expand Down Expand Up @@ -97,7 +94,7 @@ describe('Listener', () => {
signedAggregatedTransaction: SignedTransaction,
signer: Account,
mosaicId: MosaicId | NamespaceId,
) => {
): void => {
const lockFundsTransaction = LockFundsTransaction.create(
Deadline.create(),
new Mosaic(mosaicId, UInt64.fromUint(10 * Math.pow(10, helper.networkCurrencyDivisibility))),
Expand Down
21 changes: 1 addition & 20 deletions e2e/infrastructure/TransactionHttp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@
import { expect } from 'chai';
import * as CryptoJS from 'crypto-js';
import { ChronoUnit } from 'js-joda';
import { keccak_256, sha3_256 } from 'js-sha3';
import { sha3_256 } from 'js-sha3';
import { Crypto } from '../../src/core/crypto';
import { Convert, Convert as convert } from '../../src/core/format';
import { TransactionMapping } from '../../src/core/utils/TransactionMapping';
import { AccountRepository } from '../../src/infrastructure/AccountRepository';
import { MultisigRepository } from '../../src/infrastructure/MultisigRepository';
import { NamespaceRepository } from '../../src/infrastructure/NamespaceRepository';
import { RepositoryFactory } from '../../src/infrastructure/RepositoryFactory';
import { TransactionRepository } from '../../src/infrastructure/TransactionRepository';
import { Account } from '../../src/model/account/Account';
import { Address } from '../../src/model/account/Address';
import { PublicAccount } from '../../src/model/account/PublicAccount';
import { PlainMessage } from '../../src/model/message/PlainMessage';
import { Mosaic } from '../../src/model/mosaic/Mosaic';
import { MosaicFlags } from '../../src/model/mosaic/MosaicFlags';
Expand Down Expand Up @@ -82,14 +78,7 @@ describe('TransactionHttp', () => {
let account3: Account;
let multisigAccount: Account;
let cosignAccount1: Account;
let cosignAccount2: Account;
let cosignAccount3: Account;
let accountAddress: Address;
let accountPublicKey: string;
let publicAccount: PublicAccount;
let repositoryFactory: RepositoryFactory;
let accountRepository: AccountRepository;
let multisigRepository: MultisigRepository;
let namespaceRepository: NamespaceRepository;
let generationHash: string;
let networkType: NetworkType;
Expand All @@ -112,17 +101,10 @@ describe('TransactionHttp', () => {
account3 = helper.account3;
multisigAccount = helper.multisigAccount;
cosignAccount1 = helper.cosignAccount1;
cosignAccount2 = helper.cosignAccount2;
cosignAccount3 = helper.cosignAccount3;
accountAddress = helper.account.address;
harvestingAccount = helper.harvestingAccount;
accountPublicKey = helper.account.publicKey;
publicAccount = helper.account.publicAccount;
generationHash = helper.generationHash;
networkType = helper.networkType;
repositoryFactory = helper.repositoryFactory;
accountRepository = helper.repositoryFactory.createAccountRepository();
multisigRepository = helper.repositoryFactory.createMultisigRepository();
namespaceRepository = helper.repositoryFactory.createNamespaceRepository();
transactionRepository = helper.repositoryFactory.createTransactionRepository();
});
Expand Down Expand Up @@ -1166,7 +1148,6 @@ describe('TransactionHttp', () => {
it('standalone', () => {
const randomBytes = secureRandom.randomBuffer(32);
const secretSeed = randomBytes.toString('hex');
const hash = sha256(Buffer.from(secretSeed, 'hex'));
// const secret = sha256(Buffer.from(hash, 'hex'));
const secret = LockHashUtils.Op_Hash_256(randomBytes);
const proof = secretSeed;
Expand Down
11 changes: 0 additions & 11 deletions e2e/infrastructure/UnresolvedMapping.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
*/
import { expect } from 'chai';
import { Convert } from '../../src/core/format';
import { NamespaceRepository } from '../../src/infrastructure/NamespaceRepository';
import { TransactionHttp } from '../../src/infrastructure/TransactionHttp';
import { Account } from '../../src/model/account/Account';
import { Address } from '../../src/model/account/Address';
import { PlainMessage } from '../../src/model/message/PlainMessage';
import { MosaicFlags } from '../../src/model/mosaic/MosaicFlags';
import { MosaicId } from '../../src/model/mosaic/MosaicId';
Expand Down Expand Up @@ -46,11 +43,9 @@ describe('TransactionHttp', () => {
const helper = new IntegrationTestHelper();
let account: Account;
let account2: Account;
let namespaceRepository: NamespaceRepository;
let generationHash: string;
let networkType: NetworkType;
let mosaicId: MosaicId;
let NetworkCurrencyLocalId: MosaicId;
let namespaceIdAddress: NamespaceId;
let namespaceIdMosaic: NamespaceId;

Expand All @@ -60,7 +55,6 @@ describe('TransactionHttp', () => {
account2 = helper.account2;
generationHash = helper.generationHash;
networkType = helper.networkType;
namespaceRepository = helper.repositoryFactory.createNamespaceRepository();
});
});

Expand All @@ -77,11 +71,6 @@ describe('TransactionHttp', () => {
* Setup test data
* =========================
*/
describe('Get network currency mosaic id', () => {
it('get mosaicId', async () => {
NetworkCurrencyLocalId = (await namespaceRepository.getLinkedMosaicId(new NamespaceId('cat.currency')).toPromise()) as MosaicId;
});
});

describe('MosaicDefinitionTransaction', () => {
it('standalone', () => {
Expand Down
2 changes: 0 additions & 2 deletions e2e/service/BlockService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ describe('BlockService', () => {
let generationHash: string;
let account: Account;
let account2: Account;
let account3: Account;
let networkType: NetworkType;
let transactionHash: string;
let blockService: BlockService;
Expand All @@ -43,7 +42,6 @@ describe('BlockService', () => {
return helper.start().then(() => {
account = helper.account;
account2 = helper.account2;
account3 = helper.account3;
generationHash = helper.generationHash;
networkType = helper.networkType;
transactionRepository = helper.repositoryFactory.createTransactionRepository();
Expand Down
1 change: 0 additions & 1 deletion e2e/service/MosaicService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import { AccountRepository } from '../../src/infrastructure/AccountRepository';
import { MosaicRepository } from '../../src/infrastructure/MosaicRepository';
import { Address } from '../../src/model/account/Address';
import { NetworkType } from '../../src/model/network/NetworkType';
import { MosaicService } from '../../src/service/MosaicService';
import { IntegrationTestHelper } from '../infrastructure/IntegrationTestHelper';

Expand Down
Loading