From 87d1e6b0b4f4b7ec7ae9af85b9afae5c4eaa8630 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 31 Aug 2023 06:54:16 -0400 Subject: [PATCH] fix: update registered messages --- src/messages/index.ts | 17 ++++++++++++++++- src/messages/signedMessages/index.ts | 8 +++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/messages/index.ts b/src/messages/index.ts index 425d71c..2419d1c 100644 --- a/src/messages/index.ts +++ b/src/messages/index.ts @@ -1,9 +1,24 @@ import { P2PMessageHandler } from "#types.js"; import handshakeOpen from "#messages/handshakeOpen.js"; +import { + protocolMethodHandshakeOpen, + protocolMethodRegistryQuery, + protocolMethodSignedMessage, + recordTypeRegistryEntry, + recordTypeStorageLocation, +} from "#constants.js"; +import registryQuery from "#messages/registryQuery.js"; +import registryEntry from "#messages/registryEntry.js"; +import storageLocation from "#messages/storageLocation.js"; +import signedMessage from "#messages/signedMessage.js"; const messages = new Map( Object.entries({ - protocolMethodHandshakeOpen: handshakeOpen, + [protocolMethodHandshakeOpen]: handshakeOpen, + [protocolMethodRegistryQuery]: registryQuery, + [recordTypeRegistryEntry]: registryEntry, + [recordTypeStorageLocation]: storageLocation, + [protocolMethodSignedMessage]: signedMessage, }).map(([key, value]) => [Number(key), value]), ); diff --git a/src/messages/signedMessages/index.ts b/src/messages/signedMessages/index.ts index e3a60fc..660da7b 100644 --- a/src/messages/signedMessages/index.ts +++ b/src/messages/signedMessages/index.ts @@ -1,9 +1,15 @@ import { P2PSignedMessageHandler } from "#types.js"; import handshakeDone from "#messages/signedMessages/handshakeDone.js"; +import { + protocolMethodAnnouncePeers, + protocolMethodHandshakeDone, +} from "#constants.js"; +import announcePeers from "#messages/signedMessages/announcePeers.js"; const messages = new Map( Object.entries({ - protocolMethodHandshakeOpen: handshakeDone, + [protocolMethodHandshakeDone]: handshakeDone, + [protocolMethodAnnouncePeers]: announcePeers, }).map(([key, value]) => [Number(key), value]), );