UNPKG

@waku/sdk

Version:

A unified SDK for easy creation and management of js-waku nodes.

15 lines 580 B
import { ProtocolError } from "@waku/interfaces"; export const shouldPeerBeChanged = (failure) => { const toBeChanged = failure === ProtocolError.REMOTE_PEER_REJECTED || failure === ProtocolError.NO_RESPONSE || failure === ProtocolError.RLN_PROOF_GENERATION || failure === ProtocolError.NO_PEER_AVAILABLE; if (toBeChanged) { return true; } return false; }; export const timeout = (timeout) => { return new Promise((_, reject) => setTimeout(() => reject(new Error("Task timeout")), timeout)); }; //# sourceMappingURL=utils.js.map