Add pubsub interface definition (#54)

* Add pubsub interface definition

* Functional JsonRpcCoder

* Functional HttpProvider

* Functional WsProvider

* Functional split completed

* Split actual method subscription

* Update flow

* Flatten no user-specified array in sub call
This commit is contained in:
Jaco Greeff
2018-03-15 12:59:49 +01:00
committed by GitHub
parent e84bd1b36b
commit 21c14bd85c
66 changed files with 2500 additions and 1113 deletions
@@ -0,0 +1,19 @@
// Copyright 2017-2018 Jaco Greeff
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
const createCoder = require('./index');
describe('encodeJson', () => {
let coder;
beforeEach(() => {
coder = createCoder();
});
it('encodes a valid JsonRPC JSON string', () => {
expect(
coder.encodeJson('method', 'params')
).toEqual('{"id":1,"jsonrpc":"2.0","method":"method","params":"params"}');
});
});