From 5d26f1ec61c02ed12ef74080de1c8955ce1dee2c Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 1 Sep 2023 09:20:12 -0400 Subject: [PATCH] refactor: export SignedRegistryEntry --- src/service/registry.ts | 9 +-------- src/types.ts | 7 +++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/service/registry.ts b/src/service/registry.ts index 0f31650..2062c2d 100644 --- a/src/service/registry.ts +++ b/src/service/registry.ts @@ -1,4 +1,4 @@ -import { Logger, Peer, S5Config } from "#types.js"; +import { Logger, Peer, S5Config, SignedRegistryEntry } from "#types.js"; import { AbstractLevel, AbstractSublevel } from "abstract-level"; import { mkeyEd25519, @@ -16,13 +16,6 @@ import { EventEmitter } from "events"; import KeyPairEd25519 from "#ed25519.js"; import { S5Node, stringifyBytes } from "#node.js"; -export interface SignedRegistryEntry { - pk: Uint8Array; // public key with multicodec prefix - revision: number; // revision number of this entry, maximum is (256^8)-1 - data: Uint8Array; // data stored in this entry, can have a maximum length of 48 bytes - signature: Uint8Array; // signature of this registry entry -} - export class RegistryService { private db?: AbstractSublevel< AbstractLevel, diff --git a/src/types.ts b/src/types.ts index 454f544..2e3e2b0 100644 --- a/src/types.ts +++ b/src/types.ts @@ -97,3 +97,10 @@ export type P2PSignedMessageHandler = ( message: SignedMessage, verifyId: boolean, ) => Promise; + +export interface SignedRegistryEntry { + pk: Uint8Array; // public key with multicodec prefix + revision: number; // revision number of this entry, maximum is (256^8)-1 + data: Uint8Array; // data stored in this entry, can have a maximum length of 48 bytes + signature: Uint8Array; // signature of this registry entry +}