From ab7511576661a8e35640fe3349ad2156849a3aeb Mon Sep 17 00:00:00 2001 From: Brian Botha Date: Tue, 27 Sep 2022 17:50:09 +1000 Subject: [PATCH] fix: removed discovery utils and types These are not needed anymore since we don't make use of a discovery ID generator. --- src/discovery/Discovery.ts | 2 -- src/discovery/types.ts | 11 ----------- src/discovery/utils.ts | 13 ------------- 3 files changed, 26 deletions(-) delete mode 100644 src/discovery/types.ts delete mode 100644 src/discovery/utils.ts diff --git a/src/discovery/Discovery.ts b/src/discovery/Discovery.ts index 6181f35387..dab087f944 100644 --- a/src/discovery/Discovery.ts +++ b/src/discovery/Discovery.ts @@ -25,9 +25,7 @@ import { CreateDestroyStartStop, ready, } from '@matrixai/async-init/dist/CreateDestroyStartStop'; -// TODO: decide what to do with the discover utils import * as tasksErrors from 'tasks/errors'; -import * as discoveryUtils from './utils'; import * as discoveryErrors from './errors'; import * as nodesErrors from '../nodes/errors'; import * as networkErrors from '../network/errors'; diff --git a/src/discovery/types.ts b/src/discovery/types.ts deleted file mode 100644 index c91021c7e0..0000000000 --- a/src/discovery/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Opaque } from '../types'; -import type { Id } from '@matrixai/id'; - -/** - * Used to preserve order in the Discovery Queue. - */ -type DiscoveryQueueId = Opaque<'DiscoveryQueueId', Id>; - -type DiscoveryQueueIdGenerator = () => DiscoveryQueueId; - -export type { DiscoveryQueueId, DiscoveryQueueIdGenerator }; diff --git a/src/discovery/utils.ts b/src/discovery/utils.ts deleted file mode 100644 index b0c774a638..0000000000 --- a/src/discovery/utils.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { DiscoveryQueueId, DiscoveryQueueIdGenerator } from './types'; -import { IdSortable } from '@matrixai/id'; - -function createDiscoveryQueueIdGenerator( - lastId?: DiscoveryQueueId, -): DiscoveryQueueIdGenerator { - const idSortableGenerator = new IdSortable({ - lastId, - }); - return (): DiscoveryQueueId => idSortableGenerator.get(); -} - -export { createDiscoveryQueueIdGenerator };