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:
@@ -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"}');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user