From 792dc5d514524b0d302cca1f4458d62646525713 Mon Sep 17 00:00:00 2001 From: Adel Golghalyani Date: Fri, 11 Aug 2023 09:55:28 +0200 Subject: [PATCH] refactor: change return type --- src/messaging/CredentialApiMessageType.ts | 3 ++- src/tests/index.ts | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/messaging/CredentialApiMessageType.ts b/src/messaging/CredentialApiMessageType.ts index ac2788a..ac81073 100644 --- a/src/messaging/CredentialApiMessageType.ts +++ b/src/messaging/CredentialApiMessageType.ts @@ -104,8 +104,9 @@ export function ensureOwnerIsSender(message: IMessage): void { * * @param decryptedMessage The decrypted message to check. */ -export function verify(decryptedMessage: IMessage): void { +export function assertKnownMessage(decryptedMessage: IMessage): IMessage['body'] { verifyMessageBody(decryptedMessage) verifyMessageEnvelope(decryptedMessage) ensureOwnerIsSender(decryptedMessage) + return decryptedMessage.body } diff --git a/src/tests/index.ts b/src/tests/index.ts index 68a3e17..bf4c9a1 100644 --- a/src/tests/index.ts +++ b/src/tests/index.ts @@ -1,2 +1,9 @@ +/** + * Copyright (c) 2018-2023, BOTLabs GmbH. + * + * This source code is licensed under the BSD 4-Clause "Original" license + * found in the LICENSE file in the root directory of this source tree. + */ + export * from './messageUtils' export * from './utils'