Bump common (#2832)

* Bump common

* Update for new common non-default exports

* Don't export createSubmittable

* Adjust exports

* default export adjustments

* Some additional non-default exports
This commit is contained in:
Jaco Greeff
2020-11-09 19:41:29 +01:00
committed by GitHub
parent e787c08bd9
commit 21d0622f84
116 changed files with 1245 additions and 1270 deletions
+5 -5
View File
@@ -1,19 +1,19 @@
// Copyright 2017-2020 @polkadot/rpc-core authors & contributors
// SPDX-License-Identifier: Apache-2.0
import testingPairs from '@polkadot/keyring/testingPairs';
import { createTestPairs } from '@polkadot/keyring/testingPairs';
import MockProvider from '@polkadot/rpc-provider/mock';
import { TypeRegistry } from '@polkadot/types';
import Rpc from '.';
import { RpcCore } from '.';
describe('Cached Observables', (): void => {
const registry = new TypeRegistry();
let rpc: Rpc;
const keyring = testingPairs();
let rpc: RpcCore;
const keyring = createTestPairs();
beforeEach((): void => {
rpc = new Rpc('123', registry, new MockProvider(registry));
rpc = new RpcCore('123', registry, new MockProvider(registry));
});
it('creates a single observable for subscriptions (multiple calls)', (): void => {
+3 -3
View File
@@ -5,19 +5,19 @@ import MockProvider from '@polkadot/rpc-provider/mock';
import { TypeRegistry } from '@polkadot/types';
import { isFunction } from '@polkadot/util';
import Rpc from '.';
import { RpcCore } from '.';
describe('Api', (): void => {
const registry = new TypeRegistry();
it('requires a provider with a send method', (): void => {
expect(
(): Rpc => new Rpc('234', registry, {} as any)
() => new RpcCore('234', registry, {} as any)
).toThrow(/Expected Provider/);
});
it('allows for the definition of user RPCs', (): void => {
const rpc = new Rpc('567', registry, new MockProvider(registry), {
const rpc = new RpcCore('567', registry, new MockProvider(registry), {
testing: {
foo: {
description: 'foo',
+2 -2
View File
@@ -61,13 +61,13 @@ function logErrorMessage (method: string, { params, type }: DefinitionRpc, error
*
* ```javascript
* import Rpc from '@polkadot/rpc-core';
* import WsProvider from '@polkadot/rpc-provider/ws';
* import { WsProvider } from '@polkadot/rpc-provider/ws';
*
* const provider = new WsProvider('ws://127.0.0.1:9944');
* const rpc = new Rpc(provider);
* ```
*/
export default class Rpc implements RpcInterface {
export class RpcCore implements RpcInterface {
#instanceId: string;
#registryDefault: Registry;
+3 -3
View File
@@ -5,11 +5,11 @@ import { DefinitionRpc } from '@polkadot/types/types';
import { TypeRegistry } from '@polkadot/types';
import Rpc from '.';
import { RpcCore } from '.';
describe('methodSend', (): void => {
const registry = new TypeRegistry();
let rpc: Rpc;
let rpc: RpcCore;
let methods: Record<string, DefinitionRpc>;
let provider: any;
@@ -35,7 +35,7 @@ describe('methodSend', (): void => {
})
};
rpc = new Rpc('987', registry, provider);
rpc = new RpcCore('987', registry, provider);
});
it('checks for mismatched parameters', (done): void => {
+3 -3
View File
@@ -5,14 +5,14 @@ import { Observable, of } from 'rxjs';
import MockProvider from '@polkadot/rpc-provider/mock';
import { TypeRegistry } from '@polkadot/types';
import Rpc from '.';
import { RpcCore } from '.';
describe('replay', (): void => {
const registry = new TypeRegistry();
let rpc: Rpc;
let rpc: RpcCore;
beforeEach((): void => {
rpc = new Rpc('653', registry, new MockProvider(registry));
rpc = new RpcCore('653', registry, new MockProvider(registry));
});
it('subscribes via the rpc section', (done): void => {