Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Sync development with master
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuGowda committed Jan 24, 2020
2 parents 7006a06 + e4560b1 commit 0621b1d
Show file tree
Hide file tree
Showing 60 changed files with 567 additions and 377 deletions.
2 changes: 1 addition & 1 deletion commander/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions commander/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lisk-commander",
"version": "3.0.0",
"version": "3.0.1",
"description": "A command line interface for Lisk",
"author": "Lisk Foundation <admin@lisk.io>, lightcurve GmbH <admin@lightcurve.io>",
"license": "Apache-2.0",
Expand Down Expand Up @@ -99,11 +99,11 @@
"/docs"
],
"dependencies": {
"@liskhq/lisk-api-client": "3.0.0",
"@liskhq/lisk-api-client": "3.0.1",
"@liskhq/lisk-constants": "1.3.0",
"@liskhq/lisk-cryptography": "2.4.0",
"@liskhq/lisk-cryptography": "2.4.1",
"@liskhq/lisk-passphrase": "3.0.0",
"@liskhq/lisk-transactions": "3.0.0",
"@liskhq/lisk-transactions": "3.0.1",
"@liskhq/lisk-validator": "0.3.0",
"@oclif/command": "1.5.6",
"@oclif/config": "1.9.0",
Expand Down
9 changes: 7 additions & 2 deletions commander/src/commands/core/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ import {
startDatabase,
stopDatabase,
} from '../../utils/core/database';
import { describeApplication, registerApplication } from '../../utils/core/pm2';
import {
describeApplication,
registerApplication,
unRegisterApplication,
} from '../../utils/core/pm2';
import { getReleaseInfo } from '../../utils/core/release';
import { download, downloadAndValidate, extract } from '../../utils/download';
import { flags as commonFlags } from '../../utils/flags';
Expand Down Expand Up @@ -318,12 +322,13 @@ export default class InstallCommand extends BaseCommand {
return;
}
} catch (error) {
this.error(JSON.stringify(error));
await unRegisterApplication(name);
const { installDir }: Options = error.context.options;
const dirPath = installDir.substr(0, installDir.length - 1);

fsExtra.emptyDirSync(installDir);
fsExtra.rmdirSync(dirPath);
this.error(JSON.stringify(error));
}
}
}
2 changes: 1 addition & 1 deletion elements/lisk-api-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion elements/lisk-api-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@liskhq/lisk-api-client",
"version": "3.0.0",
"version": "3.0.1",
"description": "An API client for the Lisk network",
"author": "Lisk Foundation <admin@lisk.io>, lightcurve GmbH <admin@lightcurve.io>",
"license": "Apache-2.0",
Expand Down
4 changes: 2 additions & 2 deletions elements/lisk-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"prepublishOnly": "npm run lint && npm test && npm run build && npm run build:check"
},
"dependencies": {
"@liskhq/lisk-cryptography": "2.4.0",
"@liskhq/lisk-transactions": "3.0.0",
"@liskhq/lisk-cryptography": "2.4.1",
"@liskhq/lisk-transactions": "3.0.1",
"@types/node": "12.12.11",
"lodash": "4.17.15"
},
Expand Down
2 changes: 1 addition & 1 deletion elements/lisk-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions elements/lisk-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@liskhq/lisk-client",
"version": "3.0.0",
"version": "3.0.1",
"description": "A default set of Elements for use by clients of the Lisk network",
"author": "Lisk Foundation <admin@lisk.io>, lightcurve GmbH <admin@lightcurve.io>",
"license": "Apache-2.0",
Expand Down Expand Up @@ -43,11 +43,11 @@
"prepublishOnly": "npm run lint && npm test && npm run build && npm run build:check"
},
"dependencies": {
"@liskhq/lisk-api-client": "3.0.0",
"@liskhq/lisk-api-client": "3.0.1",
"@liskhq/lisk-constants": "1.3.0",
"@liskhq/lisk-cryptography": "2.4.0",
"@liskhq/lisk-cryptography": "2.4.1",
"@liskhq/lisk-passphrase": "3.0.0",
"@liskhq/lisk-transactions": "3.0.0",
"@liskhq/lisk-transactions": "3.0.1",
"@types/node": "12.12.11"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion elements/lisk-cryptography/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion elements/lisk-cryptography/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@liskhq/lisk-cryptography",
"version": "2.4.0",
"version": "2.4.1",
"description": "General cryptographic functions for use with Lisk-related software",
"author": "Lisk Foundation <admin@lisk.io>, lightcurve GmbH <admin@lightcurve.io>",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion elements/lisk-dpos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"dependencies": {
"@types/node": "12.12.11",
"@liskhq/lisk-cryptography": "2.4.0"
"@liskhq/lisk-cryptography": "2.4.1"
},
"devDependencies": {
"@types/jest": "24.9.0",
Expand Down
1 change: 0 additions & 1 deletion elements/lisk-dpos/test/unit/apply.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ describe('dpos.apply()', () => {
reward: rewardPerDelegate,
height: 809 + i,
}));

forgedBlocks.splice(forgedBlocks.length - 1);

lastBlockOfTheRoundNine = {
Expand Down
26 changes: 25 additions & 1 deletion elements/lisk-elements/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions elements/lisk-elements/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lisk-elements",
"version": "3.0.0",
"version": "3.0.1",
"description": "Elements for building blockchain applications in the Lisk network",
"author": "Lisk Foundation <admin@lisk.io>, lightcurve GmbH <admin@lightcurve.io>",
"license": "Apache-2.0",
Expand Down Expand Up @@ -34,11 +34,14 @@
"prepublishOnly": "npm run lint && npm test && npm run build && npm run build:check"
},
"dependencies": {
"@liskhq/lisk-api-client": "3.0.0",
"@liskhq/lisk-api-client": "3.0.1",
"@liskhq/lisk-constants": "1.3.0",
"@liskhq/lisk-cryptography": "2.4.0",
"@liskhq/lisk-cryptography": "2.4.1",
"@liskhq/lisk-p2p": "0.4.1",
"@liskhq/lisk-passphrase": "3.0.0",
"@liskhq/lisk-transactions": "3.0.0",
"@liskhq/lisk-transaction-pool": "0.2.0",
"@liskhq/lisk-transactions": "3.0.1",
"@liskhq/lisk-validator": "0.3.0",
"@types/node": "12.12.11"
},
"devDependencies": {
Expand Down
9 changes: 6 additions & 3 deletions elements/lisk-elements/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@
import { APIClient } from '@liskhq/lisk-api-client';
import * as constants from '@liskhq/lisk-constants';
import * as cryptography from '@liskhq/lisk-cryptography';
import * as p2p from '@liskhq/lisk-p2p';
import * as passphrase from '@liskhq/lisk-passphrase';
import * as transacationPool from '@liskhq/lisk-transaction-pool';
import * as transactions from '@liskhq/lisk-transactions';
import * as validator from '@liskhq/lisk-validator';

export {
APIClient,
constants,
cryptography,
passphrase,
p2p,
transactions,
// Also export as `transacation` for backward compatibility.
// See https://github.com/LiskHQ/lisk-sdk/issues/3925#issuecomment-508664703
transactions as transaction,
transacationPool,
validator,
};
16 changes: 13 additions & 3 deletions elements/lisk-elements/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ import {
APIClient,
constants,
cryptography,
p2p,
passphrase,
transacationPool,
transactions,
transaction,
validator,
} from '../src';

describe('lisk-elements', () => {
Expand All @@ -34,15 +36,23 @@ describe('lisk-elements', () => {
return expect(cryptography).toBeObject();
});

it('p2p should be an object', () => {
return expect(p2p).to.be.an('object');
});

it('passphrase should be an object', () => {
return expect(passphrase).toBeObject();
});

it('transactionPool should be an object', () => {
return expect(transacationPool).to.be.an('object');
});

it('transactions should be an object', () => {
return expect(transactions).toBeObject();
});

it('transaction should be an object', () => {
return expect(transaction).toBeObject();
it('validator should be an object', () => {
return expect(validator).to.be.an('object');
});
});
2 changes: 1 addition & 1 deletion elements/lisk-p2p/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions elements/lisk-p2p/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@liskhq/lisk-p2p",
"version": "0.4.0",
"version": "0.4.1",
"description": "Unstructured P2P library for use with Lisk-related software",
"author": "Lisk Foundation <admin@lisk.io>, lightcurve GmbH <admin@lightcurve.io>",
"license": "Apache-2.0",
Expand Down Expand Up @@ -40,7 +40,7 @@
"disableLocalIPs": "./scripts/disableTestLocalIPs.sh 2 19"
},
"dependencies": {
"@liskhq/lisk-cryptography": "2.4.0",
"@liskhq/lisk-cryptography": "2.4.1",
"lodash.shuffle": "4.2.0",
"semver": "5.6.0",
"socketcluster-client": "14.3.1",
Expand Down
14 changes: 8 additions & 6 deletions elements/lisk-p2p/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
* Removal or modification of this copyright notice is prohibited.
*
*/
export * from './constants';
export * from './errors';
export * from './events';
export * from './p2p_request';
export * from './p2p_types';
export * from './p2p';
import * as constants from './constants';
import * as errors from './errors';
import * as events from './events';
import { P2P } from './p2p';
import * as p2p_request from './p2p_request';
import * as p2p_types from './p2p_types';

export { constants, errors, events, p2p_request, p2p_types, P2P };
8 changes: 3 additions & 5 deletions elements/lisk-p2p/test/functional/actions/apply_node_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
* Removal or modification of this copyright notice is prohibited.
*
*/
import {
P2P,
EVENT_MESSAGE_RECEIVED,
REMOTE_EVENT_POST_NODE_INFO,
} from '../../../src/index';
import { P2P, events } from '../../../src/index';
import { InvalidNodeInfoError } from '../../../src/errors';
import { wait } from '../../utils/helpers';
import { platform } from 'os';
import { createNetwork, destroyNetwork } from '../../utils/network_setup';

const { EVENT_MESSAGE_RECEIVED, REMOTE_EVENT_POST_NODE_INFO } = events;

describe('P2P.applyNodeInfo', () => {
let p2pNodeList: P2P[] = [];
let collectedMessages: Array<any> = [];
Expand Down
11 changes: 4 additions & 7 deletions elements/lisk-p2p/test/functional/actions/peer_banning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,15 @@
* Removal or modification of this copyright notice is prohibited.
*
*/
import { P2P, ProtocolPeerInfo } from '../../../src/index';
import { wait } from '../../utils/helpers';
import {
createNetwork,
destroyNetwork,
SEED_PEER_IP,
} from '../../utils/network_setup';
import {
EVENT_BAN_PEER,
EVENT_UNBAN_PEER,
EVENT_CLOSE_INBOUND,
} from '../../../src/index';
import { P2P, events, p2p_types } from '../../../src/index';

const { EVENT_BAN_PEER, EVENT_UNBAN_PEER, EVENT_CLOSE_INBOUND } = events;

describe('Peer banning mechanism', () => {
let p2pNodeList: ReadonlyArray<P2P> = [];
Expand Down Expand Up @@ -59,7 +56,7 @@ describe('Peer banning mechanism', () => {
});

describe('when penalty is 100 or more', () => {
let badPeer: ProtocolPeerInfo;
let badPeer: p2p_types.ProtocolPeerInfo;

beforeEach(async () => {
const firstNode = p2pNodeList[0];
Expand Down
4 changes: 2 additions & 2 deletions elements/lisk-p2p/test/functional/actions/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Removal or modification of this copyright notice is prohibited.
*
*/
import { P2P, EVENT_REQUEST_RECEIVED } from '../../../src/index';
import { P2P, events } from '../../../src/index';
import {
createNetwork,
destroyNetwork,
Expand All @@ -27,7 +27,7 @@ describe('P2P.request', () => {

for (let p2p of p2pNodeList) {
// Collect port numbers to check which peer handled which request.
p2p.on(EVENT_REQUEST_RECEIVED, request => {
p2p.on(events.EVENT_REQUEST_RECEIVED, request => {
if (!request.wasResponseSent) {
request.end({
nodePort: p2p.nodeInfo.wsPort,
Expand Down
Loading

0 comments on commit 0621b1d

Please sign in to comment.