fix: update registered messages

This commit is contained in:
Derrick Hammer 2023-08-31 06:54:16 -04:00
parent 35ebf74f4c
commit 87d1e6b0b4
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 23 additions and 2 deletions

View File

@ -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<number, P2PMessageHandler>(
Object.entries({
protocolMethodHandshakeOpen: handshakeOpen,
[protocolMethodHandshakeOpen]: handshakeOpen,
[protocolMethodRegistryQuery]: registryQuery,
[recordTypeRegistryEntry]: registryEntry,
[recordTypeStorageLocation]: storageLocation,
[protocolMethodSignedMessage]: signedMessage,
}).map(([key, value]) => [Number(key), value]),
);

View File

@ -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<number, P2PSignedMessageHandler>(
Object.entries({
protocolMethodHandshakeOpen: handshakeDone,
[protocolMethodHandshakeDone]: handshakeDone,
[protocolMethodAnnouncePeers]: announcePeers,
}).map(([key, value]) => [Number(key), value]),
);