Rewrite yarn.lock (#2127)

This commit is contained in:
Jaco Greeff
2020-04-01 23:49:56 +02:00
committed by GitHub
parent 1f97c5e9e3
commit 58de0b8b9c
37 changed files with 172 additions and 154 deletions
+1
View File
@@ -86,6 +86,7 @@ export default class HttpProvider implements ProviderInterface {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public on (type: ProviderInterfaceEmitted, sub: ProviderInterfaceEmitCb): () => void {
l.error('HTTP Provider does not have \'on\' emitters, use WebSockets instead');
return (): void => {
// noop
};
+1
View File
@@ -104,6 +104,7 @@ export default class Mock implements ProviderInterface {
public on (type: ProviderInterfaceEmitted, sub: ProviderInterfaceEmitCb): () => void {
this.emitter.on(type, sub);
return (): void => {
this.emitter.removeListener(type, sub);
};
@@ -18,6 +18,7 @@ describe('on', (): void => {
it('it emits both connected and disconnected events', (done): void => {
const events: Record<string, boolean> = { connected: false, disconnected: false };
const handler = (type: ProviderInterfaceEmitted): void => {
mock.on(type, (): void => {
events[type] = true;
+3
View File
@@ -182,6 +182,7 @@ export default class WsProvider implements WSProviderInterface {
try {
const json = this.#coder.encodeJson(method, params);
const id = this.#coder.getId();
const callback = (error?: Error | null, result?: any): void => {
error
? reject(error)
@@ -299,6 +300,7 @@ export default class WsProvider implements WSProviderInterface {
if (!handler) {
l.debug((): string => `Unable to find handler for id=${response.id}`);
return;
}
@@ -341,6 +343,7 @@ export default class WsProvider implements WSProviderInterface {
this.#waitingForId[subId] = response;
l.debug((): string => `Unable to find handler for subscription=${subId}`);
return;
}