Rewrite yarn.lock (#2127)
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user