Skip to content

Commit

Permalink
refactor: change return type
Browse files Browse the repository at this point in the history
  • Loading branch information
Ad96el committed Aug 14, 2023
1 parent 1aa812a commit 792dc5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/messaging/CredentialApiMessageType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
7 changes: 7 additions & 0 deletions src/tests/index.ts
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit 792dc5d

Please sign in to comment.