Split interface creation (#50)

* Split interface creation

* Lint fixes

* Update @polkadot dependencies
This commit is contained in:
Jaco Greeff
2018-01-25 15:19:56 +01:00
committed by GitHub
parent 20f120fccd
commit 263289a343
16 changed files with 208 additions and 283 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-provider",
"version": "0.6.12",
"version": "0.7.0",
"description": "Transport providers for the API",
"main": "index.js",
"keywords": [
@@ -34,7 +34,7 @@
"nock": "^9.1.0"
},
"dependencies": {
"@polkadot/util": "^0.11.1",
"@polkadot/util": "^0.13.1",
"babel-runtime": "^6.26.0",
"isomorphic-fetch": "^2.2.1",
"websocket": "^1.0.25"
@@ -24,6 +24,7 @@ module.exports = class JsonRpcCoder {
throw new Error(`[${code}]: ${message}`);
}
assert(!isUndefined(response.result), 'No result found in JsonRpc response');
return response.result;
+3 -15
View File
@@ -207,28 +207,16 @@ describe('Ws', () => {
});
describe('queued', () => {
let sendPromise;
beforeEach(() => {
ws = createWs([{
it('sends messages when connected', () => {
const ws = createWs([{
id: 1,
method: 'test_queue',
reply: {
result: 'ok'
}
}], false);
sendPromise = ws.send('test_queue', []);
});
const sendPromise = ws.send('test_queue', []);
it('sends messages when connected', () => {
ws.connect();
return sendPromise.then((result) => {
expect(result).toEqual('ok');
});
});
it('sends messages when connected (errors)', () => {
ws.connect();
return sendPromise.then((result) => {