Skip to content

Commit

Permalink
Merge f144a37 into 436afd5
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr committed Oct 28, 2018
2 parents 436afd5 + f144a37 commit 2d02568
Show file tree
Hide file tree
Showing 66 changed files with 199 additions and 236 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Expand Up @@ -2,7 +2,7 @@ const config = require('@polkadot/dev/config/jest');

module.exports = Object.assign({}, config, {
moduleNameMapper: {
'@polkadot/client-(chains|db|p2p-messages|p2p|rpc-handlers|rpc|runtime|telemetry|wasm)(.*)$': '<rootDir>/packages/client-$1/src/$2',
'@polkadot/client-(chains|db|p2p|rpc|runtime|telemetry|types|wasm)(.*)$': '<rootDir>/packages/client-$1/src/$2',
'@polkadot/client(.*)$': '<rootDir>/packages/client/src/$1'
}
});
10 changes: 0 additions & 10 deletions packages/client-chains/README.md
@@ -1,13 +1,3 @@
[![polkadotjs](https://img.shields.io/badge/polkadot-js-orange.svg?style=flat-square)](https://polkadot.js.org)
![isc](https://img.shields.io/badge/license-ISC-lightgrey.svg?style=flat-square)
[![style](https://img.shields.io/badge/code%20style-semistandard-lightgrey.svg?style=flat-square)](https://github.com/Flet/semistandard)
[![npm](https://img.shields.io/npm/v/@polkadot/client-chains.svg?style=flat-square)](https://www.npmjs.com/package/@polkadot/client-chains)
[![travis](https://img.shields.io/travis/polkadot-js/client.svg?style=flat-square)](https://travis-ci.org/polkadot-js/client)
[![maintainability](https://img.shields.io/codeclimate/maintainability/polkadot-js/client.svg?style=flat-square)](https://codeclimate.com/github/polkadot-js/client/maintainability)
[![coverage](https://img.shields.io/coveralls/polkadot-js/client.svg?style=flat-square)](https://coveralls.io/github/polkadot-js/client?branch=master)
[![dependency](https://david-dm.org/polkadot-js/client.svg?style=flat-square&path=packages/client-chains)](https://david-dm.org/polkadot-js/client?path=packages/client-chains)
[![devDependency](https://david-dm.org/polkadot-js/client/dev-status.svg?style=flat-square&path=packages/client-chains)](https://david-dm.org/polkadot-js/client?path=packages/client-chains#info=devDependencies)

# @polkadot/client-chains

Node configuration definitions for specific chains.
10 changes: 0 additions & 10 deletions packages/client-db/README.md
@@ -1,13 +1,3 @@
[![polkadotjs](https://img.shields.io/badge/polkadot-js-orange.svg?style=flat-square)](https://polkadot.js.org)
![isc](https://img.shields.io/badge/license-ISC-lightgrey.svg?style=flat-square)
[![style](https://img.shields.io/badge/code%20style-semistandard-lightgrey.svg?style=flat-square)](https://github.com/Flet/semistandard)
[![npm](https://img.shields.io/npm/v/@polkadot/client-db.svg?style=flat-square)](https://www.npmjs.com/package/@polkadot/client-db)
[![travis](https://img.shields.io/travis/polkadot-js/client.svg?style=flat-square)](https://travis-ci.org/polkadot-js/client)
[![maintainability](https://img.shields.io/codeclimate/maintainability/polkadot-js/client.svg?style=flat-square)](https://codeclimate.com/github/polkadot-js/client/maintainability)
[![coverage](https://img.shields.io/coveralls/polkadot-js/client.svg?style=flat-square)](https://coveralls.io/github/polkadot-js/client?branch=master)
[![dependency](https://david-dm.org/polkadot-js/client.svg?style=flat-square&path=packages/client-db)](https://david-dm.org/polkadot-js/client?path=packages/client-db)
[![devDependency](https://david-dm.org/polkadot-js/client/dev-status.svg?style=flat-square&path=packages/client-db)](https://david-dm.org/polkadot-js/client?path=packages/client-db#info=devDependencies)

# @polkadot/client-db

An interface to the database layer with chain-specific helpers
1 change: 0 additions & 1 deletion packages/client-p2p-messages/README.md

This file was deleted.

37 changes: 0 additions & 37 deletions packages/client-p2p-messages/package.json

This file was deleted.

15 changes: 0 additions & 15 deletions packages/client-p2p-messages/src/attrs/all.ts

This file was deleted.

13 changes: 0 additions & 13 deletions packages/client-p2p-messages/src/attrs/fromAttrs.ts

This file was deleted.

18 changes: 0 additions & 18 deletions packages/client-p2p-messages/src/attrs/toAttrs.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/client-p2p/README.md
@@ -1,13 +1,3 @@
[![polkadotjs](https://img.shields.io/badge/polkadot-js-orange.svg?style=flat-square)](https://polkadot.js.org)
![isc](https://img.shields.io/badge/license-ISC-lightgrey.svg?style=flat-square)
[![style](https://img.shields.io/badge/code%20style-semistandard-lightgrey.svg?style=flat-square)](https://github.com/Flet/semistandard)
[![npm](https://img.shields.io/npm/v/@polkadot/client-p2p.svg?style=flat-square)](https://www.npmjs.com/package/@polkadot/client-p2p)
[![travis](https://img.shields.io/travis/polkadot-js/client.svg?style=flat-square)](https://travis-ci.org/polkadot-js/client)
[![maintainability](https://img.shields.io/codeclimate/maintainability/polkadot-js/client.svg?style=flat-square)](https://codeclimate.com/github/polkadot-js/client/maintainability)
[![coverage](https://img.shields.io/coveralls/polkadot-js/client.svg?style=flat-square)](https://coveralls.io/github/polkadot-js/client?branch=master)
[![dependency](https://david-dm.org/polkadot-js/client.svg?style=flat-square&path=packages/client-p2p)](https://david-dm.org/polkadot-js/client?path=packages/client-p2p)
[![devDependency](https://david-dm.org/polkadot-js/client/dev-status.svg?style=flat-square&path=packages/client-p2p)](https://david-dm.org/polkadot-js/client?path=packages/client-p2p#info=devDependencies)

# @polkadot/client-p2p

An embeddable P2P server for use with with Polkadot clients. It allows a consistent interface across various types of P2P providers, initial support (WIP, non-complete) for POC-1 is DevP2P with the view to move to LibP2P in future versions as the protocol expands.
2 changes: 1 addition & 1 deletion packages/client-p2p/package.json
Expand Up @@ -30,7 +30,7 @@
"homepage": "https://github.com/polkadot-js/client/client/tree/master/packages/client-p2p#readme",
"dependencies": {
"@babel/runtime": "^7.1.2",
"@polkadot/client-p2p-messages": "^0.16.5",
"@polkadot/client-types": "^0.16.5",
"@polkadot/primitives": "0.29.4",
"@polkadot/util": "^0.32.9",
"eventemitter3": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/client-p2p/src/defaults.ts
Expand Up @@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.

import { Role } from '@polkadot/primitives/role';
import { Role } from '@polkadot/client-types/role/types';

const ADDRESS = '127.0.0.1';
const CLIENT_ID = 'polkadot-js/0.0.0';
Expand Down
2 changes: 1 addition & 1 deletion packages/client-p2p/src/handler/bft.ts
Expand Up @@ -5,7 +5,7 @@
import { P2pInterface, PeerInterface } from '../types';
import { Handler } from './types';

import Bft from '@polkadot/client-p2p-messages/Bft';
import { Bft } from '@polkadot/client-types/messages';

// TODO Propagate
function handleBft (self: P2pInterface, peer: PeerInterface, message: Bft): void {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-p2p/src/handler/blockAnnounce.ts
Expand Up @@ -5,7 +5,7 @@
import { P2pInterface, PeerInterface } from '../types';
import { Handler } from './types';

import BlockAnnounce from '@polkadot/client-p2p-messages/BlockAnnounce';
import { BlockAnnounce } from '@polkadot/client-types/messages';
import encodeHeader from '@polkadot/primitives/codec/header/encode';
import { blake2AsU8a } from '@polkadot/util-crypto';

Expand Down
2 changes: 1 addition & 1 deletion packages/client-p2p/src/handler/blockRequest.ts
Expand Up @@ -5,7 +5,7 @@
import { P2pInterface, PeerInterface } from '../types';
import { Handler } from './types';

import BlockRequest from '@polkadot/client-p2p-messages/BlockRequest';
import { BlockRequest } from '@polkadot/client-types/messages';

function handleBlockRequest (self: P2pInterface, peer: PeerInterface, message: BlockRequest): void {
self.l.debug(() => [peer.shortId, 'BlockRequest', JSON.stringify(message)]);
Expand Down
2 changes: 1 addition & 1 deletion packages/client-p2p/src/handler/blockResponse.ts
Expand Up @@ -5,7 +5,7 @@
import { P2pInterface, PeerInterface } from '../types';
import { Handler } from './types';

import BlockResponse from '@polkadot/client-p2p-messages/BlockResponse';
import { BlockResponse } from '@polkadot/client-types/messages';

function handleBlockResponse (self: P2pInterface, peer: PeerInterface, message: BlockResponse): void {
self.l.debug(() => [peer.shortId, 'BlockResponse', JSON.stringify(message)]);
Expand Down
2 changes: 1 addition & 1 deletion packages/client-p2p/src/handler/status.ts
Expand Up @@ -5,7 +5,7 @@
import { P2pInterface, PeerInterface } from '../types';
import { Handler } from './types';

import Status from '@polkadot/client-p2p-messages/Status';
import { Status } from '@polkadot/client-types/messages';

// TODO: We should check the genesisHash here and act appropriately
function handleStatus (self: P2pInterface, peer: PeerInterface, message: Status): void {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-p2p/src/handler/transactions.ts
Expand Up @@ -5,7 +5,7 @@
import { P2pInterface, PeerInterface } from '../types';
import { Handler } from './types';

import Transactions from '@polkadot/client-p2p-messages/Transactions';
import { Transactions } from '@polkadot/client-types/messages';

// TODO Propagate
function handleTransactions (self: P2pInterface, peer: PeerInterface, message: Transactions): void {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-p2p/src/handler/types.d.ts
Expand Up @@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.

import { MessageInterface } from '@polkadot/client-p2p-messages/types';
import { MessageInterface } from '@polkadot/client-types/messages/types';
import { P2pInterface, PeerInterface } from '../types';

export type Handler = {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-p2p/src/index.ts
Expand Up @@ -4,7 +4,7 @@

import { Config } from '@polkadot/client/types';
import { ChainInterface } from '@polkadot/client-chains/types';
import { MessageInterface } from '@polkadot/client-p2p-messages/types';
import { MessageInterface } from '@polkadot/client-types/messages/types';
import { Logger } from '@polkadot/util/types';
import { P2pInterface, PeerInterface, PeersInterface } from './types';

Expand Down
5 changes: 2 additions & 3 deletions packages/client-p2p/src/peer/index.ts
Expand Up @@ -5,16 +5,15 @@
import PeerInfo from 'peer-info';
import { Config } from '@polkadot/client/types';
import { ChainInterface } from '@polkadot/client-chains/types';
import { MessageInterface } from '@polkadot/client-p2p-messages/types';
import { MessageInterface } from '@polkadot/client-types/messages/types';
import { PeerInterface } from '../types';

import BN from 'bn.js';
import EventEmitter from 'eventemitter3';
import PullPushable, { Pushable } from 'pull-pushable';
import pull from 'pull-stream';
import varint from 'varint';
import decodeMessage from '@polkadot/client-p2p-messages/index';
import Status from '@polkadot/client-p2p-messages/Status';
import decodeMessage, { Status } from '@polkadot/client-types/messages/index';
import { bufferToU8a, logger, stringShorten, u8aConcat, u8aToBuffer, u8aToHex } from '@polkadot/util';

import defaults from '../defaults';
Expand Down
2 changes: 1 addition & 1 deletion packages/client-p2p/src/peer/send.spec.js
Expand Up @@ -3,7 +3,7 @@
// of the ISC license. See the LICENSE file for details.

import BN from 'bn.js';
import Status from '@polkadot/client-p2p-messages/Status';
import { Status } from '@polkadot/client-types/messages';
import { logger } from '@polkadot/util';

import Peer from './index';
Expand Down
2 changes: 1 addition & 1 deletion packages/client-p2p/src/peers/index.ts
Expand Up @@ -5,7 +5,7 @@
import LibP2p from 'libp2p';
import { Config } from '@polkadot/client/types';
import { ChainInterface } from '@polkadot/client-chains/types';
import { MessageInterface } from '@polkadot/client-p2p-messages/types';
import { MessageInterface } from '@polkadot/client-types/messages/types';
import { KnownPeer, PeerInterface, PeersInterface, PeersInterface$Events } from '../types';

import EventEmitter from 'eventemitter3';
Expand Down
5 changes: 2 additions & 3 deletions packages/client-p2p/src/sync/index.ts
Expand Up @@ -4,14 +4,13 @@

import { Config } from '@polkadot/client/types';
import { ChainInterface } from '@polkadot/client-chains/types';
import { BlockAttr, BlockResponseMessage, BlockResponseMessageBlock } from '@polkadot/client-p2p-messages/types';
import { BlockAttr, BlockResponseMessage, BlockResponseMessageBlock } from '@polkadot/client-types/messages/types';
import { PeerInterface, SyncStatus } from '../types';
import { SyncInterface, SyncState$Request, SyncState$BlockRequests, SyncState$BlockQueue } from './types';

import BN from 'bn.js';
import EventEmitter from 'eventemitter3';
import BlockRequest from '@polkadot/client-p2p-messages/BlockRequest';
import BlockResponse from '@polkadot/client-p2p-messages/BlockResponse';
import { BlockRequest, BlockResponse } from '@polkadot/client-types/messages';
// import decodeBlock from '@polkadot/primitives/codec/block/decodeRaw';
import { isU8a, logger } from '@polkadot/util';
// import u8aToHex from '@polkadot/util/u8a/toHex';
Expand Down
4 changes: 2 additions & 2 deletions packages/client-p2p/src/sync/types.d.ts
Expand Up @@ -3,10 +3,10 @@
// of the ISC license. See the LICENSE file for details.

import BN from 'bn.js';
import { BlockResponseMessageBlock } from '@polkadot/client-p2p-messages/types';
import { BlockResponseMessageBlock } from '@polkadot/client-types/messages/types';
import { PeerInterface, SyncStatus } from '../types';

import BlockRequest from '@polkadot/client-p2p-messages/BlockRequest';
import { BlockRequest } from '@polkadot/client-types/messages';

export type SyncState$Request = {
peer: PeerInterface,
Expand Down
2 changes: 1 addition & 1 deletion packages/client-p2p/src/types.d.ts
Expand Up @@ -9,7 +9,7 @@ import EventEmitter from 'eventemitter3';
import { Logger } from '@polkadot/util/types';
import { Config } from '@polkadot/client/types';
import { ChainInterface } from '@polkadot/client-chains/types';
import { MessageInterface } from '@polkadot/client-p2p-messages/types';
import { MessageInterface } from '@polkadot/client-types/messages/types';
import { SyncState } from './sync/types';
import Sync from './sync';

Expand Down
15 changes: 0 additions & 15 deletions packages/client-rpc-handlers/LICENSE

This file was deleted.

1 change: 0 additions & 1 deletion packages/client-rpc-handlers/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions packages/client-rpc/README.md
@@ -1,13 +1,3 @@
[![polkadotjs](https://img.shields.io/badge/polkadot-js-orange.svg?style=flat-square)](https://polkadot.js.org)
![isc](https://img.shields.io/badge/license-ISC-lightgrey.svg?style=flat-square)
[![style](https://img.shields.io/badge/code%20style-semistandard-lightgrey.svg?style=flat-square)](https://github.com/Flet/semistandard)
[![npm](https://img.shields.io/npm/v/@polkadot/client-rpc.svg?style=flat-square)](https://www.npmjs.com/package/@polkadot/client-rpc)
[![travis](https://img.shields.io/travis/polkadot-js/client.svg?style=flat-square)](https://travis-ci.org/polkadot-js/client)
[![maintainability](https://img.shields.io/codeclimate/maintainability/polkadot-js/client.svg?style=flat-square)](https://codeclimate.com/github/polkadot-js/client/maintainability)
[![coverage](https://img.shields.io/coveralls/polkadot-js/client.svg?style=flat-square)](https://coveralls.io/github/polkadot-js/client?branch=master)
[![dependency](https://david-dm.org/polkadot-js/client.svg?style=flat-square&path=packages/client-rpc)](https://david-dm.org/polkadot-js/client?path=packages/client-rpc)
[![devDependency](https://david-dm.org/polkadot-js/client/dev-status.svg?style=flat-square&path=packages/client-rpc)](https://david-dm.org/polkadot-js/client?path=packages/client-rpc#info=devDependencies)

# @polkadot/client-rpc

An RPC server with configurable handlers. It is intended to be used in network clients to spin up a JsonRPC server with minimal configuration and boilerplate.
Expand Down
1 change: 0 additions & 1 deletion packages/client-rpc/package.json
Expand Up @@ -34,7 +34,6 @@
},
"dependencies": {
"@babel/runtime": "^7.1.2",
"@polkadot/client-rpc-handlers": "^0.16.5",
"@polkadot/util": "^0.32.9",
"@types/co-body": "^0.0.3",
"@types/koa": "^2.0.46",
Expand Down
2 changes: 1 addition & 1 deletion packages/client-rpc/src/handleMessage.spec.js
Expand Up @@ -22,7 +22,7 @@ const mockHandlers = ({
echo: (...params) => Promise.resolve(`echo: ${params.join(', ')}`)
});

jest.mock('@polkadot/client-rpc-handlers/index', () => () => mockHandlers);
jest.mock('./handlers/index', () => () => mockHandlers);

import Rpc from './index';

Expand Down
2 changes: 1 addition & 1 deletion packages/client-rpc/src/handleWs.spec.js
Expand Up @@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.

jest.mock('@polkadot/client-rpc-handlers/index', () => () => ({
jest.mock('./handlers/index', () => () => ({
test: jest.fn(() => Promise.resolve('test'))
}));

Expand Down
@@ -1,4 +1,4 @@
// Copyright 2017-2018 @polkadot/client-rpc-handlers authors & contributors
// Copyright 2017-2018 @polkadot/client-rpc authors & contributors
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.

Expand Down
@@ -1,4 +1,4 @@
// Copyright 2017-2018 @polkadot/client-rpc-handlers authors & contributors
// Copyright 2017-2018 @polkadot/client-rpc authors & contributors
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.

Expand Down
@@ -1,4 +1,4 @@
// Copyright 2017-2018 @polkadot/client-rpc-handlers authors & contributors
// Copyright 2017-2018 @polkadot/client-rpc authors & contributors
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.

Expand Down
@@ -1,4 +1,4 @@
// Copyright 2017-2018 @polkadot/client-rpc-handlers authors & contributors
// Copyright 2017-2018 @polkadot/client-rpc authors & contributors
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.

Expand Down
@@ -1,4 +1,4 @@
// Copyright 2017-2018 @polkadot/client-rpc-handlers authors & contributors
// Copyright 2017-2018 @polkadot/client-rpc authors & contributors
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.

Expand Down

0 comments on commit 2d02568

Please sign in to comment.