Skip to content

Commit

Permalink
Merge e8b9e59 into 7157fff
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr committed Aug 24, 2018
2 parents 7157fff + e8b9e59 commit bddf9e0
Show file tree
Hide file tree
Showing 100 changed files with 4,269 additions and 2,144 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,6 +3,7 @@ coverage/
node_modules/
tmp/
packages/client-wasm/test/wasm-bin
test.sh
.DS_Store
.env.local
.env.development.local
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "10.6"
- "10.7"
cache:
yarn: true
directories:
Expand Down
3 changes: 1 addition & 2 deletions lerna.json
@@ -1,5 +1,4 @@
{
"lerna": "2.5.1",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
Expand All @@ -10,5 +9,5 @@
"packages": [
"packages/*"
],
"version": "0.13.8"
"version": "0.15.0"
}
13 changes: 6 additions & 7 deletions package.json
Expand Up @@ -2,29 +2,28 @@
"version": "0.13.8",
"private": true,
"engines": {
"node": "^10.6.0",
"node": "^10.7.0",
"yarn": "^1.3.2"
},
"workspaces": [
"packages/*"
],
"resolutions": {
"babel-core": "^7.0.0-bridge.0",
"typescript": "^2.9.2"
"typescript": "^3.0.1"
},
"scripts": {
"build": "polkadot-dev-build-ts && cp -r packages/client/scripts build",
"check": "tslint --project . && tsc --noEmit",
"check": "tslint --project . && tsc --version && tsc --noEmit",
"clean": "polkadot-dev-clean-build",
"postinstall": "polkadot-dev-yarn-only",
"test": "NODE_OPTIONS=--experimental-worker jest --coverage",
"start": "NODE_OPTIONS=--experimental-worker node packages/client/scripts/polkadot.js --db-path ./tmp/start-1",
"start": "NODE_OPTIONS=--experimental-worker node packages/client/scripts/polkadot.js",
"start2": "NODE_OPTIONS=--experimental-worker node packages/client/scripts/polkadot.js --db-path ./tmp/start-2 --p2p-nodes /ip4/127.0.0.1/tcp/39933/ipfs/QmfUiXCYtrKotHgDbP4Kc74NUi2LxckEiAdkK1SMSosLaz --p2p-port 39934 --rpc-port 9934",
"start-rust": "NODE_OPTIONS=--experimental-worker node packages/client/scripts/polkadot.js --db-path ./tmp/start-rust --p2p-nodes /ip4/127.0.0.1/tcp/30333/ipfs/QmXBQmmjNsBLobf5Xx8Kqz7rvUrGgiBLTYm2EmQvcZyrKR --p2p-port 39935 --rpc-port 9935"
},
"devDependencies": {
"@polkadot/dev": "^0.20.12",
"@polkadot/ts": "^0.1.9",
"lerna": "^2.11.0"
"@polkadot/dev": "^0.20.18",
"@polkadot/ts": "^0.1.17"
}
}
33 changes: 14 additions & 19 deletions packages/client-chains/package.json
@@ -1,6 +1,6 @@
{
"name": "@polkadot/client-chains",
"version": "0.13.8",
"version": "0.15.0",
"description": "Node configuration definitions for specific chains",
"main": "index.js",
"keywords": [
Expand All @@ -27,26 +27,21 @@
"url": "https://github.com/polkadot-js/client/issues"
},
"homepage": "https://github.com/polkadot-js/client/client/tree/master/packages/client-chains#readme",
"scripts": {
"build": "polkadot-dev-build-babel",
"check": "eslint src && flow check",
"test": "echo \"Tests only available from root wrapper\""
},
"dependencies": {
"@babel/runtime": "^7.0.0-beta.51",
"@polkadot/client-db-chain": "^0.13.8",
"@polkadot/client-runtime": "^0.13.8",
"@polkadot/client-wasm": "^0.13.8",
"@polkadot/storage": "^0.26.20",
"@polkadot/util": "^0.26.20",
"@polkadot/util-crypto": "^0.26.20",
"@polkadot/util-keyring": "^0.26.20"
"@babel/runtime": "^7.0.0-rc.1",
"@polkadot/client-db-chain": "^0.15.0",
"@polkadot/client-runtime": "^0.15.0",
"@polkadot/client-wasm": "^0.15.0",
"@polkadot/storage": "^0.28.22",
"@polkadot/util": "^0.28.7",
"@polkadot/util-crypto": "^0.28.7",
"@polkadot/util-keyring": "^0.28.7"
},
"devDependencies": {
"@polkadot/client": "^0.13.8",
"@polkadot/client-db": "^0.13.8",
"@polkadot/extrinsics": "^0.26.20",
"@polkadot/primitives": "^0.26.20",
"@polkadot/storage": "^0.26.20"
"@polkadot/client": "^0.15.0",
"@polkadot/client-db": "^0.15.0",
"@polkadot/extrinsics": "^0.28.22",
"@polkadot/primitives": "^0.28.22",
"@polkadot/storage": "^0.28.22"
}
}
@@ -1,4 +1,8 @@
{
"name": "Development",
"id": "dev",
"bootNodes": [],
"genesis": {"raw": {
"0x1d007e138cb61e2524a67b15ec01d8cb": "0x00000000000000600000000000000000",
"0x81c1e7165a6371a30eda241a30ea26dd": "0x02000000000000000000000000000000",
"0x3a617574683a00000000": "0xd172a74cda4c865912c32ba0a80a57ae69abae410e5ccb59dee84e2f4432db4f",
Expand Down Expand Up @@ -52,4 +56,4 @@
"0x6cac40e934558080fbf29c55c113b461": "0x0000000000000000",
"0x1d72be21946c0b245c026b7be8256cc5": "0x00000000",
"0x62201b976748f389b2c7d8759ee5e0f8": "0x00000000000000000000000000000000"
}
}}}
Expand Up @@ -3,15 +3,11 @@
// of the ISC license. See the LICENSE file for details.

import toU8a from '@polkadot/util/u8a/toU8a';
import HashDb from '@polkadot/client-db/Hash';
import MemoryDb from '@polkadot/client-db/Memory';

import Chain from '../index';

describe('genesis', () => {
const blockDb = new HashDb();
const stateDb = new MemoryDb();
const genesis = new Chain({ chain: 'dev' }, stateDb, blockDb).genesis;
const genesis = new Chain({ chain: 'dev' }).genesis;

it('creates a correct genesis block (stateRoot)', () => {
expect(
Expand Down Expand Up @@ -42,8 +38,4 @@ describe('genesis', () => {
])
);
});

it('terminates', () => {
return stateDb.terminate();
});
});
11 changes: 7 additions & 4 deletions packages/client-chains/src/chains/index.ts
Expand Up @@ -2,10 +2,13 @@
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.

import { ChainGenesisState } from '../types';
import { ChainJson } from '../types';

const dev = (require('./chain-dev.json') as ChainGenesisState);
const dev = (require('./dev.json') as ChainJson);
const krummelanke = (require('./krummelanke.json') as ChainJson);

export default ({
dev
} as { [index: string]: ChainGenesisState });
dev,
krummelanke,
test: krummelanke
} as { [index: string]: ChainJson });
51 changes: 51 additions & 0 deletions packages/client-chains/src/chains/krummelanke.json

Large diffs are not rendered by default.

14 changes: 4 additions & 10 deletions packages/client-chains/src/index.spec.js
Expand Up @@ -2,33 +2,27 @@
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.

import HashDb from '@polkadot/client-db/Hash';
import MemoryDb from '@polkadot/client-db/Memory';
import HashDb from '@polkadot/client-db/Hash/Memory';
import MemoryDb from '@polkadot/client-db/Trie/Memory';

import Chain from './index';

describe('client-chains', () => {
const config = {
chain: 'dev'
};
const blockDb = new HashDb();
const stateDb = new MemoryDb();

it('instantiates a known chain', () => {
expect(
new Chain(config, stateDb, blockDb).executor
new Chain(config).executor
).toBeDefined();
});

it('throws when chain not found', () => {
config.chain = 'someUnknown';

expect(
() => new Chain(config, stateDb, blockDb)
() => new Chain(config)
).toThrow(/Unable to find builtin chain/);
});

it('terminates', () => {
return stateDb.terminate();
});
});

0 comments on commit bddf9e0

Please sign in to comment.